Skip to content

05 Performing Updates

Resinchem edited this page Feb 16, 2024 · 5 revisions

Versions 0.40 and later

Starting with version 0.40, you can now upload firmware versions (.bin) via the web interface over-the-air, meaning you do not need to connect to the controller or disconnect it from the power supply. Use the 'Firmware Upgrade' button on the main settings page to get to the firmware update page:

v40_Web_Firmware_Upgrade

You will need to download the desired .bin file from the Releases and save to the local machine. Use the "Select File" button to choose the downloaded .bin file. Then click the 'Update Firmware' button.

Please be patient! Do not refresh or navigate away from the current page. The firmware will first upload to the controller. When this step is complete, a brief success message will be shown and the controller will reboot and apply the new firmware. The process will be complete when the LEDs briefly flash blue, followed by red/green and the main settings page is displayed. You should see the new version number listed at the bottom of the settings page.

Downgrading

It is possible to use the firmware update process to install a prior version. Just note that if you install a version prior to 0.40, you will lose the ability to load new firmware via the browser and will need to revert back to the USB/Flasher or Arduino IDE method for future uploads as described below.

Versions prior to 0.46

Version 0.46 added a new device name to the configuration. This device name will be lost and revert back to using ESPxxxxxx as a host name. This may have implications within your network environment, especially if using more than on Motion LED device on your network.

Versions prior to 0.40

Prior to version 0.40 and later, the ability to update the firmware was not available via the web browser. The following methods were available (and will be needed to upgrade to v0.40):

There are currently two separate methods of applying updates to the controller. They are very distinct, as one uses the compiled .bin file but requires the controller be connected to a computer to upload. The other method can be done over-the-air without accessing the controller, but currently requires the use of the Arduino IDE (free) and use of the source code. Both methods are described below:

Updating using the compiled .bin file and USB cable

The method has the advantage of using the latest compiled .bin file and the same flashing software (e.g. NodeMCU Pyflasher) that was used for the initial installation. In fact the installion process is exactly the same. You just need to download the .bin from the release section of this repository and upload.

The big disadvantage is that this update method requires that you connect the controller to your computer with a USB cable.

IMPORTANT: ALWAYS DISCONNECT YOUR CONTROLLER FROM THE POWER SUPPLY OR ASSURE THE POWER SUPPLY IS UNPLUGGED BEFORE CONNECTING A USB CABLE!!!

Never power your controller from the power supply and the USB connection at the same time. This will almost surely damage the controller and could possibly damage your computer. Once connected to your computer via USB cable, just follow the instructions found under Initial Installation in this wiki. After updating and disconnecting the USB cable, you can connect or power up the power supply again.

Updating Over-the-Air (OTA) via Arduino IDE

This method's advantage is that you do not need to physically access the controller, nor disconnect it from the power supply, as the update will occur over the wifi network.

The disadvantage is that your currently cannot use the compiled bin file or a flashing application like NodeMCU Pyflasher. Instead, you will need to download the source code (or the .ino file) and use the Arduino IDE (free download) or similar application like PlatformIO to compile and upload the .ino source file. You will need to assure you have all the proper boards and libraries installed for the firmware.

By default (unless you modify the code), the port broadcast for OTA updates is the device name + 'OTA' (prior to v0.46, this was always "standaloneOTA"). For a step-by-step guide on performing the OTA update, please see this article from the wiki in another one of my repositories. The process is identical, except for the host/port name as indicated above.

You initiate an Arudino OTA update on the device by entering the IP_address/otaupdate command in the browser (e.g. 192.168.1.194/otaupdate). The LEDs will illuminate in an alternative red/green pattern to indicate it is ready to receive the update.

OTAUpdate_Cropped

If the controller does not begin receiving data withing approximately 20 seconds, it will exist OTA, the LEDs will turn off and it will return to normal operation. For this reason, you should be ready to transmit the OTA update as soon as the system indicates is is ready to receive.

Regardless of the method used, unless it is noted in the release notes, your wifi and other settings will not be overwritten by the update and you should not need to complete the onboarding/settings process again.