yi-hack-Allwinner-v2 icon indicating copy to clipboard operation
yi-hack-Allwinner-v2 copied to clipboard

ONVIF server doesn't start after reboot in 0.2.7 h60ga

Open franbugallo opened this issue 1 year ago • 67 comments

Hi, I noticed after the updated to 0.2.7 that the ONVIF server is not auto-started when the cam boots. I searched in the issues and I found some old code to manually launch the server and with this code it works, but after a reboot is again not auto started.

Please let me know if you need any log or info from my side.

Thanks!

franbugallo avatar Jun 14 '23 15:06 franbugallo

The server should work if the option is selected. immagine

roleoroleo avatar Jun 14 '23 17:06 roleoroleo

I checked and the option is selected (was already selected) and system.sh contained that line. I reverted to 0.2.6 and ONVIF is working again... maybe it's something related to my config. I guess that this can be closed

franbugallo avatar Jun 14 '23 21:06 franbugallo

~~Try to run the daemon manually from a ssh session.~~ ~~Maybe there is an error.~~

~~Check if the file /tmp/onvif_simple_server.conf exists and is not empty.~~ ~~And post it if yuo can.~~ ~~Run the command:~~ ~~onvif_simple_server --conf_file /tmp/onvif_simple_server.conf~~

roleoroleo avatar Jun 15 '23 10:06 roleoroleo

Same here with but y211ga

Here is the debug log:

root@yi-cam-salon:/tmp/sd# cat hack_debug.log
Starting system.sh
Make /etc writable
Activating swap file
Setting username and password
Setting SSH password
Configuring cloudAPI
Starting yi processes

  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  211 root         0 SW   [oom_reaper]
  212 root         0 SW<  [writeback]
  214 root         0 SW   [kcompactd0]
  215 root         0 SW<  [crypto]
  216 root         0 SW<  [bioset]
  218 root         0 SW<  [kblockd]
  259 root         0 SW   [sys_user]
  266 root         0 SW   [kworker/0:1]
  267 root         0 SW<  [cfg80211]
  273 root         0 SW<  [watchdogd]
  288 root         0 SW<  [spi0]
  298 root         0 SW   [kswapd0]
  382 root         0 SW<  [bioset]
  387 root         0 SW<  [bioset]
  392 root         0 SW<  [bioset]
  397 root         0 SW<  [bioset]
  402 root         0 SW<  [bioset]
  407 root         0 SW<  [bioset]
  412 root         0 SW<  [bioset]
  417 root         0 SW<  [bioset]
  422 root         0 SW<  [bioset]
  450 root         0 SW   [irq/302-sunxi-m]
  452 root         0 SW   [irq/166-sdc0 cd]
  453 root         0 SW   [irq/303-sunxi-m]
  454 root         0 SW   [kworker/0:2]
  458 root         0 SW   [kworker/0:3]
  525 root         0 SW<  [kworker/0:1H]
  526 root         0 SW   [kworker/0:4]
  528 root         0 SW<  [bioset]
  529 root         0 SW   [mmcqd/0]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  580 root       980 S    /usr/sbin/telnetd
  594 root         0 SW<  [phy0-atbm_wq]
  595 root         0 SW   [phy0-usb_atbm_b]
  641 root      1256 S    ./dispatch
  644 root       988 S    sh /tmp/sd/yi-hack/script/system.sh
  645 root         0 SW   [kworker/u2:2]
 1203 root         0 Z    [init]
 1256 root       980 R    ps

              total        used        free      shared  buff/cache   available
Mem:          60908        9256       46184          72        5468       50540
Swap:         65532           0       65532

Yi processes started successfully

  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  211 root         0 SW   [oom_reaper]
  212 root         0 SW<  [writeback]
  214 root         0 SW   [kcompactd0]
  215 root         0 SW<  [crypto]
  216 root         0 SW<  [bioset]
  218 root         0 SW<  [kblockd]
  259 root         0 SW   [sys_user]
  266 root         0 SW   [kworker/0:1]
  267 root         0 SW<  [cfg80211]
  273 root         0 SW<  [watchdogd]
  288 root         0 SW<  [spi0]
  298 root         0 SW   [kswapd0]
  382 root         0 SW<  [bioset]
  387 root         0 SW<  [bioset]
  392 root         0 SW<  [bioset]
  397 root         0 SW<  [bioset]
  402 root         0 SW<  [bioset]
  407 root         0 SW<  [bioset]
  412 root         0 SW<  [bioset]
  417 root         0 SW<  [bioset]
  422 root         0 SW<  [bioset]
  450 root         0 SW   [irq/302-sunxi-m]
  452 root         0 SW   [irq/166-sdc0 cd]
  453 root         0 SW   [irq/303-sunxi-m]
  454 root         0 SW   [kworker/0:2]
  458 root         0 SW   [kworker/0:3]
  525 root         0 SW<  [kworker/0:1H]
  526 root         0 SW   [kworker/0:4]
  528 root         0 SW<  [bioset]
  529 root         0 SW   [mmcqd/0]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  580 root       980 S    /usr/sbin/telnetd
  594 root         0 SW<  [phy0-atbm_wq]
  595 root         0 SW   [phy0-usb_atbm_b]
  641 root      1256 S    ./dispatch
  644 root       992 S    sh /tmp/sd/yi-hack/script/system.sh
  645 root         0 SW   [kworker/u2:2]
 1287 root     51184 S    ./rmm
 1355 root      1488 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1379 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1573 root         0 Z    [init]
 1600 root         0 Z    [rm]
 1641 root       952 S    ./cloud
 1642 root       980 R    ps
 1644 root       980 S    sh -c /home/app/cloudAPI -c 136 -url https://api.eu.
 1645 root       980 S    {cloudAPI} /bin/sh /home/app/cloudAPI -c 136 -url ht

              total        used        free      shared  buff/cache   available
