I have been waiting for this update ever since I got the M5Stack UnitV2 (review) a tiny little camera with big AI capabilities (for its size). Released initially without WiFi support my UnitV2 patiently awaited the release of the new firmware. The new firmware brings WiFi to UnitV2 and it’s time to update.
“Read the manual”
The update protocol is pretty straightforward as long as you read the instructions carefully. As usual, I skimmed it over, and run into issues (self-inflicted). So I will share these with you so you don’t make them yourself.
M5Stack UnitV2 firmware update
Download the .zip file and unpack the file to a root directory of a freshly formatted FAT32 microSD card. Don’t change the name. Insert the card before you power the unit up. My M5Stack UnitV2 didn’t blink which cascaded into more issues later as I wasn’t sure if my Unit’s firmware was upgraded.
- Put microSD card in
- Hold the button down
- Plug the USB-C cable and power up the device
- Release the button 5 sec later. (my unit didn’t blink but blue LED went out)
- Wait until you can log in to the web interface:
htttp://unitv2.py
or 10.254.239.1
You can verify the update by running cat /etc/os-release
and uname -r
or check if you can see the WiFi access point created by the device. Reboot the M5Stack UnitV2 before you do any of that just to be sure
NAME=Buildroot
VERSION=2020.02.8
ID=buildroot
VERSION_ID=2020.02.8
PRETTY_NAME="Buildroot 2020.02.8"
4.9.84
Other M5Stack products talked about in detail:
- M5Stack Core
- M5Stack Core 2
- M5Stack UnitV2
- M5Dial
- M5Stack Atom Matrix (pending)
WiFi -able
Now that M5Stack UnitV2 is running the latest firmware, you will notice a new AP around which usually looks like M5UV2_XXXX. You can connect to this directly, or set WiFi credentials to connect to your own WiFi network.
If you look at the back of the M5Stack UnitV2, you will see the most needed credentials for the WiFi AP and the SSH access. There is one more thing you should note:
username: root
password: 7d219bec161177ba75689e71edc1835422b87be17bf92c3ff527b35052bf7d1f
These are root credentials for admin access to your M5Stack UnitV2. You can use the m5stack
user, but you may need sudo to set up WiFi credentials, you won’t need the extra privilege if you use a root
user.
Pay attention (and don’t make my mistakes) to WiFi credential commands, as they require ” & ‘ symbols to work. I read the docs on a small screen and completely missed these!
Here is the list of commands:
wpa_cli -i wlan0 scan // Search nearby wifi networks
wpa_cli -i wlan0 scan_result // print search wifi network results
wpa_cli -i wlan0 add_network // get the new connection index
wpa_cli -i wlan0 set_network 0 ssid '"name"' //name is WIFI SSID
wpa_cli -i wlan0 set_network 0 psk '"psk"' //psk is the WIFI password
wpa_cli -i wlan0 enable_network 0 //Enable network
wpa_cli -i wlan0 list_network //List all saved connections
wpa_cli -i wlan0 select_network 0 // Switch to serial number 0 network connection
Once connected simply run ping google.com
to see if everything is working fine. There was one problem. None of this would stick and survive the reboot. If you are facing the same issue, try the following:
WiFi settings are not sticking?
Set the WiFi credentials and enable the connection using the above commands via SSH, then open wpa_supplicant.conf
file and add your WiFi credentials:
sudo nano /etc/wpa_supplicant.conf
#add at the bottom of the file
network={
ssid="network-essid"
scan_ssid=1
key_mgmt=WPA-PSK
psk="very secret passphrase"
}
Then Ctrl+X
and Y
to save the details of your connection. You can then power down the device, connect to the battery and you should see it on your local network. I’m not sure why the settings are not sticking through the commands listed, but this fix should get you out of the WiFi pickle in seconds!
WiFi adventures
Now that I can detach the M5Stack UnitV2 from my PC, I can put the camera anywhere I want, power it by a power bank or USB charger and start collecting photos for machine learning. Something tells me that my first location will be the front door area.
If anything, the value of M5Stack UnitV2 just shoot up and if you can find it in stock it’s the easiest board to get started with machine learning. I’m looking forward to training it as my porch camera and try to detect couriers, neighbours and other events that I can react to with my NodeRED server. AI will definitely bring some bright ideas into my home automation. What other things would you recommend trying? Let me know in this Reddit thread.