Video implementing cloud based OTA updates in a sparkfun ESP 32 thing. In this video, we will first learn the need for cloud based OTA updates, then we will look at mangoes always later, we will set up an M dash account. And finally, we will implement cloud based OTA updates in the sparkfun ESP 32 thing. The basic OTA update method using the Arduino ID and the web server based OTA update method. Both share a common problem that is, a customer or a technician should manually implement the update. Furthermore, these updates are restricted to local networks, and thus, companies cannot implement OTA updates remotely through the internet.
To overcome these problems, many cloud service companies have introduced cloud IoT management systems. We will show you a cloud based It updates using the mangoes always the mangoes OBS is an Internet of Things firmware development framework. It supports low power connected microcontrollers, such as ESP 32 ESB 8266, ti cc 3200, STM 32. Its purpose is to be a complete environment for prototyping, development and managing connected devices. It comes with M dash, which allows for reliable and secure IoT updates and remote management of connected devices. It also provides other features like failsafe OTF firmware updates, web UI and online and offline device status.
Click on the link given in the resources section and you will be redirected to the login page. Create a new account using your email id And go to the M dash console. The free account allows you to connect up to three devices. Now, click the Add Device button. A new device is now created. Now let's connect your sparkfun ESP 32 thing to the M dash.
First, we need to install the M dash library in the Arduino ID click the Manage libraries option under the include library sub menu. Now in the Library Manager, search for M dash library and click Install. Now go to the example sketch of the M dash library and load the code named minimal. The code contains only one library that is the M dash dot h library. The next four instructions are macro definitions used to store the credentials for the Wi Fi and the M dash Enter your Wi Fi credentials first. The device ID and token can be found by clicking the gear icon on the device we created in M dash.
Copy and paste the M dash credentials to the macros in the minimal code. Now upload this code to your sparkfun ESP 32 thing. Open the serial monitor and observe the establishing of cloud communication. Once connected, the device status in the M dash will show as online. Now let's prepare our first OTA update. We will incorporate a blink program as we did earlier to the minimal M dash code.
As always, we need to add the setup and look instructions of a normal blink program into the minimal code. Thus, the final code will look like this. Just like the web server ot update, we need a binary file to implement the OT update So, follow the same steps we did in the last sketch to create a dot band file of the blink sketch in the M dash. Click this icon on your ESP 32 device and select the dot band file you just exploded in the computer. Now the cloud ot update starts, it will take significantly more time than other OTC methods, be patient and wait until the progress reaches hundred percent. The mongoose always has a fail safe ot a mechanism does.
Even if the OT update gets interrupted, due to some connection issues or due to the corruption of packets, the Oto functionality will not get affected. This is how you can implement a cloud based ot update. Summary. In this video, we have covered the following topics the need for cloud based OTA updates what is mangos OS and M dash configuring MX Arduino ideally implementing cloud based ot update using mangoes always. In the next video, we will learn about the wireframe manager library and its importance in product development using sparkfun ESP 32 thing.