Exercise 24
Items needed:
An assembled / Smorphi2 robot
A computer or laptop
A USB to USB-C cable
Stable internet connection
Objective of exercise:
To upload the compiled source code onto smorphi via wireless modes using WiFi through OTA(Over the Air) method
Steps / Description:
We recommend downloading visual studio code to edit the C++ and .h files : https://code.visualstudio.com/download .
(For Windows)Go to This PC > Local Disk > Program Files(x86) > Arduino > libraries > OTA
(For MacOS) Go to Finder > Documents > Arduino > libraries > OTA
There, you would find the file called OTA.h
Right-click on the OTA.h file and then select “open with Visual Studio Code”

Modify the OTA.h file by adding your own WiFi SSID and WiFi Password. Thereafter, Save it.

In your Arduino IDE, open a new file and add in the following lines of code
Upload the code to your Masterboard and when it is done, open your serial monitor and the IP address should be there.
Copy the IP address from the serial monitor and paste the IP address on your web browser. Add in “/update” after the IP address.(NO spaces needed).
Note that, In order for any code to be uploaded via the OTA method, the following 3 lines of code must be included in your source code.
#include<OTA.h>OTA ota;ota.begin();After the code is completed, save the file and select “Sketch → Export compiled Binary” on the menu bar of the Arduino IDE
After it has completed exporting, there will be a new file in the user specified locationNow you can upload the exported “.bin” file on the OTA website on your web browser and it will be uploaded over the WiFi network without any USB to USB-C cable connection.




