Hi all,
I think this is my first post here, and I expect its a relatively niche tip, but I wanted to walk through the steps I undertook to diagnose and fix not being able to upgrade the firmware to the provided RTSP firmware.
Buying a Micro SD Card:
I stupidly bought many thinking that it was a problem with the SD card causing the failed upgrade, but it wasn’t The one I finally got it running on was a Sandisk Ultra 16GB Class 10 Micro SD HC I. I think I’ve had this card for a while, but its available on Amazon (Amazon.com)
Preparing the SD Card:
I then formatted the SD Card in Windows 10 using FAT32, a single 16GB partition and using Master Boot Record rather than GPT.
Setting up Wyze cam:
I accidentally deleted the cam from my app prior to the upgrade, but it doesn’t matter - you can re-add the camera once the firmware is setup correctly.
Copying the firmware file:
Download the correct file for your camera from: https://support.wyzecam.com/hc/en-us/articles/360026245231-Wyze-Cam-RTSP
Note the file is generally a zip file, so you will need to unzip it to reveal the file: demo_V2_RTSP_4.28.4.41.bin (Don’t unpack this file itself - this is the file you will be loading onto the SD Card).
Rename the file from demo_V2_RTSP_4.28.4.41.bin to demo.bin and copy to your SD Card.
Loading the firmware:
Unplug the power to the Wyze cam.
Eject the micro SD from your computer and load into the slot on the Wyze cam - this can be a pain but use a small screwdriver head or a coin and push it in until it clicks.
Hold down the setup button on the base of the camera and plug in the camera (kind of difficult/painful) and it SHOULD have the LED light up yellow then turn solid blue for a long time … however mine flashed blue and went on to boot normally and say ‘Ready to connect’ through the speaker.
Debugging:
What could be wrong?! I tried reformatting the SD Card, bought a further 4 off Amazon, all had the same problem. Maybe I wasn’t holding down the button correctly, so I took the camera base off to hold the actual button (much easier) still nothing.
I racked my brain for ages and gave up for a few weeks. I then looked up the schematics online for the board and decided to get a soldering iron, a USB UART connector and work out what was going on - this wasn’t going to beat me.
Disassembly:
This was simple - Xiaomi Xiaofang 1080P disassembly - YouTube watch this (with the sound turned off - odd choice of music). However my UART ports didn’t align with that board version?! So looking around again I found this diagram (https://user-images.githubusercontent.com/9025713/52875747-005f5000-314d-11e9-8d7d-639dfe3ce1fc.png) which has a view of my board; albeit I believe the TX and RX connectors are the wrong way round.
UART Access:
Due to there being no header, I grabbed a 3x1 header, soldered it to the board and used some wires to hook up the UART to the Wyze cam. Once complete I opened Putty on the COM4 port being used by my UART and set the board to 115200, leaving the other settings as default. I reset the camera whilst holding the button and saw the following:
Hit any key to stop autoboot: 1 … 0
jiabo_do_auto_update!!!
gpio_request lable = sdupgrade gpio = 46
setup_button set long!!!
Interface: MMC
Device 0: Vendor: Man 000003 Snr 71bad700 Rev: 2.9 Prod: SL16G€
Type: Removable Hard Disk
Capacity: 15193.5 MB = 14.8 GB (31116288 x 512)
Filesystem: FAT32 "NO NAME "
the manufacturer c8
SF: Detected GD25Q128
reading demo.bin
the manufacturer c8
SF: Detected GD25Q128
—>probe spend 4 ms
SF: 2621440 bytes @ 0x40000 Read: OK
—>read spend 380 ms
Booting kernel from Legacy Image at 80600000 …
Image Name: Linux-3.10.14
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1859813 Bytes = 1.8 MiB
Load Address: 80010000
Entry Point: 80400630
Verifying Checksum … OK
Uncompressing Kernel Image … OK
It found my card, started the auto update program but then it moved on to normal booting. Weird.
Problem Solving Steps:
I unplugged the power to the Wyze, plugged it back in and mashed the keyboard on Putty to get access to the U-Boot boot loader on the device - this gives you a prompt to look at what is going on in the device.
I ran mmcinfo - this confirmed that I had an SD Card and it was correctly formatted etc.
I ran fatls mmc 0:1 and … oh, what is this… some other Windows hidden files (fine, not a problem) but demo.bin.pfile
Quickly Googling, the pfile extension was there because my home directories in Windows are encrypted … oops. It looks like the file being transferred is either encrypted itself OR had a weird extension.
I move to my Mac (although I’m sure I could have done this on Windows by downloading the zip to a non-encrypted folder) reformatted the card using FAT and MBR again with a single partition. Downloaded the file again, unzipped it, renamed it and copied it to the SD Card. Ejected safely and put in the Wyze Cam with the UART still plugged in and it finally worked!
So moral of the story time - oddly, Microsoft adds a .pfile extension to files that go through an encrypted folder; this cannot be seen in cmd using a simple dir command.
Hope that helped at least one person. Happy to answer any technical questions on the topic if anything comes up, but it was fun to gain access to the hardware and problem solve to fix the issue.
Thanks all.
Dave