cjj25 / RTS3903N-Tuya-RTSPServer

RTSP and Telnet access for Tuya RTS3903N cameras
32 stars 5 forks source link

Firmware Backup #1

Open ifunboy opened 2 years ago

ifunboy commented 2 years ago

Tuya SC-WA002 Firmware Backup REMOVED (sensitive information contained) backup.zip

ifunboy commented 2 years ago

Another Tuya SC-WA002 original firmware.

cjj25 commented 2 years ago

Thank you for the contribution :)

ifunboy commented 2 years ago

This camera firmware can run the ty_sdcard_upgrade.sh in sdcard but this firmware https://github.com/cjj25/Yi-RTS3903N-RTSPServer/issues/24#issue-1238885990 can't run.

cjj25 commented 2 years ago

Could you try booting the camera normally, then inserting the SD card and waiting 1 minute. Does the RTSP server work correctly then?

cjj25 commented 2 years ago

Notes for us: Problem FW version: 2.4.5#20190603-14:57:16 squashfs-root-1/skyeye/conf/version Working FW: 2.1.0#20181212-22:35:13

cjj25 commented 2 years ago

Temp branch created: https://github.com/cjj25/RTS3903N-Tuya-RTSPServer/tree/fix-2.4.5

Take note of tuya/upg/ty_sdcard_upgrade.sh bypass fix for telnet - https://github.com/cjj25/RTS3903N-Tuya-RTSPServer/compare/master...fix-2.4.5

Let me know how you get on? In the meantime, I'll flash this FW to my dev device to see what happens.

ifunboy commented 2 years ago

RTSP server didon't work,I am going to connect the uart in this camera. :)

ifunboy commented 2 years ago

I'm having some trouble, the uart doesn't output anything

cjj25 commented 2 years ago

I've flashed your original FW to my dev cam and I'm getting output on UART, a common trick is for it to be disabled in uboot.

Are you trying it on the original FW you posted, or this new version?

PS: I see what's responsible for rebooting on the newer FW version.. I'll disassemble shortly

[2015-10-24 10:24:51.202 tid(560) tycam_devcom_inf.c tycam_devcom_key_down(81) Debug] reboot system

Edit: Looks like my dev cam has a different gpio layout to yours.. so it's triggering the reboot. I'll probably just hook the reboot to stop it.

ifunboy commented 2 years ago

the new camera with FW: 2.1.0 output nothing from the uart.

cjj25 commented 2 years ago

So you've taken the new cameras FW and tried to flash it on your dev camera and its got no UART?

If so, then it's probably the disabled in uBoot, you could try flashing mtdblock1 from the firmware that has working UART firmware.

ifunboy commented 2 years ago

I had to start the telnet by UART and run ty_sdcard_upgrade.sh this is the log.

REMOVED (sensitive information contained)

maybe a little help.

cjj25 commented 2 years ago

It looks like the RTSP starts [01-01 08:00:09 TUYA Info][utils.c:182] port: 8554

Is the camera just then rebooting? It must be the watchdog.

ifunboy commented 2 years ago

I also found an another problem.If you are not logged in to the Tuya app.When tycam first start it will kill the wpa_supplicant and udhcpc then wait for the QR code to connect the wifi.But the tycam_patched can't connect the wifi by QR code.It's better to connect the wifi by wpa_supplicant.conf from TF card like Yi-RTS3903N-RTSPServer. It's too late, I'm going to bed, thank you for your work. :)

cjj25 commented 2 years ago

You're welcome, just to confirm - it's the FW you posted on the RTS3903N-RTSPServer (fw 2.4.5) that you've had all these problems?

The only limitation with the RTSPServer repo is no audio. I might push a fix for that sometime.

ElvisLiu2018 commented 2 years ago

How things are going, buddy! I'm sitting down here and waiting for the patch. ^v^

cjj25 commented 2 years ago

@ElvisLiu2018 - I'll try put some time into it again shortly.

What camera do you have?

ElvisLiu2018 commented 2 years ago

Thanks a lot! It is SC-WA002, the same model as Ifunboy.

cjj25 commented 2 years ago

@ElvisLiu2018, no problem.

What happens when you use the payload currently from this repo?

Did it create a "backup" folder on your SD card? If so, do you know what version of firmware is running on your device?

I'm trying to figure out if your issue is directly linked to the same problem @ifunboy experienced

ElvisLiu2018 commented 2 years ago

