Part 2 OTA Proframming
This is the second of a 2 part series on how to program WiFi enabled devices without the use of a USB cable.
There are a few prerequisites to implementing OTA. The first is having both the ADC and the device used to upload the new code communicating on the same WiFi network. The second is having the new software in a form that can be used to upload it. In our case it is a .bin file. The third is having access to the .bin file from the device used for the upload. The fourth is making sure the OTA functionality is included in the new software if you want to be able to keep the option of OTA software updates.
OTA Programming Step 1 Creating the New Software
Install Arduino (Version>1.8) on your computer and upload our ADC sketch available on our GitHub page. In Arduino select “Export Compiled Binary” from the Sketch menu. The exported file will be saved in the same folder as the sketch. You can rename the file with a short name such as ADCr4.bin for convenience. Copy the .bin file to the device you are going to use to upload the new software to the ADC. It must be on the same network as the ADC.
OTA Programming Step 2 Putting The ADC in OTA Mode
In the Node-Red Dashboard, select the OTA tab from the top left menu and click the Button. Node-Red will send a UDP message to the ADC. The message will tell the ADC to start OTA mode.
OTA Programming Step 3 Login to The ADC
Enter the ADC’s ip address in the browser of the device used for the upload. The ip address can be found in the Add devices tab of the Node-Red dashboard. Enter the user name admin and the password admin, you may want to change the password in The new code you are uploading.
A new page will appear for the upload. Select your .bin file and start the upload process. If everything goes according to plan, the ADC will reboot and run the new software you created. If the upload fails, the ADC will not be updated and will reboot its current software.