Closed alekslyse closed 5 months ago
It's a known issue. Please, send me a dump of the network traffic during the negotiation, if you are able. This is tcpdump: tcpdump.gz
As a kind of related but somewhat offtopic still reply: Blue Iris was not automatically able to detect the High Quality Stream via the “Find/Inspect” button. Normally afaik that URL should be sent via the ONVIF discovery, right? But PTZ there works just fine :)
It's a known issue. Please, send me a dump of the network traffic during the negotiation, if you are able. This is tcpdump: tcpdump.gz
Just a tcp dump from the synology to the camera or a general tcp dump whie trying to add the camera
The traffic from the synology and the camera when you try to add the onvif cam.
Here is a tcpdump 192.168.1.204 is the camera. pasword and username is set as test/test
For reference I also took a tcpdump on a onvif camera that works. 192.168.1.52 (NOT this hack, just for a reference of something thats working)
Thank you. The 1st capture is ok. The 2nd one containts only request packets, reponses are missing.
The test.pcapng.zip is the one that doesnt work (error), the second lastestov.pcncap.zip works. The test.pcapng.zip is the sonoff onvif hack
As a kind of related but somewhat offtopic still reply: Blue Iris was not automatically able to detect the High Quality Stream via the “Find/Inspect” button. Normally afaik that URL should be sent via the ONVIF discovery, right? But PTZ there works just fine :)
Onvif discovery should send only the generic onvif url, not the streams.
@alekslyse Please try this binary: onvif_srvd.gz
Progress; It now detects the capabilities, but does not get the stream url. Still .204 ip on the camera.
For reference I did two captures, attached. onviftest2.pcncap with 192.168.1.204 with clicking the button test connection producing no picture
the other file onviftestothercam.pcncap with 192.168.1.52 is a known working onvif camera with clicking the test connection producing picture.
Maybe that will clarify what response the two cameras get
In the capture file of the working cam I can't find the response packets. Could you check the capture procedure?
In the capture file of the working cam I can't find the response packets. Could you check the capture procedure?
Just a regular sudo /usr/sbin/tcpdump -w /volume1/tmp.pcncap
Its the same on both files. Any arguments I should add?
I don't know what the difference. Try to capture the traffic on the synology, if it's possible.
However I checked the traffic and it seems synology requires dynamic profile creation. This device does not support this function (CreateProfile and DeleteProfile). And I don't understand why synology should ask for this feature... In my opinion it is wrong.
its captured on the synology directly. I assume onvif will not work on the synology then?
Onvif it's not a good standard. Each manufacturer creates its own implementation. There are a lot of compatibility problems.
Another try, if you can... onvif_srvd.gz
Nothing better. Its a lot of chatter between the cam and the onvif, but when it ask for the add of profile it seems like it gives a 400 bad request back
onvif device manager on windows wont even connect to the camera so something is strange
I see another strange thing; If I reboot the camera, and after the voice; If I use onvif device manager on windows and click refresh I get into the onvif settings when the camera start to turn at bootup. After its done turning no more onvif or able to connect anymore
The versions I'm sending you are experimental. There is an alpha implementation of event management. So it's not stable. Use it only to test the synology.
One more time around the block: onvif_srvd.gz I changed the soap fault returned with CreateProfile and DeleteProfile. I added the GetGuaranteedNumberOfVideoEncoderInstances function.
If this doesn't work I don't know ho to solve the issue. Probably I need to create a fake CreateProfile function.
The versions I'm sending you are experimental. There is an alpha implementation of event management. So it's not stable. Use it only to test the synology.
One more time around the block: onvif_srvd.gz I changed the soap fault returned with CreateProfile and DeleteProfile. I added the GetGuaranteedNumberOfVideoEncoderInstances function.
That seemed to turn off the whole onvif. It could not find the cam on port 80 or load anything
I will check it.
I fixed a lot of bugs: onvif_srvd.gz
No still no connection. another dump here. with the two last releases the onvif communication is never happening.
No much exciting in the log, still with filter ip.src == 192.168.1.204 or ip.dst == 192.168.1.204 - just communication failures (its the correct ip etc - can control through web ui)
Just for a ps I do NOT think synology support onvif 1.0 or 1.1, but those should be very old. I dont know what version this one is using.
I tested it again and it works (apart from a memory leak problem). Try to run it manually with --no_fork and --no_close options.
Im not sure how you mean with running it manually? how?
Connect to the cam with ssh and run the following commands:
killall onvif_srvd
. /mnt/mmc/sonoff-hack/script/env.sh
onvif_srvd --no_fork --no_close --pid_file /var/run/onvif_srvd.pid --model "Sonoff Hack" --manufacturer Sonoff --firmware_ver 0.0.3 --hardware_id GK-200MP2B --serial_num a6300087b8 --ifs eth0 --port 80 --scope onvif://www.onvif.org/Profile/S --name Profile_0 --width 1920 --height 1080 --url rtsp://hack:hack@%s/av_stream/ch0 --snapurl http://%s:8080/cgi-bin/snapshot.sh --type H264 --name Profile_1 --width 640 --height 360 --url rtsp://hack:hack@%s/av_stream/ch1 --snapurl http://%s:8080/cgi-bin/snapshot.sh --type H264 --ptz --move_left "/mnt/mmc/sonoff-hack/bin/ptz -a left" --move_right "/mnt/mmc/sonoff-hack/bin/ptz -a right" --move_up "/mnt/mmc/sonoff-hack/bin/ptz -a up" --move_down "/mnt/mmc/sonoff-hack/bin/ptz -a down" --move_stop "/mnt/mmc/sonoff-hack/bin/ptz -a stop" --move_preset "/mnt/mmc/sonoff-hack/bin/ptz -f /mnt/mmc/sonoff-hack/etc/ptz_presets.conf -a go_preset -n %t" --set_preset "/mnt/mmc/sonoff-hack/bin/ptz -f /mnt/mmc/sonoff-hack/etc/ptz_presets.conf -a set_preset -e %n -n %t"
I just get a segment error
without --no_fork no segment error, but still no onvif
Strange behavior.
Yeah. Could it be because I set it up in the app first? The old rtsp stream still works. I tried to reinstall your hack (format sd), but still same issue.
Some progress; Your latest file does not work, it just give segmentation failure. (im using wifi). changed the start file to the wifi and serial just to be sure but still segmentation failure. If your camera works on the latest file your sent; how do you setup your camera? wifi / eth / username / password / setup via app. I even tried to reset the camera with your latest, and still it does not even start the onvif server
I has to set username and password to hack for the profiles to work at all
The second to last where you removed the profile thing it does a bit more now. It accepts the profiles, but errors in "Max number of profiles reached"
I also added the console dump with the ps -l after reset of camera and your latest file as well as wireshark dump where it say profiles reached. If we can bypass the profiles reached I think we are on the right path.
SOAP 1.2 fault SOAP-ENV:Receiver[ter:Action] "Max number of profiles reached." Detail: [no detail]
The message "Max number of profiles reached." is normal. It's the response of the cam when the client tries to create a dynamic profile (not supported). Segfault is not normal... I will check your capture file.
I have no idea what else to do. I have reset the camera, wifi and ethernet, reset your hack etc. with the last one onvif does not start at all. the previous ones it starts and the command works. Its just the last one
If you try the cam with odm, does it work?
Not with the last release as it doesn’t start auto or manually. Second to last release it works for 2-3 seconds after the swirling of the camera on boot if I keep clicking connect, then it doesn’t work anymore in odm. Synology recognises second to last too, but dont get the rtsm stream so cant go beyond the setup screen the no more profile gives a internal error
I don't understand. With the last version, does the process crash immediately or after a discovery? The capture you posted contains a long dialog between the client and the cam and it seems that the cam crashes after the CreateProfile message. I'm probably confusing the various versions.
Sorry about that. Latest version doesn’t start automatically or by cli (segmentation fault). With that installed its no service running at boot. The latest wireshark is from the second to last. Second to last start automatically and by cli tested both methods
Try this please: onvif_srvd.gz
same error. no onvif server started on camera boot, and manual give segment failure. It has to be something that got removed from now the third to last (as the third to last it booted the onvif server etc)
Try to run it with strace: strace.gz
Try to update all with the new 0.0.7
I start to wonder if its something wrong with the camera. You guys are running stock cameras or have you done any firmware hacks / opened the cameras before doing this? I assumed it was just uploading it to the camera and boot it (even tried to reset it, plus using ethernet)
Even with .7 onvif wont start at boot. Here is the ps list right after boot
strace on the onvif command, plus pictures of the camera info
And here is trace with no fork
@alekslyse Try this. onvif_srvd.gz
I removed the threads related to event management. If doesn't work, please try again with strace using -f option.
Now the onvif starts again, and synology go through its init tests (check capabilities etc), but does not get the rtsp stream and errors out in the profile max. Attached is pcap.
P.S Ip changed so filter in wireshark now is ip.src == 192.168.1.209 or ip.dst == 192.168.1.209
Also did a trace from terminal
Have anyone made this work with synology surveillance station onvif. Onvif works on my phone apps so it’s working, but synology say can’t read capabilities. Any suggestions?
Rtsp works in synology, but would need ptz