<?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>Forem: Sam Woo</title>
    <description>The latest articles on Forem by Sam Woo (@samwoo).</description>
    <link>https://forem.com/samwoo</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%2F3801398%2F37c26b69-1cf6-4bcd-8666-0651521b23fc.png</url>
      <title>Forem: Sam Woo</title>
      <link>https://forem.com/samwoo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/samwoo"/>
    <language>en</language>
    <item>
      <title>Why I Built an Industrial IoT Gateway Using Python and Serverless</title>
      <dc:creator>Sam Woo</dc:creator>
      <pubDate>Mon, 02 Mar 2026 11:16:51 +0000</pubDate>
      <link>https://forem.com/samwoo/why-i-built-an-industrial-iot-gateway-using-python-and-serverless-590</link>
      <guid>https://forem.com/samwoo/why-i-built-an-industrial-iot-gateway-using-python-and-serverless-590</guid>
      <description>&lt;p&gt;Building an industrial IoT platform usually feels like an endless nightmare of fragmented tech stacks. The firmware engineers are writing C++, the backend team is fighting with Docker containers and message queues, and the frontend devs are struggling to render real-time sensor data without crashing the browser. I’ve been there.&lt;/p&gt;

&lt;p&gt;When I set out to build a scalable remote monitoring system, I knew I had to break this cycle. I needed an architecture that was robust enough for industrial environments, yet agile enough to be maintained by a small team. The solution? Dropping the traditional C/C++ monolithic edge daemons and fully embracing a 100% Python Edge + Serverless Backend + React SPA pipeline.&lt;/p&gt;

&lt;p&gt;In this series, I will walk you through the exact architecture that allowed me to securely route bi-directional telemetry and commands (D2C/C2D) from local hardware to a modern web dashboard, cutting development time by 80%. Let's dive into the architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Nightmare of "Traditional" IoT&lt;/strong&gt;&lt;br&gt;
If you’ve ever built a remote monitoring system from scratch, you know the drill:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Edge&lt;/strong&gt;: Firmware engineers spend weeks debugging memory leaks in C/C++ just to maintain a stable MQTT connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Backend&lt;/strong&gt;: The cloud team provisions VMs, sets up custom MQTT brokers, and writes endless boilerplate code for REST APIs to handle device telemetry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Problem&lt;/strong&gt;: It takes months just to get a single temperature value to show up reliably on a web dashboard. And when you try to send a command back to the device (C2D)? Security nightmares and dropped connections await.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We were wasting too much time on infrastructure and not enough time on actual business logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The "Metal to React" Architecture&lt;/strong&gt;&lt;br&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%2Fcq5yx7uw46bp0nhu3juc.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%2Fcq5yx7uw46bp0nhu3juc.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;br&gt;
I decided to nuke the old monolithic approach. The goal was simple: &lt;strong&gt;Zero infrastructure maintenance, 100% focus on features.&lt;/strong&gt; Here is the stack that made it possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Edge Gateway (The Brains)&lt;/strong&gt;: Python on Embedded Linux (Modern SoMs). It reads local sensor data (via MQTT/RS485/CAN) and securely bridges it to the cloud.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IoT Broker (The Traffic Cop)&lt;/strong&gt;: Azure IoT Hub. It handles millions of messages, device provisioning, and most importantly, secure bi-directional communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Backend (The Glue)&lt;/strong&gt;: Python-based Azure Functions. Completely serverless. It scales instantly and requires zero server maintenance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database &amp;amp; Auth&lt;/strong&gt;: Supabase (PostgreSQL). It handles user authentication and gives us real-time capabilities out of the box.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend (The Face)&lt;/strong&gt;: React + Tailwind CSS. A clean, single-page application (SPA) where users can monitor and control devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Why I Dropped C++ for Python on the Edge&lt;/strong&gt;&lt;br&gt;
You might be thinking, "Python on an edge gateway? What about performance?" In the days of low-power MCUs, C++ was mandatory. But today, with powerful SoMs (System on Modules) featuring multi-core CPUs and gigabytes of RAM, the performance overhead of Python is negligible for typical telemetry tasks.&lt;/p&gt;

&lt;p&gt;By switching to Python, we unlocked massive benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Speed of Development&lt;/strong&gt;: What took weeks in C++ (handling JSON parsing, Azure SDKs, and threading) takes hours in Python.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rich Ecosystem&lt;/strong&gt;: Libraries like &lt;code&gt;azure-iot-device&lt;/code&gt; and &lt;code&gt;paho-mqtt&lt;/code&gt; are incredibly stable and easy to implement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Future-Proofing for AI&lt;/strong&gt;: When we eventually want to run machine learning models (Edge AI) for predictive maintenance, Python is already the native language.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Why Serverless + Supabase is the Ultimate Combo&lt;/strong&gt;&lt;br&gt;
If Python on the Edge was my first breakthrough, the backend architecture was the second. I didn't want to manage Docker containers, write custom WebSocket servers, or worry about scaling when 10,000 devices send telemetry at the exact same second.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Middleware (Azure Functions)&lt;/strong&gt;: We use Python-based Azure Functions to act as the secure bridge. It triggers automatically when a message hits the IoT Hub, processes the payload, and goes back to sleep. You only pay for what you use, and it scales infinitely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Database &amp;amp; Realtime (Supabase)&lt;/strong&gt;: Instead of building a complex WebSocket architecture from scratch, we rely on Supabase. The Azure Function simply writes the processed sensor data to a PostgreSQL table in Supabase. Thanks to Supabase Realtime, our React dashboard listens to these database changes and updates the charts instantly at 60FPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No managing servers. No polling the database. It just works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What’s Next in This Series?&lt;/strong&gt;&lt;br&gt;
This overview is just the beginning. Over the next few weeks, I’ll be breaking down every single layer of this architecture into practical, step-by-step guides.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Part 2&lt;/strong&gt;, we will dive deep into the Edge Gateway. I’ll show you exactly how to bridge legacy MCU/RTOS hardware to a modern Python edge daemon using local MQTT, without touching a single line of C++ networking code.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;P.S. A quick question for the community&lt;/strong&gt;:&lt;br&gt;
I’m currently thinking about extracting this exact architecture into a reusable "Edge-to-Cloud Boilerplate" (Python Edge + Azure Functions + Supabase + React) so others can skip the weeks of infrastructure setup.&lt;/p&gt;

&lt;p&gt;Would a plug-and-play template like this be useful for your projects? Let me know your thoughts in the comments below! 👇&lt;/p&gt;

</description>
      <category>iot</category>
      <category>python</category>
      <category>architecture</category>
      <category>serverless</category>
    </item>
  </channel>
</rss>
