EMIT

by ControlBits

Environmental Monitoring for the Internet of Things

View all updates Aug 13, 2020

Being Reminded That IoT Is About More Than Just Hardware

by Jon Luke

It’s easy to think of EMIT as a ‘hardware project.’ Even for us. But the past week has been full of stark reminders that there’s a lot more to IoT that just the hardware! The good news is that, after a fairly stressful week, we have improved EMIT’s firmware significantly and released an open source MQTT monitoring tool that you might find helpful when implementing your own projects.

The Lessons of This Past Week

It all started around this time last week, when we released the EMIT ‘LIVE’ dashboard, a real-time environmental monitoring dashboard built for EMIT project. After completing and testing the dashboard, everything seemed ready to go, so we made the announcement…and then watched in horror as it fell apart. (Apologies if you tried to visit the dashboard during that time. Please try it again!)

After a brief panic and a not-so-brief investigation, we confirmed that the dashboard itself and the MQTTHQ broker were both solid. So what was making the dashboard unstable?

Ultimately, the culprit turned out to be a handful of uncaught exceptions in the firmware code. Despite the many, many hours we spent testing EMIT’s ‘hardware features’, we were again reminded that IoT solutions involve a lot of moving parts and a lot of simultaneous interactions. IoT products require a rigorous and professional approach to development and deployment.

To that end, here is what we learned (and built) over the past week:

Lesson 1: IoT Implementations MUST Be Monitored to Maximize Reliability

Bench testing quickly identifies frequently occurring bugs, but IoT solutions have a lot going on under the hood. It takes time to see every possible fault condition, and the better your solution gets, the harder it becomes to drive out that last bug.

With issues occurring so infrequently, a robust monitoring solution can really help you find and fix those final bugs. Monitoring also helps maintain reliability once your product has been deployed to the field.

We struggled to find a reliable solution immediately…so we built one! Our ‘Super Simple Monitor’ is written in Python and uses a background timer thread to monitor the interval between messages received. If it exceeds a pre-determined period (which indicates one or more missed messages), it triggers an alarm. We even added push notifications, so I now get a message on my phone if EMIT goes down.

We thought others might find it useful, so we’ve made it available on our GitHub repository.

Lesson 2: Micropython’s umqtt.simple2 & umqtt.robust2 Are Awesome!

Although the standard umqtt.simple library for Micropython is really easy to learn and use, it is generally not considered to be the most reliable tool. It just doesn’t have the error handling it would need to deal with all of the challenges—like temporary drops in broadband connections—that arise in the real world.

Rather that continuing to add patches, we decided to have another Google and came across umqtt.simple2 & umqtt.robust2, both of which have error handling built in! All you need to do is decide how you want to handle those errors.

Although they’re not quite ‘drop-in replacements’ for the standard libraries, integrating them was quick and easy. EMIT is now far more reliable, and we’ll be using these new libraries in all of our production code.

That’s all for now. Sorry this was such a long update. Hopefully it was interesting or at least informative!

Thank you for your continued support.

About the Author

Jon Luke

ControlBits-Jon  ·   United Kingdom


$3,682 raised

of $3,500 goal

105% Funded! Order Below

Product Choices

$29

EMIT - Board Only

A dev board with a socket for a 30-pin DOIT ESP32 DEVKIT V1 (not included), an integrated temperature and humidity sensor, a microSD slot, an I/O expansion socket, and an 5 A SPST relay.


$59

EMIT - Full Kit

A Wi-Fi- and Bluetooth-enabled ESP32-based dev board with an integrated temperature and humidity sensor, a microSD slot, an I/O expansion socket, and an 5 A SPST relay. Includes a 30-pin DOIT ESP32 DEVKIT V1, a custom enclosure, an 8 GB microSD card, and a USB cable.

Credits

ControlBits

At Control Bits we're dedicated to building great IoT products that are open to everyone through education, hardware development kits, and open source software. Along the way we aim to build an open and vibrant community.


Jonathan Luke

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects: