<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marc Pous</title>
    <description>The latest articles on DEV Community by Marc Pous (@mpous).</description>
    <link>https://dev.to/mpous</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F377548%2F289395c4-3f93-4205-98d0-69fe50ca0640.jpeg</url>
      <title>DEV Community: Marc Pous</title>
      <link>https://dev.to/mpous</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mpous"/>
    <language>en</language>
    <item>
      <title>Choosing Pre-Built Docker Images and Custom Containers for NVIDIA Jetson Edge AI Devices</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Wed, 11 Dec 2024 13:13:17 +0000</pubDate>
      <link>https://dev.to/mpous/choosing-pre-built-docker-images-and-custom-containers-for-nvidia-jetson-edge-ai-devices-3ko2</link>
      <guid>https://dev.to/mpous/choosing-pre-built-docker-images-and-custom-containers-for-nvidia-jetson-edge-ai-devices-3ko2</guid>
      <description>&lt;p&gt;When planning an edge AI project on &lt;a href="https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/" rel="noopener noreferrer"&gt;NVIDIA Jetson devices&lt;/a&gt;, one of the key decisions you will face is whether to use pre-built Docker images or create your own custom containers. This choice significantly impacts your project's security and efficiency. &lt;/p&gt;

&lt;p&gt;If you would like to read more about this, go to the &lt;a href="https://blog.balena.io/docker-containers-for-edge-ai-should-you-use-pre-built-or-custom-images-on-nvidia-jetson-devices/?utm_medium=devto&amp;amp;utm_source=blog&amp;amp;utm_campaign=containers-nvidia-edgeAI&amp;amp;utm_content=devto-post-containers-edgeai-nvidia" rel="noopener noreferrer"&gt;balena blogpost&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-Built Docker Images
&lt;/h2&gt;

&lt;p&gt;Pre-built images, such as those found on &lt;a href="https://hub.docker.com" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt;, offer simplicity and reliability, often including the latest updates and optimizations from their developers. These images are particularly useful for quick development and experimentation, providing all necessary dependencies for NVIDIA frameworks such as &lt;a href="https://hub.docker.com/r/tensorflow/tensorflow" rel="noopener noreferrer"&gt;TensorFlow&lt;/a&gt; or &lt;a href="https://hub.docker.com/r/pytorch/pytorch" rel="noopener noreferrer"&gt;PyTorch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, pre-built images can also introduce challenges. They are often generalized for broad use cases, which can result in bloated containers with unnecessary components, increasing their size and bandwidth demands. Additionally, pre-built images may lack specific libraries or configurations required for complex, customized AI applications, making them less suitable for production environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom Docker Containers
&lt;/h2&gt;

&lt;p&gt;For developers aiming for maximum control and efficiency, creating custom Docker containers is often the better choice. Custom containers allow you to tailor the image to your specific needs, reducing size and improving performance. By building only what you need, you ensure your containers are lean and optimized for the constraints of edge devices, which is especially important for more resource-constrained environments than cloud solutions.&lt;/p&gt;

&lt;p&gt;Building your own images also allows seamless integration with CI/CD pipelines, ensuring consistent updates and deployment. While the process requires more effort, including maintaining &lt;code&gt;Dockerfiles&lt;/code&gt; and managing dependencies, the resulting containers can be perfectly suited to your project’s requirements. For example, an application leveraging TensorRT or CUDA on NVIDIA Jetson devices can be finely tuned to achieve optimal performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Tips for Optimizing Docker Images
&lt;/h2&gt;

&lt;p&gt;Regardless of your approach, there are best practices to optimize your Docker images. Multistage builds, for example, help minimize container size by including only the necessary components in the final image. Leveraging lightweight base images like &lt;a href="https://hub.docker.com/_/alpine" rel="noopener noreferrer"&gt;Alpine&lt;/a&gt; for minimal size or &lt;a href="https://hub.docker.com/_/ubuntu" rel="noopener noreferrer"&gt;Ubuntu&lt;/a&gt; for a balance of size and functionality can further streamline your containers. Exploring the construction of official images, using tools like docker history or referencing open Dockerfiles can provide valuable insights when creating custom images.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn to streamline Edge AI Deployments
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://balena.io" rel="noopener noreferrer"&gt;Balena&lt;/a&gt; simplifies the complexities of managing Docker containers on edge devices, such as NVIDIA Jetson devices. With balenaCloud and balenaEngine, developers can enjoy features specifically designed for edge AI deployments, such as true container deltas for bandwidth-efficient updates and minimal storage wear-and-tear. &lt;/p&gt;

&lt;p&gt;These features are critical for maintaining large fleets of NVIDIA Jetson devices where frequent updates and optimizations are necessary. Some examples of frequent updates and optimizations might be related with AI model optimizations and updates, but also hostOS updates for security.&lt;/p&gt;

&lt;p&gt;Balena’s platform also supports seamless management of custom and pre-built containers, enabling developers to transition between the two approaches as their project evolves. For instance, starting with pre-built images for quick prototyping and later moving to custom-built containers for production-grade performance can be achieved without friction, thanks to balena’s robust container runtime and fleet management capabilities.&lt;/p&gt;

&lt;p&gt;For NVIDIA Jetson projects, selecting the appropriate base image—whether TensorFlow, Deepstream or PyTorch—ensures compatibility and performance. Combining these practices with balena's features creates an efficient workflow for managing edge AI applications.&lt;/p&gt;

&lt;p&gt;For developers ready to explore further, balena’s robust ecosystem provides everything needed to design, deploy and manage containerized applications at scale. Check out the &lt;a href="https://docs.balena.io/learn/getting-started/jetson-agx-orin-devkit-64gb/go/" rel="noopener noreferrer"&gt;balena's Getting Started resources&lt;/a&gt; or reach out in the &lt;a href="https://forums.balena.io" rel="noopener noreferrer"&gt;balena forums&lt;/a&gt; to get started with your NVIDIA Jetson edge AI journey today.&lt;/p&gt;

</description>
      <category>edgeai</category>
      <category>iot</category>
      <category>nvidia</category>
      <category>docker</category>
    </item>
    <item>
      <title>Connect Modbus Serial Sensor XY-MD02 to n3uron IIoT platform with balena</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Fri, 21 Apr 2023 16:59:49 +0000</pubDate>
      <link>https://dev.to/mpous/connect-modbus-serial-sensor-xy-md02-to-n3uron-iiot-platform-with-balena-40e4</link>
      <guid>https://dev.to/mpous/connect-modbus-serial-sensor-xy-md02-to-n3uron-iiot-platform-with-balena-40e4</guid>
      <description>&lt;p&gt;In this blogpost, we are going to showcase how to connect the inexpensive Modbus Serial RTU temperature and humidity sensor, the &lt;a href="http://www.sah.rs/media/sah/techdocs/xy-md02-manual.pdf"&gt;XY-MD02&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NZHzR1Ec--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amgtgc98jifdidoplbih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NZHzR1Ec--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amgtgc98jifdidoplbih.png" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are going to connect the XY-MD02 to an enterprise Industrial IoT platform running on the edge of floor-plants based on &lt;a href="https://n3uron.com/"&gt;N3uron&lt;/a&gt; running on &lt;a href="https://balena.io"&gt;balena&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware needed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Intel NUC i7&lt;/li&gt;
