<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Piyush Shah on Medium]]></title>
        <description><![CDATA[Stories by Piyush Shah on Medium]]></description>
        <link>https://medium.com/@shahpiyushv?source=rss-57464183000e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2Qs-BelPvEY82tvl-llvVw.jpeg</url>
            <title>Stories by Piyush Shah on Medium</title>
            <link>https://medium.com/@shahpiyushv?source=rss-57464183000e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:34:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shahpiyushv/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Command — Response Framework in ESP RainMaker]]></title>
            <link>https://medium.com/the-esp-journal/command-response-framework-in-esp-rainmaker-5e8273db7d22?source=rss-57464183000e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e8273db7d22</guid>
            <category><![CDATA[espressif]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[rainmaker]]></category>
            <category><![CDATA[esp-rainmaker]]></category>
            <category><![CDATA[esp32]]></category>
            <dc:creator><![CDATA[Piyush Shah]]></dc:creator>
            <pubDate>Thu, 01 Aug 2024 10:19:04 GMT</pubDate>
            <atom:updated>2024-08-01T10:19:04.731Z</atom:updated>
            <content:encoded><![CDATA[<h3>Command — Response Framework in ESP RainMaker</h3><p>[<em>If you have been following the Espressif blogs and announcements, you must already be aware of ESP RainMaker and its various features. If not, please check out the info </em><a href="https://rainmaker.espressif.com/"><em>here</em></a><em> so that you get an idea about what ESP RainMaker is before you proceed further</em>.]</p><p>Admin users in ESP RainMaker can look at some basic node data like type, model, firmware version, etc. and push OTA firmware upgrades. They can view additional diagnostics data if linked with ESP Insights. However, there was no way for them to send some data to the nodes. The <a href="https://swaggerapis.rainmaker.espressif.com/#/Node%20Parameter%20Operations/updatenodestate">set params</a> operations were available to only end users.</p><p>The command — response framework introduced in ESP RainMaker now provides a new way to communicate with the nodes. It is available to admin as well as end users (both, primary and secondary). It also provides better access control on node side and allows more reliable communication with explicit error reporting from the firmware.</p><h3>Workflow</h3><p>A high level workflow is shown here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*IqHcJxL5OZUspSi_xaXRCA.png" /></figure><p>To explain in short,</p><ul><li>Client generates request payload and sends to cloud.</li><li>Cloud assigns it a request id and returns it back to the client, which can then be used to track the status.</li><li>The request is forwarded to the node right away if it is online or is sent later if the node is offline at that time.</li><li>The response of the node is tracked against the request id so that the status can be queried by the client.</li></ul><p>You can read more about the specifications <a href="https://rainmaker.espressif.com/docs/cmd-resp">here</a>.</p><h3>Advantages</h3><p>This new framework enables many new use cases and workflows</p><p>One of the key advantages is that it allows admins to send some data or commands to the nodes, which was earlier not possible. Moreover, on the firmware side, you can specify which type of users (admin, primary, secondary user) should have access to the commands, giving better access control. Eg. You may allow admins and secondary users to reboot a device, but only primary users will be able to reset the Wi-Fi. You can let only primary users to create schedules, but not admins or secondary users.</p><p>Another major advantage is that you can trigger a command even when a node is offline. This allows to push certain configurations and other information at any time and let the nodes get them whenever they come back online.</p><p>The framework not only provides reliable information about delivery of commands to a node, but also lets users check the status (Eg. request timed out, value out of bounds, operation not permitted, etc.)</p><p>We hope that this new framework will unlock new use cases and workflows. Do give this a try by looking into the <a href="https://rainmaker.espressif.com/docs/cmd-resp">docs</a> and let us know if you find this useful. Command-response sample usage is also available in the <a href="https://github.com/espressif/esp-rainmaker/blob/master/examples/led_light/main/app_main.c">led_light example</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e8273db7d22" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-esp-journal/command-response-framework-in-esp-rainmaker-5e8273db7d22">Command — Response Framework in ESP RainMaker</a> was originally published in <a href="https://medium.com/the-esp-journal">The ESP Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure boot with auto-signing in ESP RainMaker OTA]]></title>
            <link>https://medium.com/the-esp-journal/secure-boot-with-auto-signing-in-esp-rainmaker-ota-d1a2e1161059?source=rss-57464183000e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1a2e1161059</guid>
            <category><![CDATA[espressif]]></category>
            <category><![CDATA[secure-boot]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[rainmaker]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Piyush Shah]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 10:58:38 GMT</pubDate>
            <atom:updated>2024-08-02T11:39:59.666Z</atom:updated>
            <content:encoded><![CDATA[<p>Security is one of the most important aspects of any IoT system and at Espressif, we take it very seriously. The ESP RainMaker platform offers a secure way to onboard a device onto Wi-Fi network and then control and monitor it through cloud. However, the security of the hardware itself is also critical for the overall system to be secure. Espressif MCUs come with various security features like <a href="https://docs.espressif.com/projects/esp-idf/en/stable/esp32/security/secure-boot-v2.html">secure boot</a>, <a href="https://docs.espressif.com/projects/esp-idf/en/stable/esp32/security/flash-encryption.html">flash encryption</a>, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*cyMJrE0lPBmGvUj7.png" /></figure><p>The secure boot feature is especially important as it allows only authorised firmware to run on the MCUs. ESP IDF has made enabling secure boot very easy. However, managing the secure boot keys is still the developer’s responsibility. Some questions that commonly come up for our customers include:</p><ul><li>How to generate the secure boot key?</li><li>Where to store the key securely, is it stored on the developer’s machine or a server?</li><li>How to protect the key from leakage? What if our engineers leave the organisation?</li><li>How do I know which key is programmed on a device, so I don’t accidentally upgrade with the incorrect keys?</li><li>How to manage a fleet of devices with similar firmware but different secure boot keys?</li></ul><p>The recent addition of “<a href="https://rainmaker.espressif.com/docs/secure-signing">Secure Signing</a>” feature in ESP RainMaker addresses all its concerns. It offers a way to</p><ul><li>generate and manage keys</li><li>simplify signing bootloader and firmware images before device manufacturing</li><li>supports transparently “Auto Signing” before deploying OTA firmware upgrades</li></ul><h3>Auto Sign for OTA</h3><p>The auto-signing feature in ESP RainMaker allows developers to just upload their unsigned firmware to ESP RainMaker, and deploy an OTA firmware upgrade. The ESP RainMaker backend transparently handles the signing with the correct keys during OTA firmware upgrades.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*QYxYcjoWmnl0LGX7iTy21g.png" /><figcaption>Using Secure Boot Auto Key Selection in an OTA Job</figcaption></figure><p>If your fleet includes devices that use distinct keys for key verification, ESP RainMaker will ensure that the correctly signed firmware goes to the right device.</p><p>The developer no more needs to keep track of the keys (or should even have the visibility of the keys), making the fleet management simpler.</p><p>Additionally, since the key management is handled in the cloud, this decouples the development activity from the device-management activity, providing better role based separation.</p><h3>Key Management</h3><p>The secure boot signing keys are created and maintained in the cloud with ESP RainMaker. The private key itself is not accessible to the user but can be used only for signing requests. On private deployments, RainMaker uses a FIPS compliant HSM for added security. Access control, for who can trigger signing requests, ensures that only authorised persons in your organisation can utilise this for signing firmware images. This adds another layer of security to the system.</p><h3>First-Time Signing</h3><p>Once the signing key is created in ESP RainMaker, you need to sign the firmware images (bootloader and firmware) that gets flashed on your production devices. This is achieved by uploading unsigned images of secure-boot enabled bootloader and firmware and getting them signed for the first time.</p><p>ESP RainMaker provides detailed instruction for flashing and setting up your SoC with the appropriate security configurations for secure boot.</p><p>The secure signing feature is available in public as well as private RainMaker deployments. Use <a href="https://customer.rainmaker.espressif.com/docs/rainmaker-releases/#210-22-apr-2024">backend release 2.1.0</a> or later and <a href="https://customer.rainmaker.espressif.com/docs/frontend-releases/#201-12-jun-2024">frontend release 2.0.1</a> or later for this.</p><p>Check out more usage details in the <a href="https://rainmaker.espressif.com/docs/secure-signing">ESP RainMaker docs</a>. Go ahead and use this to secure your RainMaker powered IoT devices. Let us know (at <a href="/service/mailto:esp-rainmaker-support@espressif.com">esp-rainmaker-support@espressif.com</a>) if you have any queries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1a2e1161059" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-esp-journal/secure-boot-with-auto-signing-in-esp-rainmaker-ota-d1a2e1161059">Secure boot with auto-signing in ESP RainMaker OTA</a> was originally published in <a href="https://medium.com/the-esp-journal">The ESP Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extending ESP RainMaker with “Services”]]></title>
            <link>https://medium.com/the-esp-journal/extending-esp-rainmaker-with-services-9ccb82dfb9b7?source=rss-57464183000e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ccb82dfb9b7</guid>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[espressif]]></category>
            <category><![CDATA[rainmaker]]></category>
            <dc:creator><![CDATA[Piyush Shah]]></dc:creator>
            <pubDate>Thu, 13 Jan 2022 10:09:03 GMT</pubDate>
            <atom:updated>2022-01-13T10:09:03.868Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*nEkL1xmWZBaPe8WqlESV6Q.png" /></figure><p>[<em>If you have been following the Espressif blogs and announcements, you must already be aware of ESP RainMaker and its various features. If not, please check out the info </em><a href="https://rainmaker.espressif.com/"><em>here</em></a><em> so that you get an idea about what ESP RainMaker is before you proceed further</em>.]</p><p>One important aspect of RainMaker is that the cloud is very thin and acts as a tunnel between the ESP nodes and clients like mobile phones, Alexa, GVA, etc. This makes it very flexible and extensible allowing users to create any type of device with any kind of functionality and access it from the phone apps. There are some defaults that we have defined, but they are not mandatory to use and you can create your own device/param types.</p><p>The functionality that a RainMaker node supports is communicated by the node using something called as the <a href="https://rainmaker.espressif.com/docs/node-cloud-comm.html#node-configuration">node configuration</a>. This, broadly has 2 parts.</p><ol><li>Devices: Comprises of user visible/interactive functionality like on/off or brightness control.</li><li>Services: Comprises mostly of under the hood functionality like reset/reboot, timezone information, schedules, etc.</li></ol><p>Most RainMaker users are now well versed with the concept of devices since they are very much visible in the examples. However, the concept of “services” may not be clear because it is hidden under the APIs like <strong>esp_rmaker_system_service_enable(), esp_rmaker_schedule_enable() </strong>or <strong>esp_rmaker_timezone_service_enable() </strong>and used internally by the phone apps.</p><p>Structurally, a service is very similar to a device. It has a “name” and “type” and a set of parameters. That’s one reason why all device specific APIs are applicable even to services. This applies not just to the firmware APIs, but even to the cloud APIs. The same <a href="https://swaggerapis.rainmaker.espressif.com/#/User%20Node%20Association/getUserNodes">GET /user/nodes?node_details=true</a>, <a href="https://swaggerapis.rainmaker.espressif.com/#/User%20Node%20Association/getUserNodeConfiguration">GET /user/nodes/config</a> and <a href="https://swaggerapis.rainmaker.espressif.com/#/Node%20Parameter%20Operations">GET/PUT /user/nodes/params</a> APIs that are used for devices are applicable for services.</p><p>You can find some standard services <a href="https://github.com/espressif/esp-rainmaker/blob/master/components/esp_rainmaker/src/standard_types/esp_rmaker_standard_services.c">here</a>, but the purpose of this post is to help understand how to add your own custom service.</p><h3>Defining the Use Case</h3><p>Naturally, before you even write a service, you need to define your use case, which will then help you define the parameters of the service. Let’s consider a use case of “Diagnostics” wherein you want the users to trigger some diagnostics on the node and get the diagnostic data in the phone app.</p><h3>Creating the service</h3><p>The code snippet below is the minimal code required to create a service. It basically has 4 components</p><ol><li>Creating the service.</li><li>Registering a callback.</li><li>Creating and adding parameters as applicable.</li><li>Adding it to the node.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67151b0746927a96b04ef4feab2421c5/href">https://medium.com/media/67151b0746927a96b04ef4feab2421c5/href</a></iframe><p>If the overall number of values in diagnostic data is small, it would be ok to define separate integer/bool/float/string parameters for each (“Timestamp” in above example). But if the data is going to be large, it is recommended to use an “object” type (“Data” in above example) and then pass whatever JSON object you want.</p><blockquote>Note that none of these parameters are mandatory and are shown just for reference.</blockquote><p>The above service will show up in the node configuration as this object under the services array:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*1ynig-iVzwHALoRlWK7OEg.png" /></figure><p>Similarly, the following will show up in the node parameters object</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*coTlABKakZVciNBhLCGGQg.png" /></figure><h3>Handling Service callbacks</h3><p>As you can see in the code snippet above, we have registered diag_write_cb as the service write callback. Let us see a sample implementation of this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/520f2e06cf8d4b57690d43e210e73aee/href">https://medium.com/media/520f2e06cf8d4b57690d43e210e73aee/href</a></iframe><p>The above code snippet should be self explanatory because of the comments.</p><p>As you can see, 4 different values of 4 different types could be reported via a single parameter, which is better than having 4 different parameters, which would bloat up the node configuration. Note that the JSON Generator library usage is shown just for reference as it is used at most places in ESP RainMaker. You can choose any other libraries or functions to create the object.</p><h3>Testing the Service</h3><p>Before you add some logic in your phone apps to use the service, it would be better to test it first from the <a href="https://rainmaker.espressif.com/docs/cli-setup.html">RainMaker CLI</a>. Once you have the CLI set-up, you can use a command like this to start the diagnostics:</p><pre>$ ./rainmaker.py setparams --data &#39;{&quot;Diagnostics&quot;:{&quot;Trigger&quot;:true}}&#39; &lt;node_id&gt;</pre><p>Once the device gets this command, the device serial console will show up such prints</p><pre>I (74726) esp_rmaker_param: Received params: {&quot;Diagnostics&quot;: {&quot;Trigger&quot;: true}}</pre><pre>I (74726) app_main: Received write request via : Cloud</pre><pre>I (74726) app_main: Starting Diagnostics</pre><pre>I (74736) esp_rmaker_param: Reporting params: {&quot;Diagnostics&quot;:{&quot;Data&quot;:{&quot;diag1&quot;:true,&quot;diag2&quot;:30,&quot;diag3&quot;:54.16430,&quot;diag4&quot;:&quot;diag&quot;}}}</pre><pre>I (74746) esp_rmaker_param: Reporting params: {&quot;Diagnostics&quot;:{&quot;Timestamp&quot;:1639738352}}</pre><p>You can then query the node parameters to see the results using:</p><pre>$ ./rainmaker.py getparams &lt;node_id&gt;</pre><p>It will show up this object:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*DxxnjM1bCTFYf872fhHz7A.png" /></figure><p>As you can see here, we could add a new custom functionality in RainMaker without changing/configuring anything in the cloud backend. That’s how the “tunnelling” concept of RainMaker works, making it very extensible.</p><p>A few samples for RainMaker services can be found here:</p><ul><li><a href="https://github.com/espressif/esp-rainmaker/blob/master/components/esp_rainmaker/src/ota/esp_rmaker_ota_using_params.c">OTA Using Params</a></li><li><a href="https://github.com/espressif/esp-rainmaker/blob/master/components/esp_rainmaker/src/core/esp_rmaker_system_service.c">System Service</a></li><li><a href="https://github.com/espressif/esp-rainmaker/blob/master/components/esp_rainmaker/src/core/esp_rmaker_time_service.c">Time Service</a></li><li><a href="https://github.com/espressif/esp-rainmaker/blob/master/components/esp_rainmaker/src/core/esp_rmaker_schedule.c">Schedules</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ccb82dfb9b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-esp-journal/extending-esp-rainmaker-with-services-9ccb82dfb9b7">Extending ESP RainMaker with “Services”</a> was originally published in <a href="https://medium.com/the-esp-journal">The ESP Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New Features in ESP RainMaker]]></title>
            <link>https://medium.com/the-esp-journal/new-features-in-esp-rainmaker-cdb4a2f3fdc3?source=rss-57464183000e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdb4a2f3fdc3</guid>
            <category><![CDATA[rainmaker]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[espressif]]></category>
            <dc:creator><![CDATA[Piyush Shah]]></dc:creator>
            <pubDate>Fri, 25 Jun 2021 10:26:12 GMT</pubDate>
            <atom:updated>2021-06-25T10:26:12.591Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UHCFOz2u5q6Qe93NPbKicg.jpeg" /></figure><p><a href="https://rainmaker.espressif.com/">ESP RainMaker</a> has been around for more than a year now and we have been adding quite some features to it every few months. Here we are now, with some more new features.</p><h3>Node Sharing</h3><p>ESP RainMaker allows a user to control a node remotely over the Internet. However, there is often a need to allow others to use the same node. It could be something like giving control of lightbulbs to members of your family, or temporarily giving access to a door lock to your tenant or a maid, or something like a shared hardware resource being accessed remotely by multiple employees. To serve such use cases, ESP RainMaker offers an ability of sharing a node with others.</p><p>To share a node, go to the parameters control page by tapping the device tile on the home page, click on the (i) on top right and then scroll own to the bottom where you can find an option to Add a new member. Note that you can add only those users who have already signed up for RainMaker. The user who shares the node is called the primary user for the node, whereas all the other users added are called secondary users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*MG-3YkAK80zdhpKDKzX8Fg.png" /></figure><p>The secondary user with whom the node was shared can open the phone app, and under the User profile page, go to “Sharing Requests”. It will show all the sharing requests received, which can then be accepted or declined. Soon, we will provide push notifications to alert users that someone has shared RainMaker nodes with them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ZX_dl-Rwq19capZ9nnIT4Q.png" /></figure><p>Once the sharing is accepted, the secondary user can control and monitor the node, in the same way as the primary user. However, he/she cannot share it further. For more information, check out the docs <a href="https://rainmaker.espressif.com/docs/node-sharing.html">here</a>.</p><h3>Timezone Setting</h3><p>ESP RainMaker already had support for Timezones on the device side. The various ways in which this could be used can be found <a href="https://rainmaker.espressif.com/docs/time-service.html#time-zone">here</a>. However, the support on phone app side was missing, making it a bit hard to set timezone on the devices at run time. The latest phone apps now have an option to set this on the Node details page. Moreover, to prevent cases wherein people may forget to set the timezone explicitly from the Node details page, we have also added this in the “Adding device” workflow. So, after provisioning and user-node association is done, the phone app automatically sets the device timezone to match the phone’s timezone.</p><h3>Arduino Support</h3><p>Even though we have taken quite some efforts to make developer on-boarding easy, by ways of the <a href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#esp-idf-tools-installer">ESP IDF Windows Installer</a> and the <a href="https://github.com/espressif/idf-eclipse-plugin#installing-idf-plugin-using-update-site-url">Eclipse</a> and <a href="https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md">VSCode</a> plug-ins, we do understand that a lot of makers/hobbyists would still prefer Arduino due to its simplicity and cross platform support. That’s why we have now added the ESP RainMaker support in Arduino. Check out <a href="https://medium.com/the-esp-journal/esp-rainmaker-now-in-arduino-cf1474526172">this post</a> for more information.</p><h3>Node Grouping</h3><p>As people start using more and more Smart devices, it often gets hard to view and manage them from the phone apps. To make that simpler, we have added a concept of Node grouping. You can create logical or abstract groups of your nodes using the RainMaker app. For some users, the groups can be based on rooms; for others, they could be based on device types. The choice is yours. Group management is available directly on the homepage as you can see in this screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*hkudXsK_DEgRBgS7y816fw.jpeg" /></figure><p>Even though the phone apps have only single level groups, the RainMaker backend supports even sub groups. You can check out the Grouping APIs <a href="https://swaggerapis.rainmaker.espressif.com/#/Device%20grouping">here</a> if you are interested.</p><p>Apart from these features, we have made quite some visual and convenience related improvements. Download our latest apps from <a href="https://rainmaker.espressif.com/docs/quick-links.html#phone-apps">here</a> and check these out for yourself. You can give your feedback either on <a href="https://github.com/espressif/esp-rainmaker/issues">GitHub</a> or the <a href="https://www.esp32.com/viewforum.php?f=41&amp;sid=98f7b3da06f71d135fc2161792ffa5d0">forums</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdb4a2f3fdc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-esp-journal/new-features-in-esp-rainmaker-cdb4a2f3fdc3">New Features in ESP RainMaker</a> was originally published in <a href="https://medium.com/the-esp-journal">The ESP Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ESP RainMaker now in Arduino]]></title>
            <link>https://medium.com/the-esp-journal/esp-rainmaker-now-in-arduino-cf1474526172?source=rss-57464183000e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf1474526172</guid>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[rainmaker]]></category>
            <category><![CDATA[espressif]]></category>
            <dc:creator><![CDATA[Piyush Shah]]></dc:creator>
            <pubDate>Tue, 15 Jun 2021 13:43:40 GMT</pubDate>
            <atom:updated>2021-06-18T11:58:31.481Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*ctXndTETqL1alORFAxx9dg.png" /></figure><p>Since its launch in April 2020, we have been making quite some improvements to <a href="https://rainmaker.espressif.com/">ESP RainMaker</a>, mostly around the feature set. Along with that, we have also been making efforts to make developer on-boarding easier. The <a href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#esp-idf-tools-installer">ESP IDF Windows Installer</a> and the <a href="https://github.com/espressif/idf-eclipse-plugin#installing-idf-plugin-using-update-site-url">Eclipse</a> and <a href="https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md">VSCode</a> integrations especially have been useful for a lot of developers. One common request we still kept getting was support for Arduino, since getting started with it is much more convenient for many developers and it is also easier to migrate from other chips/platforms since the IDE and code structure is familiar.</p><p>So, here it is. The support for ESP RainMaker in Arduino is now live.</p><h3>Overview</h3><p>A sample sketch for a <a href="https://github.com/espressif/arduino-esp32/tree/master/libraries/RainMaker/examples/RMakerSwitch">switch</a> has been included. Let’s quickly look at the code that enables this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bed4b471a87fcb7df04d8c5edf62f00/href">https://medium.com/media/2bed4b471a87fcb7df04d8c5edf62f00/href</a></iframe><p>With the above few lines of simple code, our fully functional smart switch is ready. The switch can be controlled with the <a href="https://play.google.com/store/apps/details?id=com.espressif.rainmaker">Android</a> and <a href="https://apps.apple.com/app/esp-rainmaker/id1497491540">iOS</a> applications, as well as Alexa and Google Voice Assistant skills.</p><p>When we execute this code:</p><ul><li>The device will first check if a Wi-Fi network is configured. If the network is not configured, it will launch the provisioning process. The device can then be configured using the phone apps mentioned above.</li><li>If Wi-Fi configuration is found, it will connect to the configured network.</li><li>Once connected, it will connect to the RainMaker cloud, looking for commands to modify its parameter (switch state in this case).</li><li>The device will also look for commands on the local Wi-Fi network.</li><li>When somebody changes the switch state using phone apps or voice integrations, the <em>write_callback()</em> gets called. This is then implemented as:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea34f2e5eecc1f65896d77c337bccab1/href">https://medium.com/media/ea34f2e5eecc1f65896d77c337bccab1/href</a></iframe><p>The function takes the new switch output value and</p><ul><li>updates in our internal state,</li><li>calls the driver to update its GPIO state</li><li>reports back to the cloud the new state</li></ul><p>There, that’s a fully functional Smart Switch in action. A few common device types are already supported in the data model (bulb, fan, switch), but you can add yours too.</p><h3>Getting Started</h3><p>Before you even get started, a few points to note</p><ul><li>For using RainMaker, you first have to get started with the <a href="https://github.com/espressif/arduino-esp32">ESP32 support in Arduino</a>.</li><li>RainMaker support is not yet part of a stable esp32-arduino release. So we will use the master branch of the <a href="https://github.com/espressif/arduino-esp32">ESP32 Arduino</a> repository. We will update here and elsewhere once this support is available in a stable release.</li><li>Currently, only ESP32 is supported. Support for ESP32-S and ESP32-C series is coming soon.</li></ul><p>Once your Arduino is set-up with the ESP32 support, follow these steps</p><ol><li>Open the Arduino IDE, go to Tools and set the following</li></ol><ul><li>Board: “ESP32 Dev Module”</li><li>Flash Size: “4MB”</li><li>Partition Scheme: “RainMaker”</li><li>Core Debug Level: “Info”</li><li>Port: Choose the appropriate ESP32 port as per your Host platform from the list. By connecting/disconnecting your ESP32 board, you can find out the port number.</li></ul><p>This is the complete list for reference:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*sS_zIiPYpf4jII0eJdIDow.png" /><figcaption>Arduino Tools Setting</figcaption></figure><p>2. Now, go to File -&gt; Examples -&gt; Examples for ESP32 Dev Module -&gt; ESP RainMaker -&gt; RMakerSwitch</p><p>3. Upload the Sketch onto your ESP32 board by clicking on the Upload button in the IDE, or going to Sketch -&gt; Upload</p><p>4. Go to Tools -&gt; Serial Monitor. Choose 115200 as Baud. If you do not see anything in the monitor window, reset your board (using the RST button).</p><p>5. Download the <a href="https://rainmaker.espressif.com/docs/quick-links.html#phone-apps">ESP RainMaker phone app</a>, sign-up or sign-in and you are ready to go.</p><p>6. Follow the instructions in the Serial Monitor to add the switch from the RainMaker app. (If you do not see the instructions, double check the “Core Debug Level: Info” option under Tools)</p><p>Any control from the phone app should now reflect on the device and any change on the device (by pressing the BOOT button) should reflect in the phone app.</p><blockquote>You can press and hold the BOOT button for more than 3 seconds and then release for Resetting Wi-Fi, and for more than 10 seconds to Reset to Factory defaults.</blockquote><p>Please check out <a href="https://rainmaker.espressif.com/">here</a> to understand more about ESP RainMaker. Even though all the <a href="https://docs.espressif.com/projects/esp-rainmaker/en/latest/c-api-reference/index.html">RainMaker APIs</a> are expected to work seamlessly with Arduino, we have provided some simplified APIs to suit typical Arduino codes, as you can see <a href="https://github.com/espressif/arduino-esp32/tree/master/libraries/RainMaker#documentation">here</a>.</p><p>John Macrae is active in our ESP32 maker community and he had created <a href="https://www.youtube.com/watch?v=g-Mw0-lzxdg">this video</a> when Arduino support was launched. His <a href="https://www.youtube.com/watch?v=eYVtHuLk008">newer video</a> demonstrates the improvements introduced recently and also shows how to build a custom device.</p><p>Hope you enjoy RainMaker, have fun hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf1474526172" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-esp-journal/esp-rainmaker-now-in-arduino-cf1474526172">ESP RainMaker now in Arduino</a> was originally published in <a href="https://medium.com/the-esp-journal">The ESP Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3rd Party Integrations in ESP RainMaker]]></title>
            <link>https://medium.com/the-esp-journal/3rd-party-integrations-in-esp-rainmaker-3ea4df6afa3?source=rss-57464183000e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ea4df6afa3</guid>
            <category><![CDATA[espressif]]></category>
            <category><![CDATA[rainmaker]]></category>
            <category><![CDATA[alexa]]></category>
            <category><![CDATA[google-home]]></category>
            <dc:creator><![CDATA[Piyush Shah]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 02:55:30 GMT</pubDate>
            <atom:updated>2020-07-01T04:34:08.249Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpf1R6rG-WZfoTCfubQIpg.jpeg" /></figure><p>IoT, in general, has come a long away. During the very early stage, there was browser based control and monitoring, which, though more convenient than non-IoT devices, had a very narrow market. With the advent of Smartphones, IoT devices became much more easier to use and mass adoption became a possibility. However, the real push was given by the advent of various eco-systems and Voice assistants like Siri, Alexa and Google Assistant. Controlling by just asking verbally is much more natural than opening some app in a smartphone and tapping buttons.</p><p>With this in mind, we now have added 3rd party integrations, particularly Alexa and Google Voice Assistant (GVA) support in ESP RainMaker!</p><h3>How does this work?</h3><p>If you are already familiar with ESP RainMaker, you may know that it has the concepts of <a href="https://rainmaker.espressif.com/docs/spec-concepts.html#devices">devices</a> and <a href="https://rainmaker.espressif.com/docs/spec-concepts.html#parameters">parameters</a>. The devices and parameters have an optional “type” field. We have defined our own standard types for some common smart home devices like switches, lightbulbs, fans, etc. You can find information about the standard types <a href="https://rainmaker.espressif.com/docs/standard-types.html">here</a>. We have now created a layer which maps these parameters to formats that are understood by Alexa and GVA. So a device type in RainMaker (like light, switch, etc.) maps to a similar device type there, and their parameters like power, brightness, hue, saturation, intensity. etc. get mapped to the corresponding capabilities/traits. If you have just the power and brightness params, you get a simple brightness controllable light. If you include hue, saturation and intensity, you get a color light in Alexa and GVA.</p><h3>Usage</h3><p>The code required to implement the standard devices is very simple. Let us look at a colour light example (led_light) which is already available on <a href="https://github.com/espressif/esp-rainmaker/tree/master/examples/led_light">GitHub</a>. The relevant code snippet below is self explanatory.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dd60f3160d8f38834a476c409e3be71/href">https://medium.com/media/6dd60f3160d8f38834a476c409e3be71/href</a></iframe><p>The <a href="https://github.com/espressif/esp-rainmaker/tree/master/examples/switch">switch example on GitHub</a> is also ready out of the box for Alexa/GVA.</p><p>Once you build and flash the Lightbulb/Switch example, provision your board and link to your account using the <a href="https://rainmaker.espressif.com/docs/quick-links.html#phone-apps">ESP RainMaker Phone apps</a>. Give the device some friendly name so that it is easy to identify.</p><h3>Enabling Alexa</h3><ul><li>Open the Alexa app on your phone, go to Skills and Games in the menu and search for ESP RainMaker.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SsIwUMlN8qxwefmoB1G07A.jpeg" /></figure><ul><li>Select the skill, tap on “Enable to Use” and provide your RainMaker credentials.</li><li>Once the account linking is successful, allow Alexa to discover your devices.</li><li>Once the devices are successfully discovered, the setup is complete and you can start controlling them using Alexa.</li></ul><h3>Enabling Google Voice Assistant (GVA)</h3><ul><li>Open the Google Home app on your phone.</li><li>Tap on “+” -&gt; Set up Device.</li><li>Select the “Works with Google” option meant for devices already set up.</li><li>Search for ESP RainMaker and sign in using your RainMaker credentials.</li><li>Once the Account linking is successful, your RainMaker devices will show up and you can start using them.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nNmV4ly-4simENKrfBSCGg.jpeg" /></figure><ul><li>Some users may not see the list like above, but the devices should show up in the device list in the Google Home app.</li></ul><p>So, go ahead and start linking your RainMaker devices to your favourite voice assistants. Currently, only switch and light are supported. Let us know what you would like us to add next by dropping a message either on the <a href="https://esp32.com/viewforum.php?f=41">forum</a> or <a href="https://github.com/espressif/esp-rainmaker/issues">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ea4df6afa3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-esp-journal/3rd-party-integrations-in-esp-rainmaker-3ea4df6afa3">3rd Party Integrations in ESP RainMaker</a> was originally published in <a href="https://medium.com/the-esp-journal">The ESP Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OTA Firmware Upgrades with ESP RainMaker]]></title>
            <link>https://medium.com/the-esp-journal/ota-firmware-upgrades-with-esp-rainmaker-99bf48e80288?source=rss-57464183000e------2</link>
            <guid isPermaLink="false">https://medium.com/p/99bf48e80288</guid>
            <category><![CDATA[esp32-s2]]></category>
            <category><![CDATA[esp32-programming]]></category>
            <category><![CDATA[rainmaker]]></category>
            <category><![CDATA[esp32]]></category>
            <dc:creator><![CDATA[Piyush Shah]]></dc:creator>
            <pubDate>Mon, 25 May 2020 04:32:16 GMT</pubDate>
            <atom:updated>2020-05-25T07:19:44.868Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zb2E3Od6Q9_EhHLehYh3JA.jpeg" /></figure><p>Any Internet of Things (IoT) system is incomplete if it does not have a facility of upgrading the firmware remotely (also called Over The Air firmware upgrades). The <a href="https://github.com/espressif/esp-idf">ESP IDF</a> offers a very simple interface for <a href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/esp_https_ota.html">OTA upgrade using a secure HTTP connection</a>. However, the following things still remain unaddressed, as they are out of scope of the firmware development framework and require some infrastructural support:</p><ol><li>Setting up a secure webserver to host the firmware image.</li><li>Sending the image URL to the device.</li><li>Monitoring status of the OTA Upgrade.</li></ol><p>Setting up the infrastructure could be a challenge, especially for Makers. The recently launched <a href="https://rainmaker.espressif.com/">ESP RainMaker</a> just added a facility to address all these concerns.</p><h3>Introducing Services</h3><p>Similar to the concept of “devices”, a new concept of “services” has been introduced. They are very similar to devices but are meant for features like OTA, diagnostics, system information, etc. which do not really fall in the category of any device.</p><h4>The OTA Service</h4><p>The OTA Service is the first standard service added. It has 3 string parameters: URL, Status and Info, which are accessible in the same way as any other device parameters. Applications can send the firmware upgrade url by writing to the URL parameter and then monitor the status by reading the Status and Info. The firmware side code has been abstracted out completely and applications need to call this single API:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6b6b9ac9de1607d1ad1bd1836efb868/href">https://medium.com/media/e6b6b9ac9de1607d1ad1bd1836efb868/href</a></iframe><p>Check the <a href="https://github.com/espressif/esp-rainmaker/tree/master/examples/switch">ESP RainMaker Switch example</a> for sample usage .</p><p>This takes care of points 2 and 3 above, but point 1 could still be a pain point. To make it even easier, ESP RainMaker now also offers an image hosting service which makers can use for temporary storage of their firmware images. This facility is exposed via the ESP RainMaker CLI.</p><h3>Using OTA Upgrades with RainMaker CLI</h3><p>To use it, set up the CLI as per the instructions <a href="https://rainmaker.espressif.com/docs/cli-setup.html">here</a>. Once done, ensure that your node is linked to your account and is also online. Then, follow these steps:</p><pre>$ cd /path/to/esp-rainmaker/cli<br>$ ./rainmaker.py login # Use the same credentials used in phone app for setting up the node<br>$ ./rainmaker.py getnodes # Just to verify that you see the node that you want to upgrade<br>$ ./rainmaker.py otaupgrade &lt;node_id&gt; &lt;path_to_ota_fw_image&gt;</pre><p>The otaupgrade command uploads the firmware image to the RainMaker server and gets back a temporary URL in return. It then sends this URL to the node using the OTA URL parameter mentioned above and then checks for the status using the Status and Info parameters. It will print the progress as below:</p><pre>$ ./rainmaker.py otaupgrade 7CDFA1XXXXXX ../examples/switch/switch-2.0.bin<br>Uploading OTA Firmware Image...<br>Checking esp.service.ota in node config...<br>Setting the OTA URL parameter...<br>OTA Upgrade Started. This may take time.<br>Getting OTA Status...<br>[19:49:50] in-progress : Downloading Firmware Image<br>[19:49:58] in-progress : Downloading Firmware Image<br>[19:50:07] in-progress : Downloading Firmware Image<br>[19:50:16] in-progress : Downloading Firmware Image<br>[19:50:25] in-progress : Downloading Firmware Image<br>[19:50:34] in-progress : Downloading Firmware Image<br>[19:50:43] success : OTA Upgrade finished successfully</pre><p>Once the OTA Upgrade is successful, the node reboots into the new firmware and you are done. Additional configuration and technical details can be found <a href="https://rainmaker.espressif.com/docs/ota.html">here</a>.</p><p>So, get going with ESP RainMaker. Let your devices be anywhere, in the garage, in the water tank, out on the lawn, in the home or the office; you can continue playing around with the firmware by using this new OTA service.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99bf48e80288" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-esp-journal/ota-firmware-upgrades-with-esp-rainmaker-99bf48e80288">OTA Firmware Upgrades with ESP RainMaker</a> was originally published in <a href="https://medium.com/the-esp-journal">The ESP Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>