Zmninja connect with zoneminder multi-server

Discussion topics related to mobile applications for ZoneMinder
nevermind19
Posts: 13
Joined: Fri Oct 16, 2015 11:25 pm

Zmninja connect with zoneminder multi-server

Post by nevermind19 » Sat Mar 30, 2019 11:10 am

Good Morning ,
I have trouble with ZmNinja from when i started to use the multiserver in zoneminder (ver. 1.32.3).
I have a configuration with 2 server zoneminder (the names are: "Server" and "srv01") and 1 storage and all work perfectly ,from web i have correct connection ,correct record , i see all ok at home and also out of home.So i think all it's configure perfectly...
The problem it's with ZmNinja , i tried to connect to zoneminder to one of these servers with the app,and...the connection it's good ,it seems all ok , but i can't see the streaming of the other server , i mean can only see the streaming of the videocameras are connected in the server with the name "Server" ...so the others videos(of the videocameras in the other server with the name "srv01") in streaming i can't see these....in the log appear this message

Code: Select all

Date/Time
Component	Server	PID	Level	Message	File	Line
2019-03-30 11:55:45	zms_m8	Server	591	ERR	Got empty memory map file size 0, is the zmc process for this monitor running?	zm_monitor.cpp	538
2019-03-30 11:55:45	zms_m8	Server	591	ERR	Unable to connect to monitor id 8 for streaming	zm_stream.cpp	48
2019-03-30 11:55:45	zms_m8	Server	591	ERR	Unable to connect to zmc process for monitor 8	zms.cpp	254
Maybe in the configuration of zmninja i need to do something ?cause i see in the page of monitors ,the monitor with "id 8" have the streaming url not the url of the server "srv01" but the mainly server with the name "Server"....so can i do for fix this problem?

i hope i had explain good
Thanks

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Sat Mar 30, 2019 11:32 am

Please look at the zmNinja debug logs and post what its producing
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

nevermind19
Posts: 13
Joined: Fri Oct 16, 2015 11:25 pm

Re: Zmninja connect with zoneminder multi-server

Post by nevermind19 » Sat Mar 30, 2019 12:56 pm

Ok , this is the log from the app in my smartphone
On this log you can see the start of the app , the montage of the videos and after, i tried to open the video of the other videocamera(share from the other server "srv01")

Code: Select all

