samtap / fang-hacks

Collection of modifications for the XiaoFang WiFi Camera
1.67k stars 340 forks source link

Unable to start RTSP server #142

Closed snjoetw closed 7 years ago

snjoetw commented 7 years ago

I just received my xiaofang today and tried the hack. But I was unable to get RTSP working. I'm able to access the status page, applied the hack and reboot.

In the "Manage scripts" page, "02-rtsp-server" does not have a status and clicking run does nothing. "03-rtsp-server" has NOK status and clicking "start" does not work either.

I then telnet into the device, enabled logging and this is what I see:

/media/mmcblk0p2/data/etc/scripts # cat /tmp/rtsp_server.log 
Video source = /dev/video1 
Cannot open '/dev/video0': 16, Device or resource busy

I'm not sure which other process is using /dev/video*

Can someone please help me with this?

fwiw, this is my process list:

  PID USER       VSZ STAT COMMAND
    1 root      1164 S    init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [events/0]
    5 root         0 SW   [khelper]
    8 root         0 SW   [async/mgr]
  209 root         0 SW   [sync_supers]
  211 root         0 SW   [bdi-default]
  213 root         0 SW   [kblockd/0]
  223 root         0 SW   [khubd]
  226 root         0 SW   [kseriod]
  231 root         0 SW   [kmmcd]
  241 root         0 SW   [cfg80211]
  262 root         0 SW   [rpciod/0]
  269 root         0 SW   [khungtaskd]
  270 root         0 SW   [kswapd0]
  316 root         0 SW   [aio/0]
  323 root         0 SW   [nfsiod]
  332 root         0 SW   [crypto/0]
  399 root         0 SW   [mtdblock0]
  404 root         0 SW   [mtdblock1]
  409 root         0 SW   [mtdblock2]
  414 root         0 SW   [mtdblock3]
  419 root         0 SW   [mtdblock4]
  424 root         0 SW   [mtdblock5]
  429 root         0 SW   [snx-spi.0]
  438 root         0 SW   [zd1211rw]
  485 root         0 SW   [usbhid_resumer]
  518 root         0 SWN  [jffs2_gcd_mtd4]
  570 root         0 SW   [isp]
  611 root      1160 S    /sbin/getty -L ttyS0 115200 vt100
  612 root      1152 S    /sbin/syslogd -n -m 0
  613 root      1148 S    /sbin/klogd -n
  619 root     11064 S    /etc/app/iCamera
  628 root     67224 S    /etc/app/iCamera
  716 root         0 SW   [RTW_CMD_THREAD]
  747 root      1092 S    wpa_supplicant -Dwext -iwlan0 -c/tmp/wpa_supplicant.
  774 root      1164 S    udhcpc -i wlan0 -p /var/run/udhcpc.pid -b
  803 root       780 S    /usr/boa/boa
  822 root      1172 S    {miio_client_hel} /bin/sh /etc/miio_client/miio_clie
 3860 root         0 SW   [mmcqd]
 3927 root         0 SW   [flush-179:0]
 3943 root      1160 S    telnetd
 4146 root      1348 S    telnetd -p 2323 -l fang_login
 4228 root      1168 S    -sh
 4370 root      1348 S    tcpsvd -E 0.0.0.0 21 ftpd -w /media/mmcblk0p2/data
 4376 root      1152 S    {fang-ir-control} /bin/sh /media/mmcblk0p2/data/usr/
 6491 root         0 SW   [flush-mtd-unmap]
 7177 root      1144 S    sleep 1
 7179 root      1344 S    sleep 3
 7180 root      1160 S    {status} /bin/sh /tmp/www/cgi-bin/status
 7186 root      1160 S    {status} /bin/sh /tmp/www/cgi-bin/status
 7187 root      1144 S    cat
 7195 root      1152 R    ps
snjoetw commented 7 years ago

Just found the issue, it was due to iCamera that's using the /dev/video*

This is mentioned in https://github.com/samtap/fang-hacks/wiki/F.A.Q#the-rtsp-server-doesnt-start