<?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 Nils Westerlund on Medium]]></title>
        <description><![CDATA[Stories by Nils Westerlund on Medium]]></description>
        <link>https://medium.com/@nilswesterlund?source=rss-57207bf107f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*97J4Y0lhwoRf2rF4</url>
            <title>Stories by Nils Westerlund on Medium</title>
            <link>https://medium.com/@nilswesterlund?source=rss-57207bf107f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 01:07:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nilswesterlund/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[A really Toit GLAMP server]]></title>
            <link>https://medium.com/the-toit-take/a-really-toit-glamp-server-d8edd4897f42?source=rss-57207bf107f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8edd4897f42</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[http-client]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[esp32-programming]]></category>
            <category><![CDATA[lamp-stack]]></category>
            <dc:creator><![CDATA[Nils Westerlund]]></dc:creator>
            <pubDate>Mon, 08 Nov 2021 14:59:16 GMT</pubDate>
            <atom:updated>2021-12-01T22:39:39.401Z</atom:updated>
            <content:encoded><![CDATA[<p>In this project, we will use Toit to push data to a classic LAMP stack. We will also add Grafana to the stack. In other words, we are building a Toit-powered GLAMP stack! Data will flow from a BME280 sensor connected to an ESP32 running Toit, and this will forward the data via HTTP to a Linux computer running the GLAMP stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3DklNxIL6C1mx3NHjh3qKg.png" /></figure><p>The original LAMP stack is a classic web server setup. The acronym stands for “Linux, Apache, MySQL, and PHP” and this setup has been used by numerous well-known internet companies throughout the years. There are many tutorials available online (try <a href="https://randomnerdtutorials.com/raspberry-pi-apache-mysql-php-lamp-server/">this one</a>, for example) covering how to set up such a system, so that part will not be covered in this post: I will assume you have an online computer running a LAMP stack. The same goes for <a href="https://grafana.com/grafana/download">Grafana</a>: Downloading and installing Grafana on your computer is very straightforward and we’ll assume this step is also finished before starting.</p><h3><strong>Parts needed</strong></h3><ul><li>An ESP32 development kit (you can buy one <a href="https://www.banggood.com/Keyes-ESP32-WROOM-32-Module-Core-Board-ESP32-ESP-32-bluetooth-and-WIFI-MCU-p-1756083.html?cur_warehouse=CN&amp;rmmds=search">here</a>).</li><li>The BME280 sensor module, e.g. from <a href="https://www.sparkfun.com/products/15440">Sparkfun</a>.</li><li>A 1602 LCD. Check <a href="https://www.sparkfun.com/products/255">this one</a> out.</li><li>A Potentiometer, around 0–5 kOhm. <a href="https://www.digikey.se/product-detail/en/bourns-inc/PV36W502C01B00/490-2888-ND/666515">This</a> will do the trick.</li></ul><h3>On the sending side</h3><p>On the data generation side (i.e. the ESP32 with peripherals) we need to set up our hardware, i.e. connect the ESP32 to the LCD and the BME280 sensors. We will also create a free account at <a href="http://toit.io/">toit.io</a> to initialize (or “provision”) the ESP32 with Toit. Finally, we’ll download the required files from GitHub so that we can install the Toit application on the ESP32.</p><h4>Hooking up the hardware</h4><p>The BME280 sensor will be connected to the EPS32 using I²C, so we only need two wires for that: SDA and SCL. The LCD requires a few more wires since we talk to it in nibbles, i.e. chunks of four bits. It also requires a potentiometer for adjusting the LCD contrast, and two signal pins for RS (Register Select) and E (Enable). We will use the following GPIOs on the ESP32:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETzXjkzapFA2gCLnvqaMjQ.png" /></figure><p>Below is a Fritzing diagram of the setup. Note that we need 5V for the LCD, and 3.3V for the BME280. Do not mix these wires up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rQAKhn5bc7Ddn6U4" /></figure><h4>Setting up Toit</h4><p>Getting Toit up and running on your ESP32 is done in a few minutes:</p><ul><li>Connect your ESP32 dev kit to your computer.</li><li>Go to <a href="http://toit.io/">toit.io</a> and set up your free Toit account. Once logged in, you will be guided through the Toit setup process.</li><li>When the installation is complete after about a minute, the ESP32 will go online and show up in your list of devices in your Toit console.</li><li>You can now interact with your ESP32 without having it connected to your computer. All communication goes via the Toit console.</li><li>Install the Toit CLI and VSCode by following these <a href="https://docs.toit.io/getstarted/installation/linux">instructions</a>.</li></ul><h4>The Toit code</h4><p>First of all, you need to install the Toit driver for the BME280 sensor, using the following command:</p><pre>$toit pkg install github.com/toitware/bme280-driver</pre><p>The Toit package registry contains a suitable driver for the LCD. Install it with</p><pre>$toit pkg install github.com/nilwes/HD44780</pre><p>The code for reading the BME280 sensor, writing to the LCD, and publishing data via HTTP can be downloaded from <a href="https://github.com/nilwes/toitglamp">GitHub</a>. The code should be pretty much self-explanatory. Just download it and save the repository to a folder of your choice. Open VSCode and open the folder where you saved the GitHub files.</p><p>In VSCode, if you have installed the Toit extension, you should have a Toit logo in the left menu. If you click this logo, your Toit devices will show up in the list next to the left-hand menu. You can run your code by pressing the “Play” symbol that appears next to the device name (in my case “Huzzah1”) if you hover your mouse over it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GYoYtxqODKuhYG7K" /><figcaption>The Toit extension in VSCode lets you see and control your Toit devices.</figcaption></figure><p>When the code is executed, it should print temperature, humidity, and barometric pressure on the LCD:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aANosKuSEEb8sGww" /></figure><blockquote>Pro Tip: You can also run your code from your command line by typing:</blockquote><blockquote>&gt;&gt;toit device -d MyDeviceName run glamp.toit</blockquote><p>In order to get repeated sensor readings, we will use the yaml-file glamp.yaml(also included in the GitHub repository you downloaded) that will trigger the program to run at certain intervals. If we look in the yaml-file we’ll see that it is set up so that the Toit application will run (1) when the ESP32 reboots, (2) when we initially install the application, and (3) subsequently it will run every five minutes.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528255%252C255%252C255%252C1%2529%26t%3Dmaterial%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D18px%26lh%3D132%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dname%25253A%252520%2527ToitGlamp%2527%25250Aentrypoint%25253A%252520glamp.toit%25250Atriggers%25253A%252520on_boot%25253A%252520true%25250Aon_install%25253A%252520true%25250Aon_interval%25253A%2525205m%25250A&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528255%25252C255%25252C255%25252C1%252529%26t%3Dmaterial%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D18px%26lh%3D132%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dname%2525253A%25252520%252527ToitGlamp%252527%2525250Aentrypoint%2525253A%25252520glamp.toit%2525250Atriggers%2525253A%25252520on_boot%2525253A%25252520true%2525250Aon_install%2525253A%25252520true%2525250Aon_interval%2525253A%252525205m%2525250A&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7aff5fa31cf6416a5fd7765882f544c7/href">https://medium.com/media/7aff5fa31cf6416a5fd7765882f544c7/href</a></iframe><p>To deploy your application using your yaml-file, press the symbol with multiple “Play” symbols next to your Toit device:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*ot5iQNfmj2ijAfdnCNrB1w.png" /></figure><blockquote>Pro Tip: You can also deploy your app from your terminal by typing:</blockquote><blockquote>&gt;&gt;toit device -d MyDeviceName deploy glamp.yaml</blockquote><p>You can leave this app running on your ESP32. In the next step we’ll set up your database that will catch all data it generates!</p><h3>On the receiving side</h3><p>On the server-side we need to set up the PHP script that will <em>receive</em> the data from the ESP32, the MySQL database that will <em>store</em> our data, and Grafana that will <em>display</em> our data. Let us start with the MySQL setup.</p><h4>MySQL database setup</h4><p>Log in to MySQL in a terminal. Then use the following MySQL commands to create a database called THPDatabasethat contains a table called THPData:</p><pre>MariaDB [(none)]&gt; create database THPDatabase;</pre><pre>MariaDB [(none)]&gt; use THPDatabase;</pre><pre>MariaDB [THPDatabase2]&gt; CREATE TABLE THPData (Time TIMESTAMP, Temp VARCHAR(20), Hum VARCHAR(20), Press VARCHAR(20));</pre><p>You now have an empty table with four columns: Time , Temp , Hum , and Press</p><p>Now it is time to write the PHP script that will receive the data from your Toit ESP32 via HTTP, and insert it into this database table.</p><h4>PHP script</h4><p>Grab the file insert.php that you fetched from GitHub, and move it into your HTML root folder (probably /var/www/html). <strong>NOTE: You need to enter your MySQL database credentials into the PHP script</strong>:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528255%252C255%252C255%252C1%2529%26t%3Dmaterial%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D18px%26lh%3D132%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%252524servername%252520%25253D%252520%252522localhost%252522%25253B%25250A%252524username%252520%25253D%252520%252522mySqlUsername%252522%25253B%25250A%252524password%252520%25253D%252520%252522mySqlPassword%252522%25253B%25250A%252524dbname%252520%25253D%252520%252522THPDatabase%252522%25253B&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528255%25252C255%25252C255%25252C1%252529%26t%3Dmaterial%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D18px%26lh%3D132%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%25252524servername%25252520%2525253D%25252520%25252522localhost%25252522%2525253B%2525250A%25252524username%25252520%2525253D%25252520%25252522mySqlUsername%25252522%2525253B%2525250A%25252524password%25252520%2525253D%25252520%25252522mySqlPassword%25252522%2525253B%2525250A%25252524dbname%25252520%2525253D%25252520%25252522THPDatabase%25252522%2525253B&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cabc1f9196c26884ee612e3b08d0936e/href">https://medium.com/media/cabc1f9196c26884ee612e3b08d0936e/href</a></iframe><p>Go back to your MySQL command prompt, make sure your database is selected, and print all rows in the table THPData:</p><pre>MariaDB [THPDatabase]&gt; SELECT * FROM THPData;</pre><p>This should present a few lines with data that has been sent from your Toit application on your ESP32 since you deployed it earlier in this tutorial:</p><pre>+ — — — — — — — — — — -+ — — — + — — — + — — — — — +</pre><pre>| Time | Temp | Hum | Press |</pre><pre>+ — — — — — — — — — — -+ — — — + — — — + — — — — — +</pre><pre>| 2021–10–28 19:11:28 | 26.4 | 36.6 | 101556.2 |</pre><pre>| 2021–10–28 19:11:58 | 26.4 | 36.6 | 101561.6 |</pre><pre>| 2021–10–28 19:12:29 | 26.4 | 36.6 | 101554.6 |</pre><pre>| 2021–10–28 19:12:59 | 26.3 | 36.6 | 101559.0 |</pre><pre>+ — — — — — — — — — — -+ — — — + — — — + — — — — — +</pre><pre>4 rows in set (0.001 sec)</pre><p>Now it is time for the last step in the process. Displaying your data in a fancy way in Grafana!</p><h4>Set up Grafana</h4><p>Open Grafana in your browser by entering the IP to your computer followed by the port 3000, like so:</p><pre><a href="http://x.x.x.x:3000/">http://x.x.x.x:3000/</a></pre><p>Log in and go to “Data Sources” under “Configuration”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mLF0MNLbcyjU-IrY" /></figure><p>Click “Add data source” and search for MySQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lS-k1c-CPpeV8whw" /></figure><p>Click “Select” and enter the name of your database and your MySQL credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lLMap2JOAzAgthpS" /></figure><p>Finally, at the bottom of the page, press “Save &amp; Test”. Grafana now tries to connect to your database and gives an OK message if everything works fine. Your Grafana setup should now be complete.</p><p>To create a new dashboard, click the plus-sign in Grafana and click “Add an empty panel”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qJL1iQJl7QNviTTg" /></figure><p>In order to pull data from your database into Grafana you can enter MySQL queries by pressing the pencil button to the right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v6T3_CTpnBzr9-hY" /></figure><p>In the SQL text field, paste the following MySQL query:</p><pre>SELECT</pre><pre>  UNIX_TIMESTAMP(Time) as “time”,</pre><pre>  CONVERT(Temp, FLOAT) as Temperature</pre><pre>from THPData</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CB-dX-NVLlAS544j" /></figure><p>When you click outside the SQL text field, the data should be immediately pulled from your database and presented in a graph. <strong>NOTE: You might have to change the time span (x-axis) of the graph to see your data:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X71S19wP0PNkILsW" /></figure><p>Click apply and voilà, you have your first graph showing temperature readings from your ESP32 running Toit. To create graphs for humidity and barometric pressure you simply have to add two new panels and paste the following MySQL queries, just like you did before:</p><p>For humidity:</p><pre>SELECT</pre><pre>  UNIX_TIMESTAMP(Time) as “time”,</pre><pre>  CONVERT(Hum, FLOAT)</pre><pre>from THPData</pre><p>For barometric pressure:</p><pre>SELECT</pre><pre>  UNIX_TIMESTAMP(Time) as “time”,</pre><pre>  CONVERT(Press/100, FLOAT)</pre><pre>from THPData</pre><p>The result could look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GfOhy3gqThGdWFggSf9aHg.png" /><figcaption>It is easy to create beautiful dashboards in Grafana!</figcaption></figure><h3>Fine-tuning your Toit device</h3><p>Currently, the device is set to be online all the time and send data every five minutes. But going online consumes lots of power! If you are powering your ESP32 from a battery, you can increase battery life dramatically by changing how often your ESP32 should go online. This is easily done from your Toit console by going to the “Configuration” tab of your Toit device, and changing the “Max offline” parameter from 0s to, say, 30 minutes, i.e. 30m . Your application will still collect sensor data every five minutes, but the ESP32 will only go online every 30 minutes to offload this data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWxxq9LTC6VOE6YjfG9siQ.png" /><figcaption>Configuration tab in the Toit console</figcaption></figure><blockquote>Pro Tip: Under the device Configuration tab you can also sett logging levels to further tweak the amount of data your device produces.</blockquote><p>Being able to configure how often — or rather how seldom — a device should be online is one of the key strengths of the Toit platform, enabling devices to run on batteries for years. Instead of having to include connectivity as one task of many in a single program, it is handled by the platform, and configured with just a click in the console. The apps you develop focus only on the task at hand: Measuring data, triggering an actuator, or maybe sending an MQTT message.</p><h3>Summary</h3><p>The LAMP stack has been around for years, and with the combination of Toit and Grafana it becomes a fantastic system for easy set-up of an IoT application.</p><p>Want to keep going? Got an idea for an IoT project? Why not check the list of drivers that are included in our <a href="https://pkg.toit.io/">package registry</a>, or reach out to our team directly at <a href="/service/mailto:contact@toit.io">contact@toit.io</a> to get help writing your own. We’re also always open for a chat at <a href="https://toit-chat.slack.com/join/shared_invite/zt-t27ohk3m-UZyxtKz7kIp2TRth5P3jeg#/shared-invite/email">chat.toit.io</a>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ceea3VlJlJyBceHLntDkgA.jpeg" /><figcaption>ESP32 running Toit with a 1602 LCD and BME280 sensor.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8edd4897f42" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-toit-take/a-really-toit-glamp-server-d8edd4897f42">A really Toit GLAMP server</a> was originally published in <a href="https://medium.com/the-toit-take">The Toit Take</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IoT Catalyst gets Toit in 20 days]]></title>
            <link>https://medium.com/the-toit-take/iot-catalyst-gets-toit-in-20-days-6a8b5add9df1?source=rss-57207bf107f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a8b5add9df1</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[iotcatalyst]]></category>
            <category><![CDATA[toit]]></category>
            <dc:creator><![CDATA[Nils Westerlund]]></dc:creator>
            <pubDate>Fri, 15 Oct 2021 07:41:15 GMT</pubDate>
            <atom:updated>2021-11-10T10:57:40.244Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>In only 20 days, Toit enabled IoT Catalyst to open a new market segment by offering customers </em>low-code functionality on low-cost and low-power hardware<em>.</em></h4><p><a href="https://www.fairwindsdigital.it/">Fair Winds Digital</a> is an Italian company founded in 2017, and they have already gained some serious traction in the IoT market with customers like <a href="https://www.olivetti.com/en">Olivetti</a>, <a href="https://www.ascotinternational.com/">Ascot Industries</a>, and <a href="https://www.siram.veolia.it/">Siram Veolia</a>. Fair Winds Digital has developed an easy-to-use platform called <a href="https://www.iotcatalyst.com/index">IoT Catalyst</a> that facilitates quick development of IoT solutions. Building an IoT solution with IoT Catalyst is done using a low-code approach directly in the web browser. Up until now, IoT Catalyst has been focused on hardware capable of running a Python interpreter, for example the ubiquitous Raspberry Pi. Today, more than 20,000 edge devices are powered by IoT Catalyst.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tnNCaTDc43jSpJtdDx8-UQ.png" /></figure><h4><strong>Power vs. cost</strong></h4><p>The ease-of-use and computational power that IoT Catalyst offers enable users to quickly build containerized applications directly on the IoT edge device, close to the sensors and the physical world. However, this functionality typically requires computational power, and computational power comes at a price, both regarding hardware and amount of data. Some IoT applications are simply better suited to be run on small, cheap, and power-efficient devices. But here is the conundrum: How do you keep the ability to maintain the high abstraction level that comes with IoT Catalyst if your target hardware is a $2 microcontroller with 520KB of RAM and only a few megabytes of flash memory?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWpL2od5oyrRtuykLkefxw.png" /></figure><h4><strong>A perfect match</strong></h4><p>I met the CEO of Fair Winds Digital, Michael Prisco, at a convention in London a few weeks ago, and it did not take long before we understood that Toit could become an important piece of the IoT Catalyst ecosystem. Just like IoT Catalyst, Toit offers containerized applications that may be dynamically installed and uninstalled over the air. However, Toit achieves this on small, cheap, and power-efficient microcontrollers. Toit was a perfect match for the users of IoT Catalyst asking for IoT solutions requiring lighter hardware while retaining all the benefits of IoT Catalyst.</p><h4><strong>From idea to integration in 20 days</strong></h4><p>The development team behind IoT Catalyst immediately got to work, and in only four weeks they were able to integrate Toit seamlessly into their workflow. Customers using IoT Catalyst are now able to choose which class of hardware their IoT application should run on, and regardless of their choice, they are able to build applications in exactly the same way as they are used to. IoT Catalyst 3.0 with Toit will be launched shortly, and you can read more about it at <a href="https://www.iotcatalyst.com/index">https://www.iotcatalyst.com/</a>.</p><p>If you would like to try out Toit, just sign up on <a href="http://toit.io/">toit.io</a> or reach out to the sales team directly at <a href="/service/mailto:contact@toit.io">contact@toit.io</a>. And we’re always up for a chat at <a href="http://chat.toit.io/">chat.toit.io</a>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q87eNjBDirySy4LyWthHng.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a8b5add9df1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-toit-take/iot-catalyst-gets-toit-in-20-days-6a8b5add9df1">IoT Catalyst gets Toit in 20 days</a> was originally published in <a href="https://medium.com/the-toit-take">The Toit Take</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What you need to know about microcontrollers]]></title>
            <link>https://medium.com/the-toit-take/what-you-need-to-know-about-microcontrollers-5fabd6d5b019?source=rss-57207bf107f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fabd6d5b019</guid>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[mcu]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Nils Westerlund]]></dc:creator>
            <pubDate>Mon, 12 Jul 2021 07:23:54 GMT</pubDate>
            <atom:updated>2021-07-16T05:31:57.452Z</atom:updated>
            <content:encoded><![CDATA[<p>“Computers are everywhere!” is a statement that is almost literally true. I’m writing this blog post on a computer, while drinking a cup of coffee made by a coffee machine that contains a computer. I just brushed my teeth using an electric toothbrush that is controlled by a computer, and to get some peace and quiet I just turned off my TV set using my remote control that also contains a computer. Before I even have had lunch, I have engaged with another five or six different devices containing some sort of computer. However, the term “computer” is a very, very wide concept. Obviously, my coffee machine computer cannot be used for word processing. And unfortunately, my laptop cannot make coffee. So what kind of weird little computers are used to control these coffee machines and toothbrushes? This post is an attempt to clarify this.</p><h3>So what’s a computer…really?</h3><p>The term “computer” is a very broad description of a hardware-software combination that can take on many different forms, and the number of three-letter abbreviations related to computers is huge. To clarify this vast amount of different abbreviations we use in the world of computers, we first need a basic understanding of how a computer is typically constructed. More or less all computers, regardless of their physical shape or name, have the same basic structure: the so-called von Neumann architecture.</p><ol><li>It uses the Central Processing Unit (CPU) to fetch data and instructions from the Random Access Memory (RAM) memory unit to execute commands. RAM is a volatile primary memory that is cleared if powered off. Temporary data is stored in registers that can be quickly accessed by the CPU.</li><li>The CPU may also store temporary results in RAM but it stores “permanent” data on a separate memory, typically a non-volatile, secondary storage, like an SSD or flash disk that preserves data even if power is lost.</li><li>As the name implies, the Arithmetic-Logic Unit (ALU) is responsible for performing additions, subtractions, and logic operations like AND, NOT, OR, and XOR.</li><li>The control unit controls the operation of the computer’s ALU, memory, and input/output devices, telling them how to respond to the program instructions it has just read and interpreted from the RAM.</li><li>The computer communicates with the surrounding world (Input/Output or I/O) using some communication unit, for example keyboard and mouse for input, and display and printer for output.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pM_ZfXQEUCLKPV6q5eQjsw.png" /><figcaption>Block diagram of a computer using the von Neumann-architecture.</figcaption></figure><h3>Enter the microcontroller</h3><p>In the beginning of time (i.e., the 1960s), there were CPUs large as refrigerators doing the required calculations in room-sized computers. Different parts of the computer, like memory and input-output, were separated into individual cabinets. Still today, in regular personal computers like laptops and desktops, the CPU, the RAM, the I/O, and the non-volatile memory are usually physically separated on a large motherboard. However, by the 1970s and 1980s, it became possible to squeeze more and more functionality onto a single integrated circuit (IC). Instead of separating modules, these specialized ICs, known as Microcontroller Units (MCUs), combined all functionality into one chip.</p><p>Microcontrollers quickly became ubiquitous in so-called <em>embedded systems</em>. An embedded system typically has a dedicated function within a larger mechanical or electronic system and is embedded as part of a complete device often including electronic hardware and mechanical parts. In other words, think coffee machine and you got it.</p><p>Embedded systems can be found almost everywhere in our modern world. Thermostats, washing machines, cars, passenger airliners, and satellites all rely on embedded systems with microcontrollers. Even your credit card has one! It’s an enormous global market with billions of chips sold every year. Since most embedded systems require relatively little computing power, the ICs can be made highly specialized, smaller, more power-efficient, and of course much, much cheaper. The cheapest microcontroller today actually costs only a couple of US cents!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*RKmpjIIoMc07TSwloId_Hg.png" /><figcaption>One of the smallest and cheapest microcontrollers on the market: the 8-bit PIC 10F200 at a price of a few dollar cents per unit.</figcaption></figure><p>Clearly, a microcontroller is much more restricted than a personal computer when it comes to processing power. But what microcontrollers lack in memory and processing power, they make up for by providing a range of features that makes them perfect for embedded systems, where analog sensors, motors, valves, LEDs, and simple displays are commonly used. A typical microcontroller offers a couple of dozen general-purpose I/O lines (GPIOs) and several methods for communication with hardware. They often incorporate analog-to-digital as well as digital-to-analog converters (DACs and ADCs), and pulse-width modulation (PWM) controllers for motor control. Some even have built-in WiFi and Bluetooth. And all of the above comes at a fraction of the cost compared to a general-purpose CPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*coJq9HxaOjzIjJVNP8Ciyg.png" /></figure><h3>SoCs and SBCs</h3><p>The integration of functionality into a single chip has not stopped with microcontrollers. Today, most smartphones rely on so-called System-on-Chips (SoCs). Apart from CPU, memory, etc., these chips may contain various functionalities crucial for the phone, like machine learning, graphics, and security.</p><p>Another branch in the development of computers comprises the Single Board Computers or SBCs. This “form factor” is exactly what the name implies: a full computer on a single printed circuit board. In other words, just like with a regular PC, the components of the computer are to some extent separated into physical entities, like a Graphical Processing Unit (GPU) and perhaps a separate chip for WiFi/Ethernet, etc. The components are soldered to the board and cannot be exchanged or upgraded like in regular PCs. To make things even more confusing, many SBCs use SoCs to add functionality. SBCs usually run some lightweight Linux distribution with a graphical user interface and can be hooked up to a monitor and even used as a low-cost personal computer. The most well-known example of an SBC is the Raspberry Pi, released in 2012. By May 2021, 40 million Raspberry Pi computers had been sold, which makes this device one of the most popular computers ever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LnX4ddZHGfmd4_bD" /><figcaption>One of the world’s most popular computers: the Raspberry Pi.</figcaption></figure><p>The increasing integration of functionality on single chips has clearly blurred the lines between different types of computers, and therefore it is quite difficult to categorize different types of hardware. The table below is an attempt to clarify the terms commonly used in embedded systems, IoT, etc. Note that the definitions of some of the terms are slightly vague and there is some overlap between some of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAh9zppF_FMQvotLy5IhtQ.png" /></figure><h3>Key properties of a microcontroller</h3><p>Often the term “core” is used when discussing microcontrollers and computers in general. The CPU/microprocessor inside a microcontroller contains one or more CPUs, or cores. These cores can be built using different so-called architectures that are usually licensed to manufacturers of microprocessors. There are several architectures available:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5x1KOOoDFVdInt63E9soA.png" /></figure><p>As of 2021, most personal computers, laptops, and game consoles sold are based on the x86 architecture, while mobile categories such as smartphones or tablets are dominated by ARM architecture. ARM is also dominant in the world of microcontrollers.</p><h3>Words, RISCs, and megahertz</h3><p>When discussing microcontrollers and their cores, one feature is pretty much always stated: the word length. In addition to that, the architecture can be of two main types: RISC and CISC, and different microcontrollers operate at different clock speeds. Below is a brief explanation of these three characteristics.</p><h4>Word length</h4><p>In computing, a <em>word</em> is the natural unit of data used by a particular processor design, measured in bits. In other words, the word size (or “word width”, or “word length”) refers to the number of bits processed by a computer’s CPU in one go. The number of bits in a word is an important characteristic of any specific processor design or computer architecture. Common word lengths are 8-bit, 16-bit, 32-bit, and 64-bit. Today, typically, a shorter word length indicates a weaker processor. E.g. the 6502 microprocessor used in the famous Commodore 64 personal computer from the 1980s was an 8-bit device, and still today 8-bit microprocessors are being used when computational power is not critical, or if low price is essential. As a comparison, a modern PC/Mac uses 64-bit word length microprocessors that can cost hundreds of US dollars.</p><h4>RISC and CISC</h4><p>A RISC architecture means that there are few and very simple low-level instructions built into the microcontroller, compared to a CISC architecture in which a single instruction can perform more complex tasks. In other words, with RISC, more instructions are needed to accomplish a specific task, compared to CISC. As always, there are pros and cons to both architectures, but in general CISC architectures are typically used in regular computers, whereas RISC architectures have widespread use in smartphones, tablets, and embedded devices.</p><p>One alternative to RISC, RISC-V (“RISC-Five”), was started with a goal to make a practical architecture that was open-sourced, usable academically, and deployable in any hardware or software design without royalties. Also, justifying rationales for each design decision of the project is explained, at least in broad terms. This can be compared to proprietary designs which are well-kept secrets and not revealed without license fees and NDAs.</p><h4>Clock frequency</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*O8v2Rf7IVDnKeN9Kex6YuQ.png" /></figure><p>In computing, the clock frequency, clock speed, or clock rate, typically refers to the frequency at which the clock generator of a processor can generate pulses, which are used to synchronize the operations of its components. In other words, the clock rate is the metronome of the entire system. A bit simplified, one can say that for each tick of this metronome, one computer instruction can be executed. Hence the clock rate is crucial for the execution speed of the CPU at hand. So why don’t we just crank up the speed to increase execution speed? Well, first of all, the reliability decreases with higher clock rates, and too high clock rates will eventually crash the whole system. In addition, higher clock rates consume more power and could potentially cause overheating of the chip causing a catastrophic malfunction of the hardware. A microcontroller typically is rated to be used at a certain clock speed. Higher speeds than the rated might be possible but might also affect the stability of the system. As an example of clock rates, microcontrollers operate at rates from a few hundreds of kHz up to several hundreds of MHz, whereas the CPU in my Macbook Pro ticks at two GHz, i.e. two billion ticks per second.</p><h3>Manufacturers of MCUs, SoCs, and microprocessors</h3><p>Giving a comprehensive overview of available microcontrollers, SoCs and Microprocessors is not a feasible task, since there are thousands of models being manufactured. Nevertheless, for clarity, the table below shows a select number of microcontrollers, SoCs, and Microprocessors and their corresponding core architectures, as well as some examples of where they are being used:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAxbXe9mevkUtDAWyrc4xg.png" /></figure><h3>ARM</h3><p>Since ARM is the most commonly encountered core architecture, it motivates a brief overview. ARM produces a multitude of different microprocessor cores, and not all are relevant to cover in this post. The ARM product line that is typically used in embedded systems is the Cortex-M. The ARM Cortex-M is a group of 32-bit RISC processor cores. These cores are optimized for low-cost and energy-efficient integrated circuits, which have been embedded in tens of billions of consumer devices. The Cortex-M family includes Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4, and Cortex-M7 along with a few newer models.</p><h3>Espressif</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*h5sBuRu1yI15n7Kf.jpg" /><figcaption>An ESP32 development kit with exposed pins and USB connector.</figcaption></figure><p>Back in 2014 a new microcontroller from China, called ESP8266, started to gain attention in the western parts of the world. The ESP8266 was a low-cost WiFi-enabled microcontroller produced by Espressif Systems in Shanghai. The ESP8266 was often used as gateway to get other microcontrollers online, but it did not take long until users realized it could be used stand-alone. The ESP8266 has now been succeeded by the ESP32 which has increased capabilities, but still at a low price point. It features 520 KiB RAM, up to 4 MiB on-chip flash memory, and operates at 240 MHz. It is built using the open RISC-V architecture. The ESP32 is available in numerous so-called development kits that make experimenting and tinkering with the ESP32 very straightforward. For this reason, the chip has become very popular within the maker community and it is also used in production for several larger manufacturers of HW such as Philips, Techbase, and Sonoff. Since the initial release Espressif has shipped a huge amount of ESP32 chips all over the world: the numbers are in the hundreds of millions in total.</p><h3>Summary</h3><p>From the conception of the digital computer up until today, integration and miniaturization of hardware have been tremendous. Over the years, completely new types of chips have been developed combining different functionality on a single silicon die. This has blurred the lines between concepts that previously were clearly distinct: a $2 microcontroller of today may contain enough functionality and processing power to allow it to function almost like a regular computer, receiving data from various sensors, controlling the physical world with actuators, perform advanced computing and multitasking, and report data both secure and fast to the end-user for further analysis. There are a few big players on the market, ARM being one of them, but chip manufacturers like Espressif have recently developed microcontrollers that fulfill a broad spectrum of needs from both professionals and makers, while still keeping quality at a high level and the chip cost at a minimum.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fabd6d5b019" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-toit-take/what-you-need-to-know-about-microcontrollers-5fabd6d5b019">What you need to know about microcontrollers</a> was originally published in <a href="https://medium.com/the-toit-take">The Toit Take</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cellular connectivity for IoT]]></title>
            <link>https://medium.com/the-toit-take/cellular-connectivity-for-iot-78dfe2026720?source=rss-57207bf107f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/78dfe2026720</guid>
            <category><![CDATA[lorawan]]></category>
            <category><![CDATA[lpwan]]></category>
            <category><![CDATA[5g]]></category>
            <category><![CDATA[sigfox]]></category>
            <category><![CDATA[cellular-iot]]></category>
            <dc:creator><![CDATA[Nils Westerlund]]></dc:creator>
            <pubDate>Wed, 09 Jun 2021 08:32:17 GMT</pubDate>
            <atom:updated>2021-06-09T18:49:01.383Z</atom:updated>
            <content:encoded><![CDATA[<p>Without connectivity, there is no Internet of Things. Only a few years back, getting an IoT device online was both complicated and costly. However, the drop in price and general availability of internet-enabled microcontrollers have spawned a vast number of IoT solutions in a wide range of business verticals. Applications range from self-driving cars with huge amounts of data being sent continuously over high-speed networks, to miniature sensor modules sending a few bits of data a few times a week and lasting a decade on a small battery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgMNVqH902cg6UMUgGoXuw.png" /></figure><p>One might think that a standard WiFi connection would be the best for an IoT application. After all, WiFi seems to be ubiquitous today, offering stable connections with data throughput in the gigabit range. However, WiFi networks suffer from a severe drawback: the reach of a WiFi network is very limited (under ideal conditions around 100 m). An alternative could be <a href="https://en.wikipedia.org/wiki/Bluetooth_Low_Energy">Bluetooth Low Energy</a> (BLE). Unfortunately, BLE has pretty much the same limitations regarding reach as WiFi: about 100 m under ideal conditions. As we will see, there are also other options like <a href="https://en.wikipedia.org/wiki/Sigfox">Sigfox</a> and <a href="https://en.wikipedia.org/wiki/LoRa#LoRaWAN">LoRaWAN</a>, but these offer very slow data transfer speeds and long latencies. So what is the alternative?</p><h3>Why cellular IoT?</h3><p>Cellular IoT uses existing cellular networks to connect physical devices to the Internet, i.e., the same type of networks our smartphones use to communicate. Cellular IoT relies on 2G, 3G, 4G, and more recently also 5G and Low Power Wide Area Networks (LPWAN) technologies such as LTE-M and NB-IoT to transmit and receive data. Cellular IoT is one of the most <a href="https://www.ericsson.com/en/reports-and-papers/white-papers/cellular-networks-for-massive-iot--enabling-low-power-wide-area-applications">reliable and accessible</a> ways to enable Internet connectivity for manufacturers building IoT devices. These cellular networks are available almost everywhere and there are some very nice advantages in using them:</p><ul><li>They provide excellent coverage</li><li>They simplify global deployment</li><li>They work right out of the box</li><li>They support both low and high bandwidth</li><li>Cellular networks built for IoT offer functionality to save power</li></ul><h3>Modems, SIM cards, and frequency bands</h3><p>Before we dive into the plethora of available cellular networks there are a couple of concepts we need to sort out, namely cellular modems, SIM cards, and frequency bands. Typically, an IoT solution is built using some sort of microcontroller or Single Board Computer. To enable this hardware to communicate with a cellular network, a communication modem and a SIM card are needed. The traditional physical SIM cards have been around for decades, but more recently these have begun to be replaced by an electronic variant, called eSIM. Instead of inserting a physical SIM card into your communication device (i.e., your phone or IoT device), you install a SIM profile through software from your preferred network operator on your device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NN3UlrWDBCYrHiPL5eCACQ.jpeg" /></figure><p>While the SIM card you choose determines which cellular provider’s networks you can access, the modem you select impacts which <em>network</em> <em>types</em> and <em>frequency bands</em> your device can connect to. A frequency band is a range of frequencies within the radio frequency spectrum, which goes from 30 Hz to 300 GHz. Higher data rates typically require higher frequencies, but higher frequencies also imply poorer signal range and penetration, e.g., through solid objects like walls. Cellular networks use a fraction of the spectrum between 800 MHz and 5 GHz for 2G, 3G, and 4G connections whereas 5G can use bands up to 35 GHz. In practice, this means that a cellular modem is built for specific frequency bands and cannot communicate on other frequencies.</p><h3>The cellular networks of today</h3><h4>2G/3G</h4><p>The two oldest, digital cellular networks are the 2G/3G standards released in the 90s and 00s, respectively. These two technologies have worked well for many IoT applications, offering a data rate of a few kbit/s and thus allowing devices to transmit basic alerts, status updates, and location data while using relatively little power. However, 2G/3G networks will soon be a thing of the past and operators are beginning to shut down these networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTk9QzCXR_McR2-svmOOdA.jpeg" /></figure><h4>4G LTE</h4><p>Most modern cellular phones today connect to the 4G network, which offers significantly increased data rates compared to its predecessors. 4G theoretically offers 50/100 Mbit/s up/down, a figure that only a few years ago was reserved for WiFi. This data rate opened up a whole new universe of possibilities, including video live streaming and vehicle entertainment.</p><h4>5G</h4><p>The 5G cellular network is sometimes dubbed as the future of IoT connectivity. When it comes to data-intensive applications where speed is crucial, for example, self-driving cars, that is without a doubt true: 5G networks can offer nearly real-time data transmission from ~50 Mbit/s to over a Gbit/s which is on par with a cabled internet connection. In addition, 5G networks can maintain a stable connection with devices moving at very high speeds.</p><p>However, speed is not always the most important feature of an IoT cellular network. Power consumption is often just as important as data transfer speeds. The cellular networks described so far were never intended for the type of infrequent network connections and small data transmissions that an IoT device would do: phones connected to these networks are always checking for incoming calls, are always listening to radio signals, and send periodic information about location. This of course consumes lots of power, at least seen from an IoT device point of view. Enter LPWANs!</p><h3>Cellular LPWAN</h3><p>The Low Power Wide Area Networks for cellular connectivity include NB-IoT (Narrow Band-Internet-of-Things) and LTE-M (Long Term Evolution-Machine Type Communication) and these network types are tailor-made for IoT. Both NB-IoT and LTE-M actually cover a number of different categories with slightly different names but with the same basic underlying technology. Both LTE-M and NB-IoT are evolving technologies: the latest categories, LTE Cat M2 and LTE Cat NB2, are already deployed, fully functional, and offer global roaming. For a more comprehensive list of different network categories, this <a href="https://www.ericsson.com/en/blog/2016/2/cellular-iot-alphabet-soup">blog post</a> might help.</p><p>From a technical perspective (outside the scope of this article), the two network types operate in different frequency bands. However, from the user’s perspective, the greatest differences are related to data rates and latency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*SN3h2lTGtqmdRjuJUgy_Tw.png" /><figcaption>Overview of cellular communication technologies for IoT applications.</figcaption></figure><p>Both standards add one thing that is crucial for IoT devices: power saving. This is thanks to a combination of two important features, namely a Power Saving Mode (PSM) that allows the cellular modem to sleep for longer times without losing network connection, and a so-called Discontinuous Reception (DRX) functionality that allows the modem to listen for pending data without having to establish a full network connection. These additions have resulted in devices that may run up to 10 years on battery even though they go online at regular intervals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0DRNtTfd-C3bcw4NnpmIaw.jpeg" /><figcaption>Telematics is a common cellular use case</figcaption></figure><p>It is also worth mentioning that even though LTE-M-based networks require more power than NB-IoT-based networks while transmitting, LTE-M-based networks can still be more <a href="https://jussi-ratilainen.medium.com/nb-iot-vs-lte-m-in-practice-1f7beeaa16c6">power-efficient</a> simply since the transmission goes faster and the latency is significantly lower than the NB-IoT-based networks. In addition, LTE-M can handle connected devices that move around. With NB-IoT, the device needs to reselect cells as it travels, but with LTE-M that isn’t the case. Hence, NB-IoT is less suited for mobile applications like vehicles.</p><p>The subscription cost has also evolved. Today, an IoT device can connect to a cellular network using a subscription that costs only a few dollars for the entire lifetime of the product.</p><p>To sum up, the choice between an NB-IoT-based network and an LTE-M-based network boils down to the use case at hand. If battery life and good signal penetration are crucial and low data rate acceptable, an NB-IoT-based network might be the preferred choice. If higher data rates are needed — possibly at the expense of battery life — and signal penetration is not crucial, an LTE-M-based network could be suitable.</p><p>So what are the alternatives to these standardized cellular networks? Well, there are only a couple of alternatives, and they differ in many ways compared to regular cellular networks.</p><h3>Sigfox</h3><p><a href="https://en.wikipedia.org/wiki/Sigfox">Sigfox</a> is the name of a French global network operator founded in 2010 that builds wireless networks to connect low-power objects such as electricity meters and smartwatches which need to be continuously on and emit small amounts of data. The Sigfox technology utilizes the license-free so-called ISM band (868 MHz in Europe) that typically is used for baby monitors, garage openers, microwave ovens, and other consumer electronics. It’s a wide-reaching signal that may pass freely through solid objects. The Sigfox device communicates with a base station that is operated by Sigfox so in that sense it resembles a classic cellular setup. Sigfox is focused on conserving energy, and the data rates available are hence quite low: a maximum of 140 messages per day may be sent and they may only contain 12 bytes uplink and 8 bytes downlink. This is of course only a minute fraction of the data amount that can be sent via a cellular connection; 140 messages at 12 bytes each corresponds to about 1.7 KB per day, compared to e.g., an NB-IoT connection that could theoretically transmit 20 KB (159 kbit/s) <em>per second</em>.</p><p>Sigfox as a company has gained traction. At the time of writing, they employ 400 people and their IoT network has covered a total of 72 countries reaching 1.3 billion of the world population.</p><h3>LoRaWAN</h3><p><a href="https://en.wikipedia.org/wiki/LoRa">LoRaWAN</a> is not using cellular technology in any way. Instead, the technology uses the same license-free frequency bands below 1 GHz as Sigfox does. LoRaWAN-devices always communicate with a gateway in a star-topology and the gateway collects data and typically forwards it to a cloud service. The user can set up his own gateway and server for communication and with this setup, there are no data costs to this communication solution as in the case with Sigfox and cellular communication. The distance between gateway and a LoRaWAN device can be great; up to 10–15 km depending on conditions. However, the data rates are very low at a rate of 0.3–27 kbit/s depending on settings. As you probably noted, if LoRaWAN data rate is pushed to its maximum, it is on par with the slowest type of NB-IoT. This limits the use cases to very simple data transmissions. Nevertheless, LoRaWAN is suitable for remote locations where regular cellular connectivity is not available and where demands on data rates are low.</p><h3>Summary</h3><p>Cellular connectivity for IoT is a simple and efficient way of getting your IoT devices online. There are several advantages compared to a standard WiFi setup. Cellular connectivity offers both great coverage and building penetration and supports both high and low data rates depending on the user’s needs. The latency of a cellular network for IoT communication can be as low as 10–15 ms and data throughput up to 7 and 4 Mbit/s for uplink and downlink, respectively. In addition, tailor-made IoT network technologies like NB-IoT and LTE-M are very power efficient. There are several available cellular modems on the market and the prices are declining.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78dfe2026720" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-toit-take/cellular-connectivity-for-iot-78dfe2026720">Cellular connectivity for IoT</a> was originally published in <a href="https://medium.com/the-toit-take">The Toit Take</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consibio chooses Toit to optimize bioprocesses]]></title>
            <link>https://medium.com/the-toit-take/consibio-chooses-toit-to-optimize-bioprocesses-794f6bda6d3d?source=rss-57207bf107f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/794f6bda6d3d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[bioengineering]]></category>
            <dc:creator><![CDATA[Nils Westerlund]]></dc:creator>
            <pubDate>Tue, 16 Mar 2021 08:52:26 GMT</pubDate>
            <atom:updated>2021-06-03T09:58:49.124Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="http://toit.io/">Toit</a> customer <a href="http://consibio.com/">Consibio</a> brings unique biology and technology expertise together, enabling companies across the bio-industry to minimize their impact on the environment. They are building their products on the Toit platform to reduce their time to market, enhance their flexibility and even reach new customers for which implementation of IoT devices was not possible before Toit.</h4><p>Biological processes are notoriously complex and difficult to control. The three founders of Consibio are on a mission to rethink these industries with data and biological insight. With a background in biotech-engineering, they know the bioprocess industry can tweak its methods to optimize biological process yields while reducing its environmental impact.</p><blockquote>“Our mission is to change the world by digitalizing bio-industries dedicated to reaching the UN Sustainable Development Goals” — Consibio</blockquote><figure><img alt="The three Consibio founders Johan, Emil and Søren in action. Credits: Lars Kruse" src="https://cdn-images-1.medium.com/max/1024/1*46DNyY_tUwpviVVsuz21xQ.png" /></figure><p><em>The three Consibio founders Johan, Emil and Søren in action. Credits: Lars Kruse</em></p><p>Optimization of bioprocesses can only be achieved through relevant data acquisition and analysis. To this end, Consibio builds hardware customized to the data that needs to be collected and the location where this data needs to be measured. Their hardware always includes a connectivity component so the data collected can be sent to the cloud where it is visualized and analyzed before it becomes actionable.</p><p><strong>Resolving pain points with Toit</strong></p><p>Initially, Consibio was working with a patchwork of IT components: a number of sensors connected to microcontrollers, themselves connected to a Linux gateway working with an established IoT platform that ensured connectivity to the cloud. All these different units had to be programmed using various languages such as Python, NodeJS, C and C++. And while it was possible to update the gateway from the cloud infrastructure, it was not possible to update the sensors connected to this gateway.</p><p>This layered infrastructure was not only expensive to maintain, but the connectivity gateway also created a bottleneck for the operation of sensors deployed in the field, rendering scaling up nearly impossible.</p><p>Consibio quickly realized that the Toit platform for IoT was addressing all their pain points:</p><ul><li>With Toit, the connectivity to the cloud is already included in each individual device. This operating system can be deployed on an ESP32 and used for managing all other components hooked to the microcontroller. There is no need for a costly connectivity gateway.</li><li>The high-level and intuitive Toit language can be used to program all components of the newly designed hardware.</li><li>The Toit console helps manage an entire fleet of devices and allows for fast and secure over-the-air updates of some or all of the programs running on each device.</li><li>Individual programs solving different tasks on the device can be installed in parallel, without affecting each other. These programs can be quickly updated independently and remotely as many times as needed.</li><li>Toit is so efficient that it enables working with battery-powered devices, allowing deployment in remote areas.</li></ul><blockquote>“Before Toit, we couldn’t provide battery-powered hardware to our clients. Now we can deliver battery-enabled devices and still maintain the functionalities required to deliver biological insight. Battery-powered devices enable us to expand our potential markets, as they are necessary for implementation in certain remote places.” — Emil Jakobsen, Consibio Co-founder</blockquote><p><strong>Monitoring and tweaking bioprocesses</strong></p><p>Consibio’s engineers got started with Toit using a development kit and realized quickly that the Toit language was very easy to pick up. Shortly after, they were able to deploy 10 Toit-enabled proof-of-concept units in a biofactory that grows insects for sustainable protein production. They are now increasing their fleet of custom-made devices at the farm to make sure that conditions are optimal for insect growth and subsequent protein yield. The system is set to trigger SMS alarms when the temperature and humidity measures fall outside predefined ranges.</p><figure><img alt="Worms for protein production at Enorm Factory." src="https://cdn-images-1.medium.com/max/1024/1*oeeiD3oSwG0IJBg5AYHKAg.png" /></figure><p><em>“Toit provides us with a better way to manage all of the devices — it also enables us to simplify our system by eliminating the need for a connectivity gateway, allowing for real cost optimization of our platform.” - Søren Jessen Kjær, Co-founder Consibio</em></p><p>One other Toit-powered device is acting directly on the bioprocess it monitors: deployed to control for the presence of malodorous air, the device is able to modify the position of an industrial valve that controls the airflow through a biofilter.</p><p><strong>Saving time and money</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQoeEZvliYATcG1lKzuEPg.png" /><figcaption>Moving from a Linux-based setup to Toit came with a long list of benefits for Consibio.</figcaption></figure><p>Hardware costs used to be a big issue for scaling up a profitable business, but since the Toit platform can run on a low-cost microcontroller such as an <a href="https://www.espressif.com/en/products/socs/esp32">ESP32</a>, Consibio’s device prices have been reduced by a factor of 10. This leads to significant benefits for the potential sales volume and profitability, especially since Consibio is in the phase of expanding its business with several thousand devices for bio-industries related to green energy, food and feed production.</p><p>Besides, the time spent on hardware service in the field has been reduced by several hours each month thanks to the level of control that the Toit platform gives Consibio to manage their fleets remotely.</p><p>Furthermore, Consibio explains that before Toit, over-the-air updates used to be much less streamlined; an application update could take up to 15 minutes to deploy. With Toit-enabled devices, it is now done in seconds. This allows Consibio to focus on core activities that add value to their customers.</p><blockquote>“Ultimately Toit enables us to focus on our core services knowing that our entire hardware fleet is in safe hands.” — Johan Egsgaard Thomsen, Consibio Co-founder</blockquote><p>Consibio has several other examples of how their biotech expertise helps improve the environment. If you want to know more about that or other great examples we encourage you to contact Consibio via their website: <a href="https://consibio.com/">consibio.com</a>.</p><p>If you would like to try out Toit just sign up on <a href="http://toit.io/">toit.io</a> or reach out to the sales team directly at <a href="/service/mailto:contact@toit.io">contact@toit.io</a>.</p><p><em>Authors: Céline Materna, Content and UX Research Manager, and Nils Westerlund, Lead Product Manager</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=794f6bda6d3d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-toit-take/consibio-chooses-toit-to-optimize-bioprocesses-794f6bda6d3d">Consibio chooses Toit to optimize bioprocesses</a> was originally published in <a href="https://medium.com/the-toit-take">The Toit Take</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>