2019-03-30T12:52:01.798Z INFO ******* app .run device ready
Mar 30, 2019 01:52:01 PM INFO Device is ready
Mar 30, 2019 01:52:01 PM INFO You are running on android
Mar 30, 2019 01:52:01 PM DEBUG Inside configureStorageDB
Mar 30, 2019 01:52:01 PM DEBUG configureStorageDB: trying order:["asyncStorage","localStorageWrapper"]
Mar 30, 2019 01:52:01 PM INFO configureStorageDB:localforage driver for storage:asyncStorage
Mar 30, 2019 01:52:01 PM DEBUG configureStorageDB:Making sure this storage driver works...
Mar 30, 2019 01:52:01 PM DEBUG configureStorageDB:test get/set worked, this driver is ok...
Mar 30, 2019 01:52:01 PM INFO localforage driver:asyncStorage
Mar 30, 2019 01:52:01 PM INFO CloudSync: Syncing with cloud if enabled...
Mar 30, 2019 01:52:01 PM INFO user profile encrypted, decoding...
Mar 30, 2019 01:52:02 PM INFO Found valid local configuration, overwriting cloud settings...
Mar 30, 2019 01:52:02 PM INFO local data synced with cloud...
Mar 30, 2019 01:52:02 PM INFO Cloudsync operation complete, continuing...
Mar 30, 2019 01:52:02 PM INFO >>>>No data to import....
Mar 30, 2019 01:52:02 PM INFO Updating statusbar
Mar 30, 2019 01:52:02 PM INFO Retrieving language before init is called...
Mar 30, 2019 01:52:02 PM INFO App Version: 1.3.055
Mar 30, 2019 01:52:02 PM INFO Language stored as:it
Mar 30, 2019 01:52:02 PM INFO Device Language is:it
Mar 30, 2019 01:52:02 PM INFO >>>>Language to be used:undefined
Mar 30, 2019 01:52:02 PM DEBUG isFirstUse returned: false
Mar 30, 2019 01:52:02 PM DEBUG last state=app.log param=[object Object]
Mar 30, 2019 01:52:02 PM INFO Language file loaded, continuing with rest
Mar 30, 2019 01:52:02 PM INFO ZMData init: checking for stored variables & setting up log file
Mar 30, 2019 01:52:02 PM INFO Checking for new version updates...
Mar 30, 2019 01:52:02 PM INFO Checking for news updates
Mar 30, 2019 01:52:02 PM INFO Setting up POST LOGIN timer
Mar 30, 2019 01:52:02 PM INFO Setting up pause and resume handler AFTER language is loaded...
Mar 30, 2019 01:52:02 PM DEBUG Android detected, using cordova-multiwindow plugin for onStop/onStart instead
Mar 30, 2019 01:52:02 PM INFO user profile encrypted, decoding...
Mar 30, 2019 01:52:02 PM DEBUG timeline graph type not set. Setting to all
Mar 30, 2019 01:52:02 PM INFO Setting NVR init bandwidth to: highbw
Mar 30, 2019 01:52:02 PM INFO NVR init retrieved store loginData
Mar 30, 2019 01:52:02 PM INFO >>>> Disabling strict SSL checking (turn off  in Dev Options if you can't connect)
Mar 30, 2019 01:52:02 PM INFO >>> Android: enabling inline image view for self signed certs
Mar 30, 2019 01:52:02 PM INFO Inside init-complete in app.js: All init over, going to portal login
Mar 30, 2019 01:52:02 PM DEBUG --> SSL is permissive, will allow any certs. Use at your own risk.
Mar 30, 2019 01:52:02 PM INFO Entering Portal Main
Mar 30, 2019 01:52:02 PM DEBUG Inside Portal login Enter handler
Mar 30, 2019 01:52:02 PM INFO User credentials are provided
Mar 30, 2019 01:52:02 PM INFO not checking for touchID
Mar 30, 2019 01:52:02 PM DEBUG unlock called with check PIN=true
Mar 30, 2019 01:52:02 PM DEBUG PIN code entered is correct, or there is no PIN set
Mar 30, 2019 01:52:02 PM INFO Cancelling zmAutologin timer
Mar 30, 2019 01:52:02 PM DEBUG Clearing cookies
Mar 30, 2019 01:52:02 PM INFO http://xxxxxxxxx:10001/zm=>Logging out of any existing ZM sessions...
Mar 30, 2019 01:52:02 PM DEBUG Logging out using API method
Mar 30, 2019 01:52:03 PM DEBUG Latest post dated 2019-02-03 23:07:19 but you read 2019-02-03 23:07:19
Mar 30, 2019 01:52:03 PM DEBUG current version: 1.3.055 & available version 1.3.050
Mar 30, 2019 01:52:03 PM DEBUG Logout returned... 
Mar 30, 2019 01:52:03 PM DEBUG Resetting zmCookie...
Mar 30, 2019 01:52:03 PM INFO zmAutologin called
Mar 30, 2019 01:52:03 PM DEBUG API based login returned... 
Mar 30, 2019 01:52:03 PM DEBUG Setting server version to:1.32.3
Mar 30, 2019 01:52:03 PM INFO Stream authentication construction: 
Mar 30, 2019 01:52:03 PM INFO zmAutologin successfully logged into Zoneminder via API
Mar 30, 2019 01:52:03 PM DEBUG auth-success broadcast:Successful
Mar 30, 2019 01:52:03 PM DEBUG PortalLogin: auth success
Mar 30, 2019 01:52:03 PM DEBUG getAPIversion called with http://xxxxxxxxx:10001/zm/api/host/getVersion.json
Mar 30, 2019 01:52:03 PM DEBUG snapshot  supported in image.php
Mar 30, 2019 01:52:03 PM DEBUG Setting server version to:1.32.3
Mar 30, 2019 01:52:03 PM DEBUG getAPI version succeeded with 1.32.3
Mar 30, 2019 01:52:03 PM INFO Got API version: 1.32.3
Mar 30, 2019 01:52:03 PM INFO First invocation of TimeZone, asking server
Mar 30, 2019 01:52:03 PM INFO EventSever: No Event Server present. Not initializing
Mar 30, 2019 01:52:03 PM DEBUG Transitioning state to: app.log with param {}
Mar 30, 2019 01:52:03 PM DEBUG Timezone API response is:Europe/Rome
Mar 30, 2019 01:52:03 PM INFO ZM_EVENT_IMAGE_DIGITS is 5
Mar 30, 2019 01:52:04 PM DEBUG Real value of PRIVACY is:0
Mar 30, 2019 01:52:04 PM INFO --------->Setting up network state handlers....
Mar 30, 2019 01:52:04 PM INFO --------->Setting up global key handler...
Mar 30, 2019 01:52:05 PM INFO **** network online, but looks like it was not offline, not doing anything
Mar 30, 2019 01:52:06 PM DEBUG NVR: Regenerating connkeys...
Mar 30, 2019 01:52:06 PM INFO getMonitors:Loading all monitors
Mar 30, 2019 01:52:06 PM INFO Checking value of ZM_MIN_STREAMING_PORT for the first time
Mar 30, 2019 01:52:06 PM DEBUG Setting multi-port to:false
Mar 30, 2019 01:52:06 PM INFO ZM_MIN_STREAMING_PORT not configured, disabling
Mar 30, 2019 01:52:06 PM DEBUG ZMS Multiport reported: 0
Mar 30, 2019 01:52:06 PM DEBUG Monitor URL to fetch is:http://xxxxxxx:10001/zm/api/monitors/index/Type !=:WebSite.json
Mar 30, 2019 01:52:06 PM DEBUG Loading hidden/unhidden status for profile:
Mar 30, 2019 01:52:06 PM DEBUG Inside getMonitors, will also regen connkeys
Mar 30, 2019 01:52:06 PM DEBUG Now trying to get multi-server data, if present
Mar 30, 2019 01:52:06 PM INFO Monitor load was successful, loaded 2 monitors
Mar 30, 2019 01:52:06 PM INFO multi server list loaded:{"servers":[{"Server":{"Id":"2","Protocol":"http","Hostname":"xxxxxxx","Port":"10001","PathToIndex":"/zm/index.php","PathToZMS":"/zm/cgi-bin/nph-zms","PathToApi":"/zm/api","Name":"Server","State_Id":null,"Status":"Running","CpuLoad":null,"TotalMem":"8251285504","FreeMem":"2184126464","TotalSwap":"8476684288","FreeSwap":"8476684288","zmstats":true,"zmaudit":true,"zmtrigger":true}},{"Server":{"Id":"3","Protocol":"http","Hostname":"xxxxxxx","Port":"10002","PathToIndex":"/zm/index.php","PathToZMS":"/zm/cgi-bin/nph-zms","PathToApi":"/zm/api","Name":"srv01","State_Id":null,"Status":"Running","CpuLoad":"0.1","TotalMem":"1008730112","FreeMem":"70406144","TotalSwap":"2017456128","FreeSwap":"2005385216","zmstats":true,"zmaudit":true,"zmtrigger":false}}]}
Mar 30, 2019 01:52:06 PM DEBUG multi-server protocol will be:http://
Mar 30, 2019 01:52:06 PM DEBUG recording server reported  is {"scheme":"http","host":"xxxxxxx","path":"","reference":"absolute"}
Mar 30, 2019 01:52:06 PM DEBUG portal  parsed is {"scheme":"http","host":"xxxxxx","port":10001,"path":"/zm","reference":"absolute"}
Mar 30, 2019 01:52:06 PM DEBUG streaming url  parsed is {"scheme":"http","host":"xxxxxx","port":10001,"path":"/zm/cgi-bin","reference":"absolute"}
Mar 30, 2019 01:52:06 PM DEBUG multi-port is:0
Mar 30, 2019 01:52:06 PM DEBUG Storing baseurl=http://xxxxxxx:10001 streamingURL=http://xxxxxxx:10001/zm/cgi-bin recordingURL=http://xxxxxxxx:10001/zm
Mar 30, 2019 01:52:06 PM DEBUG recording server reported  is {"scheme":"http","host":"xxxxx","path":"","reference":"absolute"}
Mar 30, 2019 01:52:06 PM DEBUG portal  parsed is {"scheme":"http","host":"xxxxx","port":10001,"path":"/zm","reference":"absolute"}
Mar 30, 2019 01:52:06 PM DEBUG streaming url  parsed is {"scheme":"http","host":"xxxxxx","port":10001,"path":"/zm/cgi-bin","reference":"absolute"}
Mar 30, 2019 01:52:06 PM DEBUG multi-port is:0
Mar 30, 2019 01:52:06 PM DEBUG Storing baseurl=http://xxxxxx:10001 streamingURL=http://xxxxxx:10001/zm/cgi-bin recordingURL=http://xxxxx:10001/zm
Mar 30, 2019 01:52:06 PM DEBUG Loading hidden/unhidden status for profile:
Mar 30, 2019 01:52:06 PM INFO sending Cached ZM_MIN_STREAMING_PORT 0
Mar 30, 2019 01:52:06 PM DEBUG Multiport=0
Mar 30, 2019 01:52:06 PM DEBUG bandwidth: highbw montage refresh set to: 2
Mar 30, 2019 01:52:06 PM DEBUG Setting up cycle interval of:10000
Mar 30, 2019 01:52:06 PM DEBUG skipping image refresh, packery is still loading
Mar 30, 2019 01:52:06 PM INFO Inside Montage Ctrl:We found 2 monitors
Mar 30, 2019 01:52:06 PM DEBUG MontageCtrl: Android detected, using cordova-multiwindow plugin for onStop/onStart instead
Mar 30, 2019 01:52:07 PM DEBUG Image load error for: 8 regenerated connKey is:580215
Mar 30, 2019 01:52:07 PM INFO found a packery layout
Mar 30, 2019 01:52:07 PM INFO Monitors that are active and not DOM hidden: 2 while grid has 2
Mar 30, 2019 01:52:07 PM DEBUG All images loaded, switching to snapshot...
Mar 30, 2019 01:52:07 PM INFO Arranging as per packery grid
Mar 30, 2019 01:52:07 PM DEBUG All images loaded, doing image layout
Mar 30, 2019 01:52:07 PM DEBUG doing the jiggle and dance...
Mar 30, 2019 01:52:09 PM DEBUG Image load error for: 8 regenerated connKey is:90024
Mar 30, 2019 01:52:11 PM DEBUG Image load error for: 8 regenerated connKey is:142406
Mar 30, 2019 01:52:13 PM DEBUG Image load error for: 8 regenerated connKey is:525155
Mar 30, 2019 01:52:15 PM DEBUG Image load error for: 8 regenerated connKey is:195490
Mar 30, 2019 01:52:16 PM DEBUG MontageCtrl: Open Monitor Modal with monitor Id=8 and Controllable:0 with control ID:null
Mar 30, 2019 01:52:16 PM INFO Cancelling montage timer, opening Modal
Mar 30, 2019 01:52:16 PM INFO Using stream mode single
Mar 30, 2019 01:52:16 PM DEBUG MonitorModalCtrl called from app.montage
Mar 30, 2019 01:52:16 PM DEBUG MonitorModal: Android detected, using cordova-multiwindow plugin for onStop/onStart instead
Mar 30, 2019 01:52:16 PM DEBUG configurePTZ: called with mid=8
Mar 30, 2019 01:52:16 PM INFO configurePTZ 8 is not PTZ controllable
Mar 30, 2019 01:52:26 PM INFO Invoking http://xxxxxxxx:10001/zm/api/monitors/alarm/id:8/command:status.json
Mar 30, 2019 01:52:28 PM DEBUG Modal is open, closing it
Mar 30, 2019 01:52:28 PM INFO Restarting montage timers...
Mar 30, 2019 01:52:28 PM DEBUG Deregistering handlers for multi-window
Mar 30, 2019 01:52:28 PM DEBUG Single monitor exited killing stream
Mar 30, 2019 01:52:28 PM DEBUG NVR: killing  live stream ck:562869
Mar 30, 2019 01:52:30 PM DEBUG Image load error for: 8 regenerated connKey is:79978
Mar 30, 2019 01:52:32 PM DEBUG Image load error for: 7 regenerated connKey is:621539
Mar 30, 2019 01:52:32 PM DEBUG Image load error for: 8 regenerated connKey is:696618
Mar 30, 2019 01:52:32 PM DEBUG Deregistering handlers for multi-window
Mar 30, 2019 01:52:33 PM INFO file location:file:///data/user/0/com.pliablepixels.zmninja_pro/files/zmNinjaLog.txt

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Sat Mar 30, 2019 1:00 pm

"streamingURL=http://xxxxxx:10001/zm/cgi-bin"

In your logs, take a look at what the streaming URL is. Compare it to the actual URL ZM is using in its console. If they don't match, the streaming won't work and this may indicate an issue with the setup. note that streamingURL=http://xxxxxx:10001/zm/cgi-bin needs to be accessible from the phone
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

nevermind19
Posts: 13
Joined: Fri Oct 16, 2015 11:25 pm

Re: Zmninja connect with zoneminder multi-server

Post by nevermind19 » Sat Mar 30, 2019 1:09 pm

Yes i understood this...but the URL streaming are 2 , i mean :

one is xxxxxx:10001 (for 1 videocamera)
and the second is xxxxx:10002 (for an other 1 videocamera)
multi server list loaded:{"servers":[{"Server":{"Id":"2","Protocol":"http","Hostname":"xxxxxxx","Port":"10001","PathToIndex":"/zm/index.php","PathToZMS":"/zm/cgi-bin/nph-zms","PathToApi":"/zm/api","Name":"Server","State_Id":null,"Status":"Running","CpuLoad":null,"TotalMem":"8251285504","FreeMem":"2184126464","TotalSwap":"8476684288","FreeSwap":"8476684288","zmstats":true,"zmaudit":true,"zmtrigger":true}},{"Server":{"Id":"3","Protocol":"http","Hostname":"xxxxxxx","Port":"10002","PathToIndex":"/zm/index.php","PathToZMS":"/zm/cgi-bin/nph-zms","PathToApi":"/zm/api","Name":"srv01","State_Id":null,"Status":"Running","CpuLoad":"0.1","TotalMem":"1008730112","FreeMem":"70406144","TotalSwap":"2017456128","FreeSwap":"2005385216","zmstats":true,"zmaudit":true,"zmtrigger":false}}]}
so...in the web this not have a problem and i can see the streaming from the xxxxx:10001 and the xxxxx:10002
but in the zmninja it take the info wrong...i mean it wrote: the monitor 1 is from xxxxx:10001 and the monitor 2 from xxxxx:10001 , but the real ,like in the web, is the monitor 1 from xxxxx:10001 and the monitor 2 from xxxxx:10002
so i not understand where the app take this information...when you have a mode multi-server...or where i can change this option in the app...

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Sat Mar 30, 2019 4:18 pm

Ah ok, I think I understand. What you are saying is it is picking up the host correctly, but not the port.
Hmm that is correct. May be a bug, because whatever I've tested with port is not used.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Sat Mar 30, 2019 5:12 pm

Okay, I think I may have a fix. I want you to try a desktop port first. Which OS can you use?
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

nevermind19
Posts: 13
Joined: Fri Oct 16, 2015 11:25 pm

Re: Zmninja connect with zoneminder multi-server

Post by nevermind19 » Sat Mar 30, 2019 7:15 pm

I tried with a android smartphone ,but it's the same with Ubuntu cause i had the same problem

nevermind19
Posts: 13
Joined: Fri Oct 16, 2015 11:25 pm

Re: Zmninja connect with zoneminder multi-server

Post by nevermind19 » Sat Mar 30, 2019 7:20 pm

asker wrote:
Sat Mar 30, 2019 4:18 pm
Ah ok, I think I understand. What you are saying is it is picking up the host correctly, but not the port.
Hmm that is correct. May be a bug, because whatever I've tested with port is not used.
exact

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Sat Mar 30, 2019 8:02 pm

please give this linux version a try
https://drive.google.com/file/d/1d4z0a2 ... sp=sharing
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

nevermind19
Posts: 13
Joined: Fri Oct 16, 2015 11:25 pm

Re: Zmninja connect with zoneminder multi-server

Post by nevermind19 » Sun Mar 31, 2019 12:24 am

Yes now works!

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Sun Mar 31, 2019 9:39 pm

Ok, I'll release an android version soon (in 1-2 days)
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

nevermind19
Posts: 13
Joined: Fri Oct 16, 2015 11:25 pm

Re: Zmninja connect with zoneminder multi-server

Post by nevermind19 » Mon Apr 01, 2019 12:09 am

Thanks!!When you think you can upgrade also the iphone version?

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Mon Apr 01, 2019 5:40 pm

unfortunately, both ports will be next week. I just messed up my ZM install and need to recover it before I can test with zmNinja
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

User avatar
asker
Posts: 1079
Joined: Sun Mar 01, 2015 12:12 pm

Re: Zmninja connect with zoneminder multi-server

Post by asker » Wed Apr 03, 2019 12:09 am

I've released both iOS and Android versions on the beta channels
Please see viewtopic.php?f=33&t=27699

Please test and let me know (.036)
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests