Can't flash firmware to Cam Pan

it seems that you are using Python 2.x, WyzeUpdater needs Python 3.x instead

Hmm. I installed 3.8 for windows and I see that is what’s installed however if I just type python in cmd window it shows 2.7. I’ll try a reinstall and see if that gets it up to the correct version.

On windows try running:
python3.exe

you can just use the full path to the python.exe you want to run, Common places to have it installed are:
C:\Python27\python.exe
C:\Python38\python.exe
C:\Users\<your-user>\AppData\Local\Microsoft\WindowsApps\python.exe
and many more, depending on which installer you used.

If in doubt, you can typically find which version it is by running:
path-to\python.exe --version

Also, in a recent version of Windows, you should be able to run this in a command-line:
where python
and get the path of the python.exe instance that will run if you just invoke it with python

If you feel curious and want to find all the different python.exe that you could possibly have in your drive, running this in a command-line will take a while to scan the entire drive but will give you all those paths:
dir /s /b \python.exe

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 (re-tar as specified). 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).

Note: This is my experience–YMMV!

Tried this but unfortunately did not work, unpacked the tar file and modified the entries as suggested, repacked the file and tried the upload. Got as far as trying to serve up the new firmware and then just sat there drawing dots as before. Learning more about Python every day :slight_smile:

Did you see the camera making the HTTP GET request to your machine running wyzeupdater? You must at minimum see the GET request; otherwise, the update package (tar file) is not even being processed on the Wyze cam.

For example, if you are running wyzeupdater on Windows and the Windows Firewall service is running (blocking the port you specified in the wyzeupdater command) the camera will not be able to access the webserver that’s started by wyzeupdater. This also applies even on linux if you are running a host-based firewall. If you have a more complex network with vlans and firewalls be sure the hardware firewall is not blocking the HTTP GET request from the camera. There are other wifi-security scenarios that you need to check for. For example, if your wifi router or access-point prevents communication to other devices on your network (i.e. wifi isolation) then the camera will not be able to reach the webserver started by wyzeupdater. You really need to see the HTTP GET almost immediately after running the wyzeupdater update command.

I’m getting the following errors trying to run the wyzeupdater, any ideas?

This is directly after it asks me to enter my username and password:

C:\WINDOWS\system32>C:\Python38\python.exe C:\Users\username\Downloads\WyzeUpdater-master\wyze_updater.py list
INFO:root:No saved credentials found, logging in with username/password…
Please enter the account name:username (using my actual username here)
Please enter the password:password (using my actual password here)
Traceback (most recent call last):
File “C:\Users\username\Downloads\WyzeUpdater-master\wyze_updater.py”, line 325, in
creds = wyze_login(args.user, args.password)
File “C:\Users\username\Downloads\WyzeUpdater-master\wyze_updater.py”, line 59, in wyze_login
if not rsp[‘access_token’]:
KeyError: ‘access_token’

I was unable to successfully run the fix-pan since I’m on FW 4.10.6.156, however I was able to authenticate and didn’t receive the errors you got. Few thoughts:

  • If you have 2FA enabled, this might be the cause?
  • Is requests installed?
    python.exe -m pip list
  • You are running it from system32, maybe try directly from the WyzeUpdater-master folder. It was mentioned above that this makes a difference when using https.

Thanks for the suggestion, I tried again but am still getting the same error. I’ve tried playing with the script itself but that makes it worse so I downloaded the script fresh again and am still getting the same error:

C:\Users\username\Downloads\WyzeUpdater-master>C:\Python38\python.exe wyze_updater.py list
INFO:root:No saved credentials found, logging in with username/password…
Please enter the account name:username
Please enter the password:password
Traceback (most recent call last):
File “wyze_updater.py”, line 325, in
creds = wyze_login(args.user, args.password)
File “wyze_updater.py”, line 59, in wyze_login
if not rsp[‘access_token’]:
KeyError: ‘access_token’

I’m stumped. The error output looks like there might be a read / write issue on the file? I’m running CMD as an administrator I’m not sure what else could be wrong…

I was able to recreate your issue by using an incorrect Username/Password:

C:\Temp\WyzeUpdater-master>python.exe “C:\Temp\WyzeUpdater-master\wyze_updater.py” list
INFO:root:No saved credentials found, logging in with username/password…
Please enter the account name:fake@fake.com
Please enter the password:incorrectpassword
Traceback (most recent call last):
File “C:\Temp\WyzeUpdater-master\wyze_updater.py”, line 325, in
creds = wyze_login(args.user, args.password)
File “C:\Temp\WyzeUpdater-master\wyze_updater.py”, line 59, in wyze_login
if not rsp[‘access_token’]:
KeyError: ‘access_token’

It is possible that your Wyze password contains a character which the script doesn’t like. You might want to try changing your Wyze password to something simple. I verified that % and & work, so you can use them as a special character if needed.

Edit: You will also want to delete the WyzeUpdater-master\.tokens file if you change your password, otherwise it will retain your previous entry.

Omgosh… what a dummy. Thanks so much @jmach314 I had to double check and I had a capital on my password that didn’t need to be there.

Unfortunately it looks like my pan already updated to 4.10.6.156 so I may be out of luck to sideload the firmware until they update the firmware with a flash fix :frowning: oh well, small victories! Thanks again!

You’re welcome, I’m glad I was able to help. Hopefully someone finds a method to get this to work if FW 4.10.6.156 or greater is installed.

Check comment by riorescue above, he found a modification to the payload that appears to make it successful even with the latest FW

1 Like

Thanks @sa-pr and @riorescue, somehow I missed that. I was able to apply the fix on my Cam Pan with FW 4.10.6.156. Below are the modified 4.10.6.156 steps I used if it helps anyone else:

  1. Opened fix-pan.tar using 7Zip
  2. Navigated to fix-pan.tar\Upgrade\
  3. Modified upgradrun.sh and flash_bootloader.sh with the new mountpoint: from /media/mmcblk0p1 to /media/mmc
  4. Saved directly into the archive
  5. Ran: python wyze_updater.py update -p 18080 -d <MyMAC> -f "<FirmWarePath>\fix-pan.tar"
  6. My camera never rebooted, however the fix was applied. I waited 5 minutes after getting the below message:
    192.168.2.184 - - [16/Sep/2020 11:07:24] "GET /firmware.bin HTTP/1.1" 200 - Press Ctrl+C when all the updates are done...
  7. After waiting 5 minutes, I checked the SD Card and confirmed in the wyze-cam-pan-fix.log that the bootloader was replaced

I’m now able to manually update the FW using the demo.bin and the push button method.

Hi @jmach314, did you ctrl+c to end the upgrade or did you just take the SD card out? I’ve tried running the command a few times (I get the same message you do that the update is running), but I’m not seeing a log file in the root directory.

Hi @im.mjb83, I modified my previous steps, main changes are in step 1 and step 8. My best guess would be the router or firewall is blocking port 18080.

  1. Added a port 18080 forward rule to my routers and turned off Windows Firewall temporally
  2. Opened fix-pan.tar using 7Zip
  3. Navigated to fix-pan.tar\Upgrade\
  4. Modified upgradrun.sh and flash_bootloader.sh with the new mountpoint: from /media/mmcblk0p1 to /media/mmc
  5. Saved directly into the archive
  6. Ran: python wyze_updater.py update -p 18080 -d <MyMAC> -f "<FirmWarePath>\fix-pan.tar"
  7. My camera never rebooted, however the fix was applied. I waited 5 minutes after getting the below message:
    192.168.2.184 - - [16/Sep/2020 11:07:24] "GET /firmware.bin HTTP/1.1" 200 - Press Ctrl+C when all the updates are done...
  8. After waiting 5 minutes, I ctrl+c to end the upgrade. I unplugged the camera and removed the SD card. I checked the root of the SD Card and confirmed in the wyze-cam-pan-fix.log that the bootloader was replaced.

Hmm. I just cannot get this to go. I tried opening up port to the IP of the camera, and then the computer acting as server, and then both at the same time and I get all the other steps done but I’m not getting a log file after 5 minutes and a ctrl + c. Windows firewall is disabled, I get no type of error message or any feedback anything is incorrect.

Hi Riorescue, any thoughts of what else to do if I am seeing the ‘GET /firmware.bin HTTP/1.1’ 200 -’ message? @jmach314 modified his command line to use port 18080 which I’ve done as well but I’ll let the updater run for 5, 10, even 20 minutes and it just keeps spinning those dots in the dos prompt and when I unplug the camera and remove the SD card, no log file.

@im.mjb83 I’ve heard of various problems with SD cards if not using a brand size that’s commonly used with these cameras. Is your SD card 32GB and formatted FAT32? If you are comfortable with shell scripts you can extract the .tar and use a simple echo command to the SD card without running the boot loader update. A simple shell script would help you identify where the failure is occurring.