Mem:          60908       37476        2280         296       21152       22112
Swap:         65532           0       65532

Starting http
Starting ftp
Starting sshd
Starting ntp
Starting mqtt services
Starting rtsp
Starting onvif
Starting crontab
Starting custom startup.sh
system.sh completed

  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  211 root         0 SW   [oom_reaper]
  212 root         0 SW<  [writeback]
  214 root         0 SW   [kcompactd0]
  215 root         0 SW<  [crypto]
  216 root         0 SW<  [bioset]
  218 root         0 SW<  [kblockd]
  259 root         0 SW   [sys_user]
  266 root         0 SW   [kworker/0:1]
  267 root         0 SW<  [cfg80211]
  273 root         0 SW<  [watchdogd]
  288 root         0 SW<  [spi0]
  298 root         0 SW   [kswapd0]
  382 root         0 SW<  [bioset]
  387 root         0 SW<  [bioset]
  392 root         0 SW<  [bioset]
  397 root         0 SW<  [bioset]
  402 root         0 SW<  [bioset]
  407 root         0 SW<  [bioset]
  412 root         0 SW<  [bioset]
  417 root         0 SW<  [bioset]
  422 root         0 SW<  [bioset]
  450 root         0 SW   [irq/302-sunxi-m]
  452 root         0 SW   [irq/166-sdc0 cd]
  453 root         0 SW   [irq/303-sunxi-m]
  454 root         0 SW   [kworker/0:2]
  458 root         0 SW   [kworker/0:3]
  525 root         0 SW<  [kworker/0:1H]
  526 root         0 SW   [kworker/0:4]
  528 root         0 SW<  [bioset]
  529 root         0 SW   [mmcqd/0]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  580 root       980 S    /usr/sbin/telnetd
  594 root         0 SW<  [phy0-atbm_wq]
  595 root         0 SW   [phy0-usb_atbm_b]
  641 root      1256 S    ./dispatch
  644 root       996 S    sh /tmp/sd/yi-hack/script/system.sh
  645 root         0 SW   [kworker/u2:2]
 1287 root     51184 S    ./rmm
 1355 root      1488 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1379 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1641 root      1216 S    ./cloud
 1674 root       964 S    {httpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 1685 root       844 S    pure-ftpd (SERVER)
 1695 root       892 S    /tmp/sd/yi-hack/bin/dropbearmulti /tmp/sd/yi-hack/sb
 1701 root       880 S    mqttv4
 1886 root       964 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1916 root       996 S    {wd_rtsp.sh} /bin/sh /tmp/sd/yi-hack/script/wd_rtsp.
 1959 root       680 S    wsd_simple_server --pid_file /var/run/wsd_simple_ser
 2009 root       964 S    {crond} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 2284 root      4060 S<   rRTSPServer -m y211ga -r high -a no -p 554 -u yi-cam
 2298 root       980 S    sleep 10
 2343 root         0 Z    [init]
 2353 root       980 R    ps

              total        used        free      shared  buff/cache   available
Mem:          60908       38780        1196        1032       20932       20072
Swap:         65532           0       65532

jvbp avatar Jun 17 '23 08:06 jvbp

Sorry, my mistake. Onvif server is not a daemon, the new version is a cgi. So it's not started during the boot process.

EDIT

Check if there is the log file: /var/log/onvif_simple_server.log

roleoroleo avatar Jun 17 '23 14:06 roleoroleo

I think i found the problem: I tried to start "onvif_srvd --conf_file /tmp/onvif_simple_server.conf" manually and it told me "Address in use" Seems like the port in the config is wrong (8080) Changed it to 80 and started onvif_srvd again. Now it seems to work

(btw. log was empty)

108085 avatar Jun 21 '23 10:06 108085

With the new version onvif_srvd is deprecated and not used. The new binary is onvif_simple_server and it's not a daemon but a cgi. So it shares the port 80 with httpd.

roleoroleo avatar Jun 21 '23 13:06 roleoroleo

@roleoroleo Is it known when the new binaries will be released with the fixed ONVIF?

bbilas avatar Jun 27 '23 13:06 bbilas

Sorry for the problem. I'm not able to release a new version this week. Please use this archive and overwrite the files in /tmp/sd/yi-hack onvif.tar.gz

roleoroleo avatar Jun 27 '23 17:06 roleoroleo

Tried the archive today and didn't work for me (tested with Home-Assistant onvif integration)

108085 avatar Jul 05 '23 08:07 108085

I'm using it with ha and onvif integration and it works properly for me. Home Assistant 2023.5.4 h52ga with 0.2.7

roleoroleo avatar Jul 05 '23 12:07 roleoroleo

got a y21ga. Home Assistant 2023.6.3 Will try again later, but neither autodetect nor manual worked

edit: will also try my r30gb

108085 avatar Jul 05 '23 12:07 108085

Autodetect doesn't work for me. But it doesn't work with other onvif cams either.

roleoroleo avatar Jul 05 '23 12:07 roleoroleo

Same problem with me for r35gb on 0.2.7, the onvif home assistant integration cannot connect. Works fine with 0.2.6 firmware version.

antonio-mazzeo avatar Jul 07 '23 09:07 antonio-mazzeo

https://github.com/roleoroleo/yi-hack-Allwinner-v2/issues/647#issuecomment-1609971532

roleoroleo avatar Jul 07 '23 14:07 roleoroleo

Sorry for the problem. I'm not able to release a new version this week. Please use this archive and overwrite the files in /tmp/sd/yi-hack onvif.tar.gz

Any chance that you can explain how to upload those files ?? I try with ssh or ftp but always get permission error

rt400 avatar Jul 13 '23 11:07 rt400

Some problem here with h60ga and >0.2.6 either. ONVIF discover not found in many apps but manually settings solve most of then. My 3YO DVR tells-me that there are some wrong connection parameter, the ONVIF app for windows too. My last try was using 0.2.9 plus onvif.tar attached at this conversation. Rolling back to 0.2.6 again

dCypherNx avatar Jul 25 '23 19:07 dCypherNx

Please, check again. 0.2.9 must work. Tested with:

  • HA
  • Onvif Device Manager
  • Onvif Device Test Tool
  • Synology Surveillance Station

Both: web service discovery and onvif server.

roleoroleo avatar Jul 26 '23 10:07 roleoroleo

@roleoroleo it works well for me!

bbilas avatar Jul 26 '23 10:07 bbilas

Yesterday I tried both an upgrade from 0.2.6 to 0.2.9 and a clean install, that way I couldn't even connect from HA. After applying the patch I was able to connect through HA, but the hikvision DS-7108HGHI-K1 DVR could not connect to the IPC. I will repeat the tests later and report here the result. I think that hikvision ONVIF implementation is a bit messy, but as I have analog cameras I have to deal with it.

dCypherNx avatar Jul 26 '23 10:07 dCypherNx

Please, test the cam with ODM. If the cam works and you are able to send me some network capture, I can try to improve the compatibility with Hikvision DVR.

roleoroleo avatar Jul 26 '23 10:07 roleoroleo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 28 '23 06:10 stale[bot]

any new about to fix ONVIF with Hikvision NVR ?

rt400 avatar Oct 29 '23 11:10 rt400

I tested version 0.3.0, unfortunately I got the same behavior as before. I can access the stream through ODM and HA, but not on Hikvision DVR. I have another IPC (GK-200MP2B ), running sonoff-hack 0.1.5, as it opens distinct ports for HTTPD and ONVIF, there is no problem working with Hikvision DVR

dCypherNx avatar Oct 30 '23 15:10 dCypherNx

The port is not a problem. I completed today a new version of the onvif processes. Do you want to try them?

roleoroleo avatar Nov 03 '23 18:11 roleoroleo

The port is not a problem. I completed today a new version of the onvif processes. Do you want to try them?

If you explain to me how to do this, I will be happy to check it for you...

rt400 avatar Nov 04 '23 16:11 rt400

The port is not a problem. I completed today a new version of the onvif processes. Do you want to try them?

i did it like in your Wiki and still onvif didn't work

rt400 avatar Nov 06 '23 15:11 rt400

I will send a complete image to load into the cam.

roleoroleo avatar Nov 08 '23 15:11 roleoroleo

I will send a complete image to load into the cam.

My firmware camera is r35gb. Thanks

rt400 avatar Nov 08 '23 17:11 rt400

Here it is: r35gb_0.3.0.tar.gz

roleoroleo avatar Nov 09 '23 08:11 roleoroleo