yes, the backup was able to be generated by the script on the SD card correctly. But I really don't know where to see the version of my firmware. I didn't connect the TTL. I was able to get into the telnet with the help of @ifunboy and able to see the video through your RTSP server. But the screen was keep jamming after the first picture comes out. I captured a 5-minutes log after executing your tycam-2.1-l. In the meantime, I kept pinging the camera and it was online all the time during the test. Hope this log could help you understand my issue better. tycam.Log Thanks in advance.

ifunboy commented 2 years ago

Hi!I made some progress.I modified the script so the the camera can connect to the network (just like the Yi-RTS3903N-RTSPServer).And I try to start the tycam_patched program.Only the Tycam low res program in FW: 2.1.0 can work.Tycam high res program can't start the RTSP server in any FW.And the Tycam low res program can't work because of the program kill the wifi. (log in FW2.1.0 ) sh: iwconfig: not found Tycam low res program in FW: 2.1.0 can start the RTSPServer,but the FPS is only 1.According to the log file the program call the QR code module and the QR code consumes a lot of CPU. Thanks a lot!

the script tuya-wifi-test.zip the log tuya.log the screenshot 2

cjj25 commented 2 years ago

Great work @ifunboy.

Could you backup this firmware and then pair it, taking another backup so we can isolate blob used to identify the pairing state?

cjj25 commented 2 years ago

@ElvisLiu2018 Can you confirm if your camera is paired (gone through the QR scanning process) also, would it be possible for you to upload the backup of the firmware? I'll delete it from here once received

ElvisLiu2018 commented 2 years ago

Sorry for the late reply. I confirm my camera is paired and I was able to find the device in my route and ping it. Please find the firmware which I copied from the backup folder of the sd card. firmware....zip (REMOVED)

cjj25 commented 2 years ago

@ElvisLiu2018 - not had much time to focus on this project recently.

I'll try patch your version of the binary this weekend and upload it for you.

It's strange how both yours and @ifunboy logs show it channel hopping the WiFi.

Your FW version is located in /opt/skyeye/conf/version. I've extracted them from your FW dump below:

ElvisLiu2018 commented 2 years ago

Many thanks! It is really very weird, i have no idea why the FW was keep changing the channel. By the way, are you using the SDK:rsdk-4.8.5-5281-EL-3.10-u0.9.33-m32fut-161202 to develop the patch?

asanfang commented 2 years ago

My device is sc-wa002, version is 2.1.0#20181212。I put all the files on the TF card and turn on . Tycam is not working normally,So I joined WiFi by scanning the code through the camera App.and telnet is working .What should I do next?

/dev # ps PID USER VSZ STAT COMMAND 1 root 1288 S 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_bh] 9 root 0 SW [rcu_sched] 10 root 0 SW< [khelper] 11 root 0 SW< [writeback] 12 root 0 SW< [bioset] 13 root 0 SW< [kblockd] 14 root 0 SW [khubd] 15 root 0 SW [kworker/0:1] 16 root 0 SW< [cfg80211] 17 root 0 SW< [rpciod] 18 root 0 SW [kswapd0] 19 root 0 SW [fsnotify_mark] 20 root 0 SW< [nfsiod] 21 root 0 SW< [crypto] 30 root 0 DW [enable_swp_task] 31 root 0 SW< [dwc_otg] 32 root 0 SW< [deferwq] 33 root 0 SW [kworker/u2:1] 34 root 0 SW< [kworker/0:1H] 227 root 1284 S syslogd 229 root 1276 S klogd 248 root 0 SWN [jffs2_gcd_mtd7] 341 root 0 SW [kworker/u2:2] 369 root 0 SW [kworker/0:2] 376 root 0 SW [kworker/0:3] 450 root 0 SW [mmcqd/0] 491 root 1284 S telnetd -l /bin/sh 495 root 76964 S /opt/skyeye/bin/tycam 589 root 0 SW [RTW_CMD_THREAD] 1126 root 1284 S {watchdog.sh} /bin/sh ./watchdog.sh 1242 root 62200 S ./tycam 1758 root 1284 S wpa_supplicant -B -i wlan0 -c /etc/tuya/wpa_supplica 1833 root 1284 S udhcpc -b -i wlan0 1854 root 1284 S /bin/login 1996 root 1288 S /bin/sh 1998 root 1276 S sleep 5s 2022 root 1284 R ps /dev #