guino / LSCOutdoor1080P

Root customization of the LSC Outdoor 1080P camera and LSC Rotating 1080P cameras
20 stars 5 forks source link

offline mode not working with PTZ cam #17

Open JDkiwi opened 2 weeks ago

JDkiwi commented 2 weeks ago

i bought this camera and it was on firmware version 2.10.79. at first i was disappointed since it did not expose a rtsp stream by default. i tried to figure out if i can enable it somehow and disassembled it. i dumped the spi flash but this was a dead end for me. after hooking up a serial cable i found out that it scans for a few files on startup. i searched for these files and this way i stumbled across this repo. thank you for your great work! i followed the instructions with option 3 and now i successfully get a rtsp stream and the app says i'm on firmware 2.10.36. but if i uncomment the offline.sh line in the custom.sh file, it still connects to the tuya servers after some time and i can see the video feed in the app. is there a way to disable this entirely? i want to use this cam without any cloud.

guino commented 1 week ago

@JDkiwi I'm glad you got RTSP working.

For the offline script, make sure the line in custom.sh is

[[ ! `pgrep -f offline.sh` ]] && /tmp/sd/offline.sh &

Then boot the device, wait a few minutes for it to sync time with servers, then check if it created a file 'offline.log' in the SD card, if so, can you post the contents of the file for review ?

One misconception is that the phone app stops working when the device is not connected to the tuya server -- I'm pretty sure the tuya app tries to use the local network whenever possible, so the way to 'test' it is to disconnect your phone from the wifi and use cell phone internet to try and access the camera, it should fail because the device is not connected to the tuya server.

It is not 'impossible' to make it not connect to the tuya servers 'at all' but it does require some special setup that is complex for most people:

  1. I would have to create another patch to allow the device to boot completely without syncing the time with the tuya server
  2. You would have to block the internet traffic on your router OR by using the hosts file provided when the device boots
  3. You would have to add a command/script to allow the device to sync time with any NTP server reachable from the device (internet or local network)

That's why I recommend the offline script first since it should only connect to the tuya server momentarily when booting up.