<?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 Mario Daniel Corzo on Medium]]></title>
        <description><![CDATA[Stories by Mario Daniel Corzo on Medium]]></description>
        <link>https://medium.com/@mariocorzo?source=rss-454deb9781a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bENznMs5Kiw4iDqdQz199A.jpeg</url>
            <title>Stories by Mario Daniel Corzo on Medium</title>
            <link>https://medium.com/@mariocorzo?source=rss-454deb9781a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:45:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mariocorzo/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[BLE + Flutter for Environmental Monitoring: Lessons from a Real Project]]></title>
            <link>https://medium.com/@mariocorzo/ble-flutter-for-environmental-monitoring-lessons-from-a-real-project-5911b596355f?source=rss-454deb9781a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5911b596355f</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ble]]></category>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[lessons-learned]]></category>
            <dc:creator><![CDATA[Mario Daniel Corzo]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 13:46:10 GMT</pubDate>
            <atom:updated>2026-03-11T13:46:10.277Z</atom:updated>
            <content:encoded><![CDATA[<p>How we built a cross-platform mobile application to manage BLE environmental sensors, handle over-the-air firmware updates, and deliver actionable data to non-technical users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0yijTUj93k5e0fu2X416xQ.png" /></figure><p><strong>On this page</strong></p><ul><li>The Challenge</li><li>System Architecture</li><li>BLE Communication</li><li>Over-the-Air Firmware Updates</li><li>Sensor Provisioning at Scale</li><li>Designing for Non-Technical Users</li><li>Cross-Industry Applications</li><li>Technical Highlights</li><li>Why This Matters</li></ul><p>Industries that depend on stable environmental conditions, from pharmaceutical storage to indoor agriculture, face a common problem: how to continuously monitor key parameters across distributed spaces without relying on manual processes or rigid proprietary systems.</p><p>A few years ago, we took on this challenge for a client managing sensitive physical environments. The result was a Flutter-based mobile application that communicates with custom BLE sensors, supports over-the-air firmware updates via MCUMgr, and presents environmental data in a format that non-technical teams can act on immediately.</p><p>This article walks through the key technical decisions, the challenges we solved, and why the solution applies well beyond its original use case.</p><h3>The Challenge</h3><p>The client needed to monitor environmental conditions across multiple zones within their facilities. Several parameters, including temperature, humidity, and additional environmental factors, all had to stay within defined thresholds. Wiring was not an option, and existing commercial solutions were either too expensive, too closed, or too generic to fit the team’s workflow.</p><p>The requirements were clear:</p><ul><li>Wireless sensors reporting multiple environmental parameters at regular intervals</li><li>Cross-platform mobile app for iOS and Android with no feature parity gaps</li><li>Over-the-air firmware updates to keep sensors current without physical access</li><li>Scalable provisioning to onboard new sensors quickly across facilities</li></ul><h3>System Architecture</h3><p>We designed the system around four components: BLE sensors transmitting periodic readings, a Flutter mobile app, a cloud backend for historical storage and alerting, and an OTA server for firmware distribution.</p><p>The sensors report at configurable intervals, transmitting multiple environmental parameters. The mobile app connects to nearby sensors via BLE, reads their data, processes unit conversions based on user preferences, and syncs everything with the cloud backend over HTTPS.</p><p>This interval-based approach balances data granularity with battery life, giving teams a consistent and reliable picture of conditions throughout the day without draining sensor batteries.</p><h3>BLE Communication</h3><p>Working with Bluetooth Low Energy on mobile devices presents several platform-specific challenges that required careful engineering.</p><p>Connection lifecycle management. We implemented sequential connection handling with intelligent retry logic, MTU negotiation, and connection priority elevation to ensure reliable throughput.</p><p>Platform divergence between Android and iOS. Each operating system handles BLE differently: permission models, scan intervals, and background behavior all vary significantly. Flutter gave us a unified UI layer, and flutter_blue_plus provided the BLE abstraction, but the communication layer still required per-platform tuning. Prior experience with firmware and embedded communication protocols proved essential here.</p><p>Signal quality monitoring. We built an RSSI-based signal strength indicator with threshold-based visual feedback. This helps users identify whether a sensor is well-positioned or needs to be relocated for reliable connectivity.</p><h3>Over-the-Air Firmware Updates</h3><p>OTA firmware updates over BLE were one of the more complex pieces of the system. We integrated MCUMgr, the MCUboot management protocol, to stream firmware binaries directly to sensors over Bluetooth.</p><p>The DFU flow works as follows:</p><ol><li>Download the firmware binary from the OTA server (S3), selected by device region</li><li>Decode and validate the firmware archive</li><li>Stream the binary to the device in chunks via SMP (Simple Management Protocol) over BLE</li><li>Validate the firmware in Slot 1 using the MCUBoot bootloader</li><li>Reboot the sensor and confirm the update</li></ol><p>If any step fails, the system falls back gracefully without bricking the device.</p><h3>Sensor Provisioning at Scale</h3><p>Adding new sensors to the system needed to be fast and foolproof, even for non-technical field staff. We built a multi-step provisioning wizard using Flutter BLoC as a state machine.</p><p>The provisioning flow:</p><ol><li>Identify the sensor by scanning its QR code or manually entering the serial number</li><li>Validate the serial number format and provision through the backend API</li><li>Pair with the sensor over BLE and authenticate using its app key</li><li>Assign the sensor to a location, zone, and configuration profile</li><li>Verify firmware and trigger a DFU update if the sensor is running an outdated version</li><li>Capture a reference image and complete activation</li></ol><p>Each step includes error handling and retry paths. The BLoC pattern keeps the state machine testable and predictable, with clear transitions between scanning, service discovery, device info retrieval, and final submission.</p><h3>Designing for Non-Technical Users</h3><p>Sensor data is only valuable if the people who need it can interpret it immediately. We invested significant effort in the UX layer to make the app accessible to teams without technical backgrounds.</p><ul><li>Traffic-light indicators: Green, yellow, and red status for each reading so users can assess conditions at a glance</li><li>Configurable unit preferences: Adjustable units based on regional or industry standards, so teams work in the formats they already know</li><li>Time-series visualization: Interactive charts with selectable time windows so users can spot trends and anomalies across different horizons</li></ul><h3>Cross-Industry Applications</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YgcrpGAoJ72chvBD" /></figure><p>The underlying problem this system solves, continuous environmental monitoring across distributed spaces, is not unique to any single industry. The same architecture applies directly to:</p><ul><li>Wine storage and vineyards: Temperature and humidity control in barrel rooms and cellars</li><li>Pharmaceutical and cold chain logistics: Condition traceability during transport and storage</li><li>Hospitals and laboratories: Sterile area monitoring and preservation chamber oversight</li><li>Indoor agriculture: Microclimate control in greenhouses and vertical farms</li><li>Data centers: Overheating prevention and environmental compliance</li></ul><p>The core technology remains the same. What changes are the thresholds, the alerting rules, and the integration with each industry’s existing workflows.</p><h3>Technical Highlights</h3><ul><li>Cross-platform: Single Flutter codebase serving iOS and Android with no feature gaps</li><li>BLE stack: flutter_blue_plus with per-platform tuning for connection reliability</li><li>OTA updates: MCUMgr/SMP protocol with region-specific firmware and graceful fallback</li><li>State management: Hybrid Provider + BLoC architecture balancing simplicity and testability</li><li>Provisioning: BLoC-driven state machine with QR scanning, BLE pairing, and DFU integration</li><li>Observability: Sentry for error tracking and Segment for usage analytics</li><li>API layer: Dio-based HTTP client with JWT authentication and environment-based configuration</li></ul><h3>Why This Matters</h3><p>This project demonstrates that sophisticated environmental monitoring does not require massive budgets or proprietary lock-in. With the right combination of BLE hardware, a well-architected mobile app, and cloud infrastructure, it is possible to build a system that scales across facilities and adapts to different industry requirements.</p><p>Ready to build an environmental monitoring solution or a BLE-connected mobile application for your IoT product? <a href="https://www.croxel.com/"><strong>Croxel</strong></a> has deep experience in BLE integration, Flutter development, and embedded firmware across multiple connectivity platforms. We can help you navigate the complete pipeline from sensor communication through production deployment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5911b596355f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>