&lt;li&gt;USB stick to flash the operating system of the Intel NUC.&lt;/li&gt;
&lt;li&gt;USB RS485 converter (for this I used the Greluma ‎‎ZL013LUM)&lt;/li&gt;
&lt;li&gt;XY-MD02 Modbus sensor&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Software needed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A free balenaCloud account. Remember: your first 10 devices are free and fully-featured.&lt;/li&gt;
&lt;li&gt;Software to flash the Intel NUC computer. E.g. balenaEtcher&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deploy the Industrial Edge Gateway code
&lt;/h2&gt;

&lt;p&gt;First of all, we are going to deploy the N3uron service along with HiveMQ and MongoDB as an Historian database on balena.&lt;/p&gt;

&lt;p&gt;Find &lt;a href="https://github.com/mpous/n3uron-balena/"&gt;here the Github repository of n3uron with balena&lt;/a&gt; and click the blue button &lt;code&gt;Deploy with balena&lt;/code&gt;. Follow the steps and enjoy the magic of the over-the-air updates with balena.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vqUgSHpK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nhf361m1jko3zixcbkfu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vqUgSHpK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nhf361m1jko3zixcbkfu.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open another tab and type the &lt;code&gt;https://&lt;/code&gt; and your local ip address (copy it from the balenaCloud dashboard). That should redirect you to the login page of n3uron in your local machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XRxPM-0m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fi57zc1qvwy7969ifdov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XRxPM-0m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fi57zc1qvwy7969ifdov.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Login using &lt;code&gt;admin&lt;/code&gt; as User and &lt;code&gt;n3uron&lt;/code&gt; as a Password.&lt;/p&gt;

&lt;h3&gt;
  
  
  Access to the Modbus Data from N3uron
&lt;/h3&gt;

&lt;p&gt;In my case the XY-MD02 is connected to the machine via USB with a RS-485 to USB converter. If you have a similar configuration follow the next steps.&lt;/p&gt;

&lt;p&gt;Go to the &lt;code&gt;Navigation&lt;/code&gt; menu, on &lt;code&gt;System&lt;/code&gt; and click &lt;code&gt;Config&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qnMkLbEZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tttv9zvdc50xb4m251um.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qnMkLbEZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tttv9zvdc50xb4m251um.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the &lt;code&gt;Modules&lt;/code&gt;and then click on the tiny blue button next to &lt;code&gt;Models&lt;/code&gt;. And click &lt;code&gt;New model&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HYpBUBoI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nn2n6g0oh59aibqnh53j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HYpBUBoI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nn2n6g0oh59aibqnh53j.png" alt="Image description" width="651" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add a name such as &lt;code&gt;Modbus&lt;/code&gt;. And select the &lt;code&gt;Module Type&lt;/code&gt; as a &lt;code&gt;Modbus Client&lt;/code&gt;. Click &lt;code&gt;Save&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j_AYi9Co--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ok01ovtapkm2oefuowqe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j_AYi9Co--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ok01ovtapkm2oefuowqe.png" alt="Image description" width="642" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this you defined a Connection Layer as a Modbus Client. Now it's time to configure the connection from N3uron to the device and specify the data it's going to collect.&lt;/p&gt;

&lt;p&gt;On the second menu, you are going to see the &lt;code&gt;Modbus&lt;/code&gt; module you just created but some elements (&lt;code&gt;Logging&lt;/code&gt; and &lt;code&gt;API&lt;/code&gt;), click on them and click the &lt;code&gt;Save&lt;/code&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bRgfWzyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihcbehshpwsc8l8oz5ae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bRgfWzyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihcbehshpwsc8l8oz5ae.png" alt="Image description" width="233" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;code&gt;Modbus&lt;/code&gt; and a new menu will appear, click on the tiny blue button next to &lt;code&gt;Model&lt;/code&gt; and create a &lt;code&gt;New Channel&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zn7hWHYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jo4xiqlk1fdtysf34zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zn7hWHYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jo4xiqlk1fdtysf34zw.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case the XY-MD02 Modbus device is connected through the &lt;code&gt;/dev/ttyUSB0&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Now go to &lt;code&gt;Tag&lt;/code&gt;on the Explorer Menu and we will create the &lt;code&gt;Temperature&lt;/code&gt; and &lt;code&gt;Humidity&lt;/code&gt; tags to gather the data generated by the Modbus sensor. On of the most tricky thing is that the Modbus address to read the Temperature of the XY-MD02 is &lt;code&gt;30002&lt;/code&gt; and Humidity is the &lt;code&gt;30003&lt;/code&gt; and they are &lt;code&gt;Int16&lt;/code&gt;. Have this in mind when you fill the gaps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0QRU_7kf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb4mvvxpmnko4rvmxf2o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0QRU_7kf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb4mvvxpmnko4rvmxf2o.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Afterthat you will be able to see data on the &lt;code&gt;Real Time&lt;/code&gt; option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7N9CzZfz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwamlu9hy5uja5y6rpxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7N9CzZfz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwamlu9hy5uja5y6rpxd.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this will help you to configure a Modbus Serial device on N3uron using a balena gateway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;The balena platform is all about reducing friction for fleet owners. As always, let us know if you run into any issues when following this guide or getting the Industrial IoT gateway reference architecture set up in your factory or industry plant floor.&lt;/p&gt;

&lt;p&gt;Feel free to add a comment below or contact us on the &lt;a href="https://forums.balena.io"&gt;balena forums&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Connect modbus sensor XY-MD02 to NodeRED with balena</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Tue, 04 Apr 2023 16:49:25 +0000</pubDate>
      <link>https://dev.to/mpous/connect-modbus-sensor-xy-md02-to-nodered-with-balena-pn4</link>
      <guid>https://dev.to/mpous/connect-modbus-sensor-xy-md02-to-nodered-with-balena-pn4</guid>
      <description>&lt;p&gt;Modbus is a widely used protocol in the industrial sector for communication between devices, particularly sensors and controllers. A sensor that utilizes Modbus is the XY-MD02 sensor. This sensor measures temperature and humidity and it uses the Modbus RTU protocol. It can measure temperature from -40°C to 80°C with an accuracy of ±0.5°C and humidity from 0% to 100% relative humidity (RH) with an accuracy of ±3% RH according to their technical documentation.&lt;/p&gt;

&lt;p&gt;One tool that can be used to integrate the XY-MD02 sensor with other systems is the &lt;a href="https://blog.balena.io/industrial-iot-edge-gateway-reference-architecture-using-balena-hivemq/" rel="noopener noreferrer"&gt;Industrial edge gateway made with balena&lt;/a&gt; running Node-RED, among others services. Node-RED is a no code / low code programming tool that allows users to create and deploy visual applications for IoT devices. It supports various protocols, including Modbus, making it an ideal tool for creating applications that collect data from Modbus controllers and sensors. By using Node-RED along with balena, users can easily access and integrate data from the XY-MD02 sensor into the edge system, making it a valuable tool in the industrial and automation industries.&lt;/p&gt;

&lt;p&gt;The XY-MD02 can be easily installed using a standard RS485 connection and it is compatible with most Modbus master devices, such as programmable logic controllers (PLCs) and industrial PCs. In this case, the XY-MD02 will be connected directly using a USB RS485 converter to the Industrial IoT gateway using balena.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ho3anky3u7nhujs6u1h.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ho3anky3u7nhujs6u1h.jpeg" alt="Intel NUC running balena and NodeRED with the XY-MD02 modbus sensor with a RS485 USB converter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setting up a Modbus gateway using Node-RED and the XY-MD02 sensor is straightforward.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqpmthef4axei716hso2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqpmthef4axei716hso2.png" alt="XY-MD02 modbus sensor with a RS485 USB converter connection diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, the XY-MD02 sensor is a reliable and accurate sensor that can be integrated into various systems using the Modbus protocol. By using Node-RED as a Modbus gateway, users can easily access and integrate data from the sensor into their system, making it a valuable tool in the industrial and automation industries. With the balena Industrial IoT Edge Gateway easy-to-deploy application, industrial developers can create gateways without needing to write any code, making it accessible to a wide range of users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware needed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Intel NUC i7&lt;/li&gt;
&lt;li&gt;&lt;p&gt;USB stick to flash the operating system of the Intel NUC.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;USB RS485 converter (for this I used the &lt;code&gt;Greluma ‎‎ZL013LUM&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;XY-MD02 Modbus sensor&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Software needed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A free &lt;a href="https://www.balena.io/cloud" rel="noopener noreferrer"&gt;balenaCloud&lt;/a&gt; account. Remember: your first 10 devices are free and fully-featured.&lt;/li&gt;
&lt;li&gt;Software to flash the Intel NUC computer. E.g. &lt;a href="https://www.balena.io/etcher" rel="noopener noreferrer"&gt;balenaEtcher&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deploy the Industrial IoT Gateway
&lt;/h2&gt;

&lt;p&gt;Deploying this application is as simple as clicking the Deploy with balena button to create a fleet on balenaCloud. Find the repository of the application &lt;a href="https://github.com/mpous/hivemq4-ming" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can follow all the instructions to deploy the Industrial &lt;a href="https://blog.balena.io/industrial-iot-edge-gateway-reference-architecture-using-balena-hivemq/" rel="noopener noreferrer"&gt;iot edge gateway from this step-by-step tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmqbhvdsnzm2j92jho3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmqbhvdsnzm2j92jho3m.png" alt="balenaCloud with the Industrial IoT Gateway running"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Run the XY-MD02 Modbus sensor on NodeRED
&lt;/h3&gt;

&lt;p&gt;First of all, it’s important that the sensor is already connected to a USB port of your Intel NUC once you power up the device.&lt;/p&gt;

&lt;p&gt;At this moment, go to NodeRED on the port 80 of your local ip address and use &lt;code&gt;balena&lt;/code&gt; and &lt;code&gt;balena&lt;/code&gt; as username and passwords.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwny0qkw4er1vudtqnvmw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwny0qkw4er1vudtqnvmw.png" alt="NodeRED login page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once there, you should be able to see the Modbus nodes. Select the &lt;code&gt;Modbus Reader&lt;/code&gt; node and a &lt;code&gt;Debug&lt;/code&gt; node.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwemxyqrurv1ejw7kv0yl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwemxyqrurv1ejw7kv0yl.png" alt="Modbus client reader node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To configure the &lt;code&gt;Modbus Reader&lt;/code&gt; node, double click on it. Select the FC &lt;code&gt;FC 4: Read Input Registers&lt;/code&gt; for this case on &lt;code&gt;Address&lt;/code&gt; 1 and &lt;code&gt;Quantity&lt;/code&gt; 2. I selected a &lt;code&gt;Poll Rate&lt;/code&gt; every 2 seconds (feel free to change the poll rate).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcx0bwbahuz9yc5wzac4l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcx0bwbahuz9yc5wzac4l.png" alt="Edit Modbus client Reader node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the &lt;code&gt;Server&lt;/code&gt; edit button to &lt;code&gt;Add new modbus-client&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4itf1q10edidvvyt6uk9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4itf1q10edidvvyt6uk9.png" alt="Add new modbus client"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;code&gt;Type&lt;/code&gt; as &lt;code&gt;Serial&lt;/code&gt;. The &lt;code&gt;Serial Port&lt;/code&gt; is &lt;code&gt;/dev/ttyUSB0&lt;/code&gt;. The &lt;code&gt;Serial type&lt;/code&gt; is &lt;code&gt;RTU-BUFFERED&lt;/code&gt; and the &lt;code&gt;Baud rate&lt;/code&gt; is 9600.&lt;/p&gt;

&lt;p&gt;Update the Modbus read client node and click Deploy. You should see the Modbus Reader node &lt;code&gt;connected&lt;/code&gt; and active.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parse the data
&lt;/h3&gt;

&lt;p&gt;To parse the data coming from the XY-MD02 modbus sensor we will add a function that will get the data coming from the array resulting from reading the modbus data, and we will divide by 10 the number. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenb2ebtgv4d0xey8an0o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenb2ebtgv4d0xey8an0o.png" alt="Add a function"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The temperature is in celsius degrees and the humidity is in %. This is just an example to encode the temperature and humidity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rwcytw4n5octlpkt9v6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rwcytw4n5octlpkt9v6.png" alt="Get the data from the modbus array and create a new payload"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;In case this is not existing go to balenaCloud, open the terminal on HostOS and type &lt;code&gt;ls /dev/ttyUSB*&lt;/code&gt; and check what you see as a result. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1ixoza6eumk8vy5i805.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1ixoza6eumk8vy5i805.png" alt="Check the ttyUSB connections of your device"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you don’t see any ttyUSB0 or anything else as a result, you might have a problem with the USB connection. Feel free to write to us on the &lt;a href="https://forums.balena.io" rel="noopener noreferrer"&gt;balena forums&lt;/a&gt; to learn more about your case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;The balena platform is all about reducing friction for fleet owners. As always, let us know if you run into any issues when following this guide or getting the Industrial IoT gateway reference architecture set up in your factory or industry plant floor.&lt;/p&gt;

&lt;p&gt;Feel free to add a comment below or contact us on our &lt;a href="https://forums.balena.io" rel="noopener noreferrer"&gt;forums&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>industrial</category>
      <category>iot</category>
      <category>nodered</category>
      <category>balena</category>
    </item>
    <item>
      <title>NVIDIA Jetson AGX Orin is now compatible with balena</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Thu, 09 Feb 2023 13:15:27 +0000</pubDate>
      <link>https://dev.to/mpous/nvidia-jetson-agx-orin-is-now-compatible-with-balena-4nok</link>
      <guid>https://dev.to/mpous/nvidia-jetson-agx-orin-is-now-compatible-with-balena-4nok</guid>
      <description>&lt;h2&gt;
  
  
  Balena is excited to announce our official support for the NVIDIA Jetson AGX Orin
&lt;/h2&gt;

&lt;p&gt;Balena is excited to announce our official support for the NVIDIA Jetson AGX Orin. Users of balenaOS can now leverage the incredible power of the Jetson AGX Orin for their edge applications. With 2048 CUDA cores, this new device shines in applications ranging from energy-efficient autonomous machines to manufacturing, logistics and retail among others. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhlpzj4eno5k3zrjq4v9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhlpzj4eno5k3zrjq4v9.png" alt="Image description" width="800" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Balena has solved the hard problems of device deployment, management and updating so you can concentrate on your applications. Now those applications can be even more powerful when they’re running on an AGX Orin powered by balenaOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the NVIDIA Jetson AGX Orin
&lt;/h2&gt;

&lt;p&gt;The NVIDIA Jetson AGX Orin(TM) is the newest member of the NVIDIA Jetson devices. &lt;/p&gt;

&lt;p&gt;Currently the NVIDIA Jetson AGX Orin runs up to 275 TOPS of AI performance with a configurable power range of 15W and 60W. That means 8 times more performance than the NVIDIA Jetson Xavier in the same form factor. &lt;/p&gt;

&lt;p&gt;The Orin has been built with the new NVIDIA Ampere architecture with 2048 cores and 64 Tensor Cores as a GPU with a maximum of 1Ghz of GPU frequency. And as a CPU it uses a 12-core Arm Cortex A78AE 64bit. It also brings a 64GB eMMC memory and 32GB of DRAM.&lt;/p&gt;

&lt;h2&gt;
  
  
  A customer using the NVIDIA Jetson AGX Orin with balena
&lt;/h2&gt;

&lt;p&gt;Microscopes and processing acquired images to make scientific discoveries and engineering decisions are an integral part of state of the art laboratories. &lt;a href="https://www.theiascientific.com" rel="noopener noreferrer"&gt;Theia Scientific&lt;/a&gt; applies IoT solutions to problematic scientific image processing and analysis workflows in the energy, materials, and life sciences fields of Research and Development (R&amp;amp;D). &lt;/p&gt;

&lt;p&gt;Many laboratories have more than one microscope and more than one type of microscope. This quantity and variety are useful for conducting a broad spectrum of experiments and capturing a wide range of images that need to be analyzed. Institutions and facilities with multiple microscopes often refer to them as “fleets”. Similarly, a collection of IoT devices is called a “fleet”. Hence, balenaCloud is one element used with the Theiascope™ platform for fleet management. &lt;/p&gt;

&lt;p&gt;Theia Scientific with the help of &lt;a href="https://volkovlabs.io" rel="noopener noreferrer"&gt;Volkov Lab’s&lt;/a&gt; uses balenaCloud to remotely allow updates, control, and support of Theiascopes™ deployed in any laboratory worldwide.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.balena.io/theia-scientific-using-balena-grafana-for-machine-learning-for-Image-Analysis/" rel="noopener noreferrer"&gt;Read more here about how Theia Scientific is currently using the newest NVIDIA Jetson AGX Orin on their fleet of microscopes&lt;/a&gt;. Theia Scientific and Volkov Labs, improved the Jetson AGX Orin inference speeds up to 30FPS. The Jetson AGX Orin running &lt;a href="https://github.com/ultralytics/yolov5" rel="noopener noreferrer"&gt;YOLOv5&lt;/a&gt; tripled the Frames-per-Second (FPS) compared with the latest Jetson AGX Xavier. &lt;/p&gt;

&lt;h2&gt;
  
  
  Jetson AGX Orin balena resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://blog.balena.io/how-to-use-nvidia-Jetson-devices-on-balena/" rel="noopener noreferrer"&gt;Our Getting Started with Jetson on balena Guide&lt;/a&gt; See examples of loading CUDA and OpenCV on various Jetson devices running balenaOS, including the AGX Orin. Learn about the variety of Jetson devices supported by balenaOS as well as an introduction to running Jetson devices in containers on balena OS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/balena-io-experimental/opendatacam" rel="noopener noreferrer"&gt;OpenDataCam&lt;/a&gt; - an open source tool to quantify the world by tracking moving objects using live video analysis. It is optimized for NVIDIA Jetson boards and is now supported on the Jetson AGX Orin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/balena-io-examples/jetson-examples" rel="noopener noreferrer"&gt;Jetson Examples&lt;/a&gt; - A Github repository with examples of X11 and Gstreamer packages installed on Jetson devices including the AGX Orin. You can use these examples as the basis for your own projects!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/balena-os/jetson-flash" rel="noopener noreferrer"&gt;Jetson Flash&lt;/a&gt; - A tool for flashing balenaOS onto Jetson devices. It runs on Ubuntu or from inside a Docker container.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See our &lt;a href="https://www.balena.io/jetson" rel="noopener noreferrer"&gt;official partners page&lt;/a&gt; , read the documentation or try a project today and let us know what you think on &lt;a href="https://twitter.com/balena_io" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/company/balenaio/" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt; and our &lt;a href="https://forums.balena.io" rel="noopener noreferrer"&gt;Forums&lt;/a&gt;. For more information about the NVIDIA Jetson AGX Orin and to see more examples of their platform in action, visit the &lt;a href="https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-orin/" rel="noopener noreferrer"&gt;NVIDIA Orin modules website&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>github</category>
      <category>opensource</category>
      <category>contributorswanted</category>
      <category>howto</category>
    </item>
    <item>
      <title>Backup and restore the gateway key from your Helium Hotspot</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Sat, 26 Feb 2022 01:06:53 +0000</pubDate>
      <link>https://dev.to/mpous/backup-and-restore-the-gateway-key-from-your-helium-hotspot-44gf</link>
      <guid>https://dev.to/mpous/backup-and-restore-the-gateway-key-from-your-helium-hotspot-44gf</guid>
      <description>&lt;p&gt;If you have a Helium Hotspot it's very important to backup the gateway_key of your hotspot. If you loose this key and something happen to your SD card or secure element, you will not be able to use this hotspot anymore. In conclusion, backup your key, store it in a safe place and you will be able to restore it in the future in case it's needed.&lt;/p&gt;

&lt;p&gt;This tutorial it's compatible with &lt;code&gt;DIY Helium Hotspots&lt;/code&gt; and &lt;code&gt;Data-Only Hotspots&lt;/code&gt; managed with &lt;a href="https://balena.io"&gt;balena&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  DIY Helium Hotspots
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Backup your swarm key
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open an SSH session to the "host-os"&lt;/li&gt;
&lt;li&gt;Type this command and keep note of the (YOUR INSTANCE)_miner-data information: 
  &lt;code&gt;ls /var/lib/docker/volumes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type this command to get a link to download the swarm key (note to replace the YOUR INSTANCE part with the container number that you got from the previous command) 
  &lt;code&gt;curl -F "file=@/var/lib/docker/volumes/(YOUR INSTANCE)_miner-data/_data/miner/swarm_key" https://file.io&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use the outputted file.io link to securely download your swarm key. The file is deleted once downloaded.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Restore your swarm key on your new hotspot
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open an SSH session to the "host-os"&lt;/li&gt;
&lt;li&gt;Type this command and keep note of the (YOUR INSTANCE)_miner-data information: 
  &lt;code&gt;ls /var/lib/docker/volumes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to where the swarm_key is stored
  &lt;code&gt;cd /var/lib/docker/volumes/(YOUR INSTANCE)_miner-data/_data/miner/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remove the original swarm_key file
  &lt;code&gt;rm swarm_key&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Upload your swarm_key that you wish to restore onto file.io and do
  &lt;code&gt;curl -LJO [FILE.IO UPLOAD LINK]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reboot miner and you will see it restored successfully.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Helium Data-Only Hotspot
&lt;/h2&gt;

&lt;p&gt;To build the Helium Data-Only Hotspot using a Raspberry Pi and balena follow &lt;a href="https://docs.helium.com/mine-hnt/data-only-guides/balena-data-only-hotspot/"&gt;these intructions&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Backup your gateway_key.bin file
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open an SSH session to the "host-os" on balenaCloud Terminal.&lt;/li&gt;
&lt;li&gt;Type this command and keep note of the (YOUR INSTANCE)_miner-storage: &lt;code&gt;ls /var/lib/docker/volumes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type this command to get a link to download the gateway key (note to replace the YOUR INSTANCE part with the container number that you got from the previous command) &lt;code&gt;curl -F "file=@/var/lib/docker/volumes/(YOUR INSTANCE)_miner-storage/_data#/gateway_key.bin" https://file.io&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use the outputted file.io link to securely download your &lt;code&gt;swarm key&lt;/code&gt;. The link only works one time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Restore your gateway_key.bin file on your new hotspot
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open an SSH session to the "host-os" on balenaCloud Terminal.&lt;/li&gt;
&lt;li&gt;Type this command and keep note of the (YOUR INSTANCE)_miner-storage information: &lt;code&gt;ls /var/lib/docker/volumes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to where the swarm_key is stored &lt;code&gt;cd /var/lib/docker/volumes/(YOUR INSTANCE)_miner-storage/_data#/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remove the original gateway_key.bin file &lt;code&gt;rm gateway_key.bin&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Upload your gateway_key.bin that you wish to restore onto file.io and do &lt;code&gt;curl -LJO [FILE.IO UPLOAD LINK]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reboot miner and you will see it restored and working :)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Acknowledgements
&lt;/h2&gt;

&lt;p&gt;Thank you for the inspiration made by &lt;a href="https://github.com/bottxrnife/helium-2287-w"&gt;bottxrnife&lt;/a&gt; and Mithun. Also give the credits to &lt;a href="https://unsplash.com/@moneyphotos"&gt;olieman.eth&lt;/a&gt; for the picture of the blogpost.&lt;/p&gt;

&lt;p&gt;If you have other methods to backup and restore gateway keys, feel free to share them on the comments.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Watch the birds on your backyard with a Raspberry Pi, Edge Impulse and balena</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Mon, 14 Feb 2022 13:44:27 +0000</pubDate>
      <link>https://dev.to/mpous/meet-the-birds-on-your-backyard-with-a-raspberry-pi-edge-impulse-and-balena-58hm</link>
      <guid>https://dev.to/mpous/meet-the-birds-on-your-backyard-with-a-raspberry-pi-edge-impulse-and-balena-58hm</guid>
      <description>&lt;p&gt;I love birds, but to be honest with you I don't have any clue about birds.&lt;/p&gt;

&lt;p&gt;My parents installed an Amazon camera in their backyard and we started to get video streams of birds going to a bird feeder, that was awesome. However I couldn't tell my children what type of bird was on the camera. Then at the childrens' school we installed a nest for birds with sensors but we couldn't get any image when a bird was detected. And by serendipity, the balena Ambassador Mithun Das was working on a &lt;code&gt;Bird Watcher&lt;/code&gt; project.&lt;/p&gt;

&lt;p&gt;In this post I would like to share how you can build a &lt;code&gt;Bird Watcher&lt;/code&gt; at home. Once you have it you will be able to &lt;code&gt;watch&lt;/code&gt; birds eating on your bird feeder. Plus detect with a Machine Learning model running on Edge Impulse the type of the bird. Everything runs on a Raspberry Pi using balena and a camera.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbftsh3tzxrhlkfzlm3h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbftsh3tzxrhlkfzlm3h.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of the goals of building a Bird Watcher are related to learning about birds around us plus experimenting with different materials to build the bird feeder. But lately as well to introduce IoT and AI to children. Cameras are not just cameras that take pictures anymore.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Hardware
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Raspberry Pi 3/4 or &lt;a href="https://www.balena.io/fin/" rel="noopener noreferrer"&gt;balenaFin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;SD card in case of the RPi 3/4&lt;/li&gt;
&lt;li&gt;Power supply and (optionally) ethernet cable&lt;/li&gt;
&lt;li&gt;Pi Camera or USB Camera&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Software
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A balenaCloud account (&lt;a href="https://dashboard.balena-cloud.com/" rel="noopener noreferrer"&gt;sign up here&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;An Edge Impulse account (&lt;a href="https://studio.edgeimpulse.com" rel="noopener noreferrer"&gt;sign up here&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://balena.io/etcher" rel="noopener noreferrer"&gt;balenaEtcher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://telegram.org/" rel="noopener noreferrer"&gt;Telegram&lt;/a&gt; on your mobile device&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deploy the fleet
&lt;/h2&gt;

&lt;h3&gt;
  
  
  One-click deploy using &lt;a href="https://www.balena.io/docs/learn/deploy/deploy-with-balena-button/" rel="noopener noreferrer"&gt;Balena Deploy&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Running this project is as simple as deploying it to a balenaCloud application. You can do it in just one click by using the button below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.balena.io%2Fdeploy.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow instructions, click Add a Device and flash an SD card with that OS image dowloaded from balenaCloud. Enjoy the magic 🌟Over-The-Air🌟!&lt;/p&gt;

&lt;h3&gt;
  
  
  Join the balenaHub fleet
&lt;/h3&gt;

&lt;p&gt;Keep it even more simple and join the &lt;a href="https://hub.balena.io/g_mithun_das/birdwatcher" rel="noopener noreferrer"&gt;BirdWatcher fleet&lt;/a&gt; on balenaHub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmv46aztskxy9o1t5tnt8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmv46aztskxy9o1t5tnt8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Train your machine learning model to detect birds
&lt;/h2&gt;

&lt;p&gt;First thing needed is to have your own Birds Machine Learning model made with Edge Impulse.&lt;/p&gt;

&lt;p&gt;My recommendation is to start with &lt;a href="https://studio.edgeimpulse.com/public/40986/latest" rel="noopener noreferrer"&gt;Mithun’s ML model here&lt;/a&gt;. Clone it on your Edge Impulse free account. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqtk9x4pklt8h16earzw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqtk9x4pklt8h16earzw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you prefer to start from scratch. Just create an &lt;a href="https://studio.edgeimpulse.com/" rel="noopener noreferrer"&gt;Edge Impulse project&lt;/a&gt; and choose &lt;code&gt;Images&lt;/code&gt;. Then select that you would like to &lt;code&gt;Classify multiple objects (object detection)&lt;/code&gt;. With this you will be able to detect the location of multiple objects in an image. For example, to detect many birds eating at the bird feeder together. Have in mind that the object detection is more compute intensive than image classification method, and it’s only available for Linux-based devices like the Raspberry Pi or Jetson Nano. Remember, on this project we are going to use the Raspberry Pi running on balena.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lbl39xhjqmo2ba2m4bu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lbl39xhjqmo2ba2m4bu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Data acquisition
&lt;/h3&gt;

&lt;p&gt;Now it’s time to create the &lt;code&gt;Training Data&lt;/code&gt; and the &lt;code&gt;Test Data&lt;/code&gt;, acquiring data from the sensors. In our case, our sensor will be a camera. My recommendation is to upload pictures from birds that you know that live in your region.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprqom3ccf6u8sqolvpr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprqom3ccf6u8sqolvpr0.png" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In the future the best will be to train your model with pictures from the Bird Watcher device with your background, and label them on Edge Impulse.&lt;/p&gt;

&lt;p&gt;Remember to add the correct labels to all the birds. From my experience to get a good Machine Learning model from pictures you will need dozens of pictures for each type of bird, so be patient.&lt;/p&gt;

&lt;h3&gt;
  
  
  Impulse Design
&lt;/h3&gt;

&lt;p&gt;Next step is to create the Impulse. An impulse takes raw data (a picture in our case) and uses signal processing to extract features and then uses a learning block to classify the new data. Once the impulse is saved it’s time to check the raw data of the sample and &lt;code&gt;Generate features&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faubk9rpey6f2g3sc7oyj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faubk9rpey6f2g3sc7oyj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you click “Generate features” you will see the feature explorer diagram with all the samples represented on a X-Y-Z axis. This will enable you to see if the samples from the model are properly separated on the system and that means that the ML model will properly detect the birds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fea5p07spput8z1dfc9vt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fea5p07spput8z1dfc9vt.png" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Finally it’s time to click &lt;code&gt;Object detection&lt;/code&gt; and train your Neural Network (MobileNetV2). Once you have fine-tined the training settings (number of training cycles, learning rate and validation set size), click &lt;code&gt;Start Training&lt;/code&gt;. As a training output you will get the last training performance with a precision score and more information about the model generated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy with balena
&lt;/h2&gt;

&lt;p&gt;Now you are ready to deploy your device with balena. Go to the &lt;a href="https://github.com/just4give/birdwatcher" rel="noopener noreferrer"&gt;BirdWatcher Github repository&lt;/a&gt; and click &lt;code&gt;Deploy with balena&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qh6ta78hm7k5dtbfkca.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qh6ta78hm7k5dtbfkca.png" alt="Image description"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;If you don’t have a balenaCloud account, create a free account (you will be able to connect up to 10 devices for free) and create a fleet. The BirdWatcher project will deploy the latest release of the source code on your fleet.&lt;/p&gt;

&lt;p&gt;Click &lt;code&gt;Add a new device&lt;/code&gt;, configure the balenaOS (add WiFi credentials) and download it or flash directly the SD card of your Raspberry Pi using &lt;a href="https://www.balena.io/etcher/" rel="noopener noreferrer"&gt;balenaEtcher&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcc13lpqrw8x4f0vcz9df.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcc13lpqrw8x4f0vcz9df.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Introduce the flashed SD card into the Raspberry Pi and power it up. You should be able to see your device on your fleet getting online and all the BirdWatcher services getting released.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzyghddgb2pr9nagiehtq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzyghddgb2pr9nagiehtq.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Open your birdwatcher.local website
&lt;/h2&gt;

&lt;p&gt;Once you see the device online and ready on balenaCloud. Check that your laptop / mobile device is connected to the same WiFi as your Bird Watcher. Type into your browser &lt;code&gt;http://birdwatcher.local&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabyezmd0w8mlw8s02uqk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabyezmd0w8mlw8s02uqk.png" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;On the local UI, you will be able to see the stream from the camera on the BirdWatcher. &lt;/p&gt;

&lt;h3&gt;
  
  
  Watched birds
&lt;/h3&gt;

&lt;p&gt;Click on &lt;code&gt;Snaps&lt;/code&gt; to see all the "watched" birds plus Birds detected that are unknown as we are using the camera of the Raspberry Pi as a motion sensor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwni9iw8xmbdra66lq8dr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwni9iw8xmbdra66lq8dr.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From &lt;code&gt;Snaps&lt;/code&gt; you will be able to send pictures to Edge Impulse to retrain the ML model. The picture sent to Edge Impulse is going to be a picture without any square on it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Settings
&lt;/h3&gt;

&lt;p&gt;Go to &lt;code&gt;Settings&lt;/code&gt; and start defining your settings as your Edge Impulse keys.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7oz76kezcrrqubwderw2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7oz76kezcrrqubwderw2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the other hand, enable the motion flag if you want to watch the unknown birds, record the images to feed your Edge Impulse ML model to retrain it. Add &lt;code&gt;Y&lt;/code&gt; to the &lt;code&gt;ENABLE_MOTION&lt;/code&gt; variable. &lt;/p&gt;

&lt;p&gt;Finally, if you would like to send the pictures and results from the ML model over Telegram, turn on the telegram notifications. Set the &lt;code&gt;ENABLE_TG&lt;/code&gt; to &lt;code&gt;Y&lt;/code&gt; and add the keys of your Telegram bot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flys8hxztfspqfg4mdzle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flys8hxztfspqfg4mdzle.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Print your Bird Feeder
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6kf3wmncnjn37ppf54hb.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6kf3wmncnjn37ppf54hb.jpeg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download STL files from here &lt;a href="https://github.com/just4give/balena-ei-linux-bird-watcher/files/7095446/bird_watcher_3dprint.zip" rel="noopener noreferrer"&gt;bird_watcher_3D_print.zip&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqdim8x7952n4xhrtjxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqdim8x7952n4xhrtjxv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Attributions
&lt;/h2&gt;

&lt;p&gt;Thank you to &lt;a href="https://github.com/just4give" rel="noopener noreferrer"&gt;Mithun Das&lt;/a&gt; for developing this amazing application and Edge Impulse to provide support on the balena Linux integration.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>microservices</category>
    </item>
    <item>
      <title>Deploy a Data Only Helium Hotspot with balena, Raspberry Pi and RAK LoRa concentrator</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Fri, 24 Sep 2021 09:20:29 +0000</pubDate>
      <link>https://dev.to/mpous/deploy-a-data-only-helium-hotspot-with-balena-raspberry-pi-and-rak-lora-concentrator-51il</link>
      <guid>https://dev.to/mpous/deploy-a-data-only-helium-hotspot-with-balena-raspberry-pi-and-rak-lora-concentrator-51il</guid>
      <description>&lt;p&gt;Find here a step-by-step tutorial to build, deploy and manage a &lt;code&gt;Helium data-only Hotspot&lt;/code&gt; using balena. Note that this is a balena version based on the Nebra helium light hotspot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disclaimer
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This Helium Hotspot is going to transfer LoRa data to Helium OUIs BUT it's not going to perform proof-of-coverage or anything else to retrieve tokens. &lt;br&gt;
Read more information about the milestones and what's possible to get &lt;a href="https://docs.helium.com/mine-hnt/light-hotspots" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Hardware
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Raspberry Pi 0/2/3/4 or &lt;a href="https://www.balena.io/fin/" rel="noopener noreferrer"&gt;balenaFin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;SD card in case of the RPi 0/2/3/4&lt;/li&gt;
&lt;li&gt;Power supply and (optionally) ethernet cable&lt;/li&gt;
&lt;li&gt;LoRa concentrator (SX1302 SPI based) (e.g. &lt;a href="https://www.rakwireless.com/en-us/products/lpwan-gateways-and-concentrators/rak2287" rel="noopener noreferrer"&gt;RAK2287&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Software
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A balenaCloud account (&lt;a href="https://dashboard.balena-cloud.com/" rel="noopener noreferrer"&gt;sign up here&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://balena.io/etcher" rel="noopener noreferrer"&gt;balenaEtcher&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Deploy the fleet
&lt;/h2&gt;
&lt;h3&gt;
  
  
  One-click deploy using &lt;a href="https://www.balena.io/docs/learn/deploy/deploy-with-balena-button/" rel="noopener noreferrer"&gt;Balena Deploy&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Running this project is as simple as deploying it to a balenaCloud application. You can do it in just one click by using the button below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/mpous/helium-data-hotspot" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.balena.io%2Fdeploy.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow instructions, click Add a Device and flash an SD card with that OS image dowloaded from balenaCloud. Enjoy the magic 🌟Over-The-Air🌟!&lt;/p&gt;
&lt;h2&gt;
  
  
  Device Variables
&lt;/h2&gt;

&lt;p&gt;Once the device is online and the services &lt;code&gt;packet-forwarder&lt;/code&gt; and &lt;code&gt;gatewayrs&lt;/code&gt; are downloaded and installed go to &lt;code&gt;Device Variables&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;VARIANT&lt;/code&gt;: This is used to define your hardware. During the test is being used a Raspberry Pi 4 with RAK2287 LoRa concentrator and the &lt;code&gt;VARIANT&lt;/code&gt; is defined  &lt;code&gt;DIY-RAK2287&lt;/code&gt;. You can find here &lt;a href="https://github.com/NebraLtd/helium-hardware-definitions" rel="noopener noreferrer"&gt;the list of hardware compatible&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;REGION_OVERRIDE&lt;/code&gt;: This is used to define your LoRa region (e.g. &lt;code&gt;EU868&lt;/code&gt;). You can find here &lt;a href="https://github.com/NebraLtd/hm-pktfwd" rel="noopener noreferrer"&gt;the list of LoRa regions compatible&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At that moment the hotspot should be running showing some errors on connecting to the Blockchain on the balenaCloud Logs.&lt;/p&gt;
&lt;h2&gt;
  
  
  Run the Helium Hotspot
&lt;/h2&gt;

&lt;p&gt;To check that everything is running properly, go to the Terminal and select the &lt;code&gt;gatewayrs&lt;/code&gt; service, then introduce.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helium_gateway key info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you will get something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "address": &amp;lt;hotspot address&amp;gt;,
  "name": &amp;lt;hotspot name&amp;gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Join the Helium blockchain with your data-only hotspot
&lt;/h2&gt;

&lt;p&gt;To join the Helium blockchain, at the moment (summer 2021) you only can use the &lt;a href="https://docs.helium.com/wallets/cli-wallet/" rel="noopener noreferrer"&gt;Helium CLI&lt;/a&gt;. The Helium app is still not compatible with the data-only hotspots. Install the &lt;a href="https://docs.helium.com/wallets/cli-wallet/" rel="noopener noreferrer"&gt;Helium CLI&lt;/a&gt; wallet and follow these steps:&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a Helium wallet
&lt;/h3&gt;

&lt;p&gt;Install the Helium wallet CLI or use the wallet key from your mobile application. In case that you need to create a wallet from scratch, just type and follow the instructions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helium-wallet create basic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then to see &lt;code&gt;YOUR_WALLET&lt;/code&gt; of the Helium wallet type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helium-wallet info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Add the hotspot from balenaCloud
&lt;/h3&gt;

&lt;p&gt;Go to your device on balenaCloud and type on the HostOS terminal (before change &lt;code&gt;YOUR_WALLET&lt;/code&gt; by your public Helium wallet ID):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@d83bf778fc69:/etc/helium_gateway# helium_gateway add --owner YOUR_WALLET --payer YOUR_WALLET
{
  "address": "YOUR_ADDRESS",
  "fee": 65000,
  "mode": "dataonly",
  "owner": "YOUR_WALLET",
  "payer": "YOUR_WALLET",
  "staking fee": 1000000,
  "txn": "YOUR_TXN"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember that to confirm all the commands you will need to add &lt;code&gt;--commit&lt;/code&gt; at the end of the command.&lt;/p&gt;

&lt;p&gt;Then go to your computer where you installed the Helium wallet CLI software. Copy your &lt;code&gt;txn&lt;/code&gt; from the previous JSON response and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MacBookPro-Marc-Pous-2827:helium-wallet-v1.6.6-x86-64-macos marcpous$ ./helium-wallet hotspots add YOUR_TXN --commit
Password: [hidden]
+-------------+-----------------------------------------------------+
| Key         | Value                                               |
+-------------+-----------------------------------------------------+
| Address     | YOUR_ADDRESS                                        |
+-------------+-----------------------------------------------------+
| Payer       | YOUR_WALLET                                         |
+-------------+-----------------------------------------------------+
| Fee         | 65000                                               |
+-------------+-----------------------------------------------------+
| Staking fee | 1000000                                             |
+-------------+-----------------------------------------------------+
| Hash        | YOUR_HASH                                           |
+-------------+-----------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will need to have some Data Credits to be able to do this operation (1065000 DCs).&lt;/p&gt;

&lt;p&gt;Finally you will need to assert the location of the data-only Helium hotspot. Cpy your&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MacBookPro-Marc-Pous-2827:helium-wallet-v1.6.6-x86-64-macos marcpous$ ./helium-wallet hotspots assert --gateway YOUR_ADDRESS --lat=YOUR_LAT --lon=YOUR_LON --mode dataonly --commit
Password: [hidden]
+------------------+-----------------------------------------------------+
| Key              | Value                                               |
+------------------+-----------------------------------------------------+
| Address          | YOUR_ADDRESS                                        |
+------------------+-----------------------------------------------------+
| Location         | LOCATION_HASH                                       |
+------------------+-----------------------------------------------------+
| Payer            | YOUR_WALLET                                         |
+------------------+-----------------------------------------------------+
| Nonce            | 1                                                   |
+------------------+-----------------------------------------------------+
| Fee (DC)         | 55000                                               |
+------------------+-----------------------------------------------------+
| Staking Fee (DC) | 500000                                              |
+------------------+-----------------------------------------------------+
| Gain (dBi)       | 1.2                                                 |
+------------------+-----------------------------------------------------+
| Elevation        | 0                                                   |
+------------------+-----------------------------------------------------+
| Hash             | YOUR_HASH                                           |
+------------------+-----------------------------------------------------+

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now that should have worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backup your gateway_key.bin file
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;DISCLAIMER: It's very important that at this point you backup the gateway_key of your hotspot. If you loose this key, you will not be able to use this hotspot anymore.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Follow this instructions to backup your &lt;code&gt;gateway_key.bin&lt;/code&gt; file of your hotspot.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open an SSH session to the "host-os" on balenaCloud Terminal.&lt;/li&gt;
&lt;li&gt;Type this command and keep note of the &lt;code&gt;(YOUR INSTANCE)_miner-storage&lt;/code&gt;: &lt;code&gt;ls /var/lib/docker/volumes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type this command to get a link to download the gateway key (note to replace the &lt;code&gt;YOUR INSTANCE&lt;/code&gt; part with the container number that you got from the previous command) &lt;code&gt;curl -F "file=@/var/lib/docker/volumes/(YOUR INSTANCE)_miner-storage/_data#/gateway_key.bin" https://file.io&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use the outputted file.io link to securely download your swarm key. The link only works one time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Restore your gateway_key.bin file on your new file
&lt;/h2&gt;

&lt;p&gt;Follow this instructions to restore your &lt;code&gt;gateway_key.bin&lt;/code&gt; key into your new hotspot.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open an SSH session to the "host-os" on balenaCloud Terminal.&lt;/li&gt;
&lt;li&gt;Type this command and keep note of the &lt;code&gt;(YOUR INSTANCE)_miner-storage&lt;/code&gt; information: &lt;code&gt;ls /var/lib/docker/volumes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to where the swarm_key is stored &lt;code&gt;cd /var/lib/docker/volumes/(YOUR INSTANCE)_miner-storage/_data#/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remove the original &lt;code&gt;gateway_key.bin&lt;/code&gt; file &lt;code&gt;rm gateway_key.bin&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Upload your &lt;code&gt;gateway_key.bin&lt;/code&gt; that you wish to restore onto file.io and do &lt;code&gt;curl -LJO [FILE.IO UPLOAD LINK]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reboot miner and you will see it restored and working :)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Attributions
&lt;/h2&gt;

&lt;p&gt;Thank you to Nebra for developing and balenifying the Helium Hotspot, Helium developers community, Travis and Joseph from balena to work on the dbus + conman issues.&lt;/p&gt;

</description>
      <category>lora</category>
      <category>balena</category>
      <category>helium</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Run your LoRaWAN gateway with your own The Things Stack network server on a Raspberry Pi and balena</title>
      <dc:creator>Marc Pous</dc:creator>
      <pubDate>Fri, 27 Aug 2021 14:57:01 +0000</pubDate>
      <link>https://dev.to/mpous/run-your-lorawan-gateway-with-your-own-the-things-stack-network-server-on-a-raspberry-pi-and-balena-4o4n</link>
      <guid>https://dev.to/mpous/run-your-lorawan-gateway-with-your-own-the-things-stack-network-server-on-a-raspberry-pi-and-balena-4o4n</guid>
      <description>&lt;p&gt;Running this project you can have all the LoRaWAN stack (Basics Station gateway + The Things Stack network server) running together on a single Raspberry Pi, LoRa concentrator and balena. Using containers on balena means that it can run alongside with other services such as the balena LoRaWAN BasicsTM Station gateway and others.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefth4rdpw296627ykrc4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefth4rdpw296627ykrc4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is LoRa and LoRaWAN
&lt;/h2&gt;

&lt;p&gt;I love the concept of the Low-Power Wide Area Networks (LPWAN). LPWAN enable to set up tiny sensors running with batteries far away from the base stations and still send data during a lot of time. &lt;/p&gt;

&lt;p&gt;LoRa is a radio modulation meant for Long Range communication using very little power to send data.&lt;/p&gt;

&lt;p&gt;LoRaWAN is a Media Acces Layer (MAC) protocol. A software layer that defines how devices use LoRa to transmit and receive messages on a network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcechj4uxy2yqar4u20vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcechj4uxy2yqar4u20vc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LoRaWAN (LoRa Wide Area Network) is an example of LPWAN. Using LoRa (Long Range) radio-frequencies, you can send tiny packages of data over long distances (even miles away depending on the topology) with simple battery-powered devices. The radio packets are captured by gateways which relay over the Internet the LoRa packages to network servers.&lt;br&gt;
The Things Stack is an example of a LoRaWAN network server. The Things Stack (previously The Things Network) is being run on the The Things Industries clusters that are distributed worldwide. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5td5s00rx50llmqxgel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5td5s00rx50llmqxgel.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is this Running on a Raspberry Pi instead of a cloud?
&lt;/h2&gt;

&lt;p&gt;If you want to manage your own data without sharing it with any cloud provider, the data collected can’t leave your country, or other similar requirements, then the solution is to deploy The Things Stack LoRaWAN Network Server using balena on a Raspberry Pi.&lt;/p&gt;

&lt;p&gt;If you are a professional that needs to build your ad-hoc LoRaWAN private network for tests or others, this is a great and unexpensive solution. And if you are a community or company who need a tiny private LoRaWAN network server, this could be just enough.&lt;/p&gt;

&lt;p&gt;Some people says that a Raspberry Pi is to small for this type of job, but it has been running for weeks with good performance with tiny amount of LoRa nodes. Needs to be tested on a bigger environment. Feel free to bring your feedback here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware and Software required
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F325hntapzouzlrfnl0do.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F325hntapzouzlrfnl0do.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Raspberry Pi 3 or 4 (or similar Compute Module carrier boards).&lt;/li&gt;
&lt;li&gt;SD card&lt;/li&gt;
&lt;li&gt;Power supply&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LoRa concentrator (SX1301 or SX1302) (e.g. &lt;a href="https://store.rakwireless.com/products/rak2245-pi-hat" rel="noopener noreferrer"&gt;RAK 2245&lt;/a&gt;, &lt;a href="https://www.rakwireless.com/en-us/products/lpwan-gateways-and-concentrators/rak2287" rel="noopener noreferrer"&gt;RAK 2287&lt;/a&gt; among others)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dashboard.balena-cloud.com/" rel="noopener noreferrer"&gt;balenaCloud&lt;/a&gt; account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://balena.io/etcher" rel="noopener noreferrer"&gt;balena Etcher&lt;/a&gt; to flash the SD card.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deploy the Basics Station gateway with The Things Stack network server
&lt;/h2&gt;

&lt;p&gt;To deploy the Basics(TM) Station gateway service along TTS local network server on your Raspberry Pi, click the &lt;a href="https://dashboard.balena-cloud.com/deploy?repoUrl=https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/xoseperez/the-things-stack-basicstation-balena" rel="noopener noreferrer"&gt;Deploy with balena here&lt;/a&gt; or go to the &lt;a href="https://github.com/xoseperez/the-things-stack-basicstation-balena" rel="noopener noreferrer"&gt;Github repo&lt;/a&gt; to click the Deploy with balena button to automatically deploy the application on balenaCloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dashboard.balena-cloud.com/deploy?repoUrl=https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/xoseperez/the-things-stack-basicstation-balena" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2For4c4wpa91kz427lt6xk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking the deploy button will create a fleet with all the necessary code to deploy your The Things Stack plus basicstation service.&lt;/p&gt;

&lt;p&gt;It’s time to connect your LoRa concentrator compatible with your Raspberry Pi or balena Fin (SX1301, or SX1302 and SX1303 such as RAK2245 or RAK 2287), to run the LoRaWAN gateway running alongside with The Things Stack network server.&lt;/p&gt;

&lt;p&gt;Remember to add or modify the variable &lt;code&gt;MODEL&lt;/code&gt; depending on the LoRa concentrator model you have (SX1301, SX1302 or SX1303). By default is set to SX1301.&lt;/p&gt;

&lt;p&gt;You should see something similar on balenaCloud as below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flg6j069euyymu3dhke9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flg6j069euyymu3dhke9j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will notice that the services will reboot a few times, this is normal behaviour to set up all the services properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Register the gateway at your private The Things Stack
&lt;/h2&gt;

&lt;p&gt;Copy your local IP address and paste it into the browser with https. Accept the self-signed certificate that the device has generated automatically for your local IP address. Alternatevaly feel free to use the public URL generated by balenaCloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpes3wm3j9ptck7ft7pe9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpes3wm3j9ptck7ft7pe9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Login using the credentials User ID &lt;code&gt;admin&lt;/code&gt; and the password &lt;code&gt;changeme&lt;/code&gt;. Feel free to change your Password after you log in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3eyoh4tsoneflgkj0von.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3eyoh4tsoneflgkj0von.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;code&gt;Register a gateway&lt;/code&gt; and then &lt;code&gt;Add new Gateway&lt;/code&gt;. Copy the EUI that the basicstation service introduces as a TAG of on the balenaCloud dashboard. Paste it as the EUI of the gateway when registering.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q416345mgm99x60701m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q416345mgm99x60701m.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the gateway is registered and it's time to generate an API Key. Go to &lt;code&gt;Add API Key&lt;/code&gt;, then select &lt;code&gt;Link as a Gateway to a Gateway Server for traffic exchange, i.e. write uplink and red downlink&lt;/code&gt;. Click the button &lt;code&gt;Create API key&lt;/code&gt;. Remember to copy the key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqlbra067y02orvmzyi6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqlbra067y02orvmzyi6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste the key on the balenaCloud &lt;code&gt;Device Variables&lt;/code&gt; of the device on balenaCloud as &lt;code&gt;TC_KEY&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The gateway registered will be online on your private The Things Stack network server and able to receive data from your LoRa nodes.&lt;/p&gt;

&lt;p&gt;This project involves a lot of services running together. If there is any issue not reported here, feel free to report it at the &lt;a href="https://forums.balena.io/" rel="noopener noreferrer"&gt;balena forums&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And remember that this project is open source, &lt;a href="https://github.com/xoseperez/the-things-stack-basicstation-balena" rel="noopener noreferrer"&gt;feel free to contribute to improve it&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>balena</category>
      <category>lorawan</category>
      <category>thethingsnetwork</category>
      <category>raspberrypi</category>
    </item>
  </channel>
</rss>
