agent86ix / wyze-cam-pan-sd-flash-fix

MIT License
10 stars 1 forks source link

Wyze Pan Cam performs HTTP GET but doesn't update firmware #1

Open riorescue opened 3 years ago

riorescue commented 3 years ago

Wyze Pan Cam with firmware version 4.10.6.156 will not complete boot loader update. It appears the Wyze Pan Cam will perform the HTTP GET request but doesn't successfully process the update. No LED indicators once the camera performs the GET request for the firmware file. Additionally, no log files are stored on the SD card indicating if a failure occurred. I also noticed that others on the Wyze forum have indicated similar/same results when running fw 4.10.6.156.

Seems likely the flash_bootloader.sh shell script never executes.

agent86ix commented 3 years ago

The sequence that I observed from the serial console was:

  1. WyzeUpdater pushes an update request to the camera
  2. Camera downloads the update file from WyzeUpdater
  3. Camera checks the hash of the update against the hash in the update request
  4. Camera unpacks the update file to /tmp/
  5. Camera checks for /tmp/Upgrade/PARA
  6. Camera runs /tmp/Upgrade/upgraderun.sh

The log file is created once /tmp/Upgrade/upgraderun.sh starts. It is set up to bail out of any of the subcommands fail. Regardless, once upgraderun.sh starts, when it finishes (on success or failure) the camera itself will trigger a reboot.

Since you're not getting a reboot, it sounds like there's an issue before upgraderun.sh starts. Unfortunately, the only debug for that stage of the process is via serial console - which is painful and warranty-voiding to do...

You might try sending down a very simple .tar file with just PARA and upgraderun.sh in it - just echo something to the console or cause a reboot. I don't have high hopes that it will work given what you've told me so far, but it's worth a shot. If it isn't working even with a trivial script, you might want to open an issue against WyzeUpdater - something in a recent firmware upgrade might have changed the update workflow.

riorescue commented 3 years ago

I've debugged this a bit with console. It appears they have modified the mount point from /media/mmcblk0p1 to /media/mmc. After modifying upgradrun.sh and flash_bootloader.sh to reflect /media/mmc I was able to successfully flash the bootloader. After the bootloader was flashed I was then able to apply the Wyze RTSP firmware using the standard demo.bin (push button at boot method).

agent86ix commented 3 years ago

Hmm, okay. There's a chance I can edit the script to allow for either path. I could also have a variant that does no backup (ie, just in case it changes again). I could also try to guess/check the place where the SD card is mounted. I'll give it some thought.

At any rate, glad you were able to solve your issue!

free5ty1e commented 3 years ago

Thank you @riorescue ! I had this exact issue with 1 of my 2 new "F00" Pan cams, as I had tried an OTA firmware update to alleviate my issues manually installing the RTSP firmware.

I have 2 "D00" Pan cams from a while back that have been running the RTSP firmware for a while now and I wanted to expand my camera coverage and.... whew it's been a journey, thank you for the final piece to the puzzle!

For some reason, your fix still wasn't automatically running for me with the wyze_updater.py command. After I tried that, I used https://github.com/HclX/WyzeHacks to telnet in and manually start the upgraderun.sh script as it had indeed all pushed and extracted to the /tmp/Upgrade folder already.

Running RTSP firmware on all 4 Pan cams now! Many thanks!

agent86ix commented 3 years ago

I published a second release to attempt to solve this issue. However, I can't test it (all my cameras are now running non-stock firmware). If anyone has a camera with this issue that they wouldn't mind testing, I'm sure many users would be grateful!

outkastn8 commented 3 years ago

@agent86ix Hi! So I have gone down the rabbit hole of trying to install RTSP firmware and failing, which has led me to find I have 2 F00 Wyze pan cams that wont accept firmware via flashing from the SD card. So this led me to try to use the Wyze Updater and try to install your 0.2.0 alpha upgrade. but I am getting an error when running the command below.. Any help would be appreciated and I would be happy to test your new code. Thanks

C:\temp\python.exe C:\temp\WyzeUpdater-master\wyze_updater.py update -d 2CAA8E992960 -f C:\temp\fix-pan.tar

The error is in the screenshot below. Wyze Pan Cam Current Firmware 4.10.6.218 Wyze Beta app v2.15.23 on Android S20 Running commands from Python 3.9 on Windows 10 20h2 build 19042.572

(I think it has something to with the port being used by another program, not very well versed in python.)

Error

riorescue commented 3 years ago

@outkastn8

The stack trace indicates an issue binding to TCP/80 (http) which is expected if you don't run the command-line process elevated. Try specifying the port 8081 (or something unsused above 1024:

wyze_updater.py update -d 2CAA8E992960 -p 8081 -f C:\temp\fix-pan.tar

outkastn8 commented 3 years ago

Thank you that worked.

I did have the cmd prompt window running as administrator and then tried elevating the command with the following code below, but it still didnt work until I used port 8081 instead. Thank you for that. It just rebooted and loaded the 0.2.0 alpha and I was then able to flash the demo with RTSP on without issue! thanks guys!

runas /profile /env /user:wc-nking\administrator "C:\temp\python.exe C:\temp\WyzeUpdater-master\wyze_updater.py update -d 2CAA8E992960 -f C:\temp\fix-pan.tar"