Mongoose OS is an open source, cross-platform operating system for connected microcontrollers. It works with a range of microcontrollers and is available right now for developers to try out! I was really fascinated by the platform and reached out to find out more. Sergey Lyubka spoke to me about their operating system, how it differs from other IoT platforms and how developers can get started.

Mongoose OS in action

Mongoose OS shows some really great potential as a platform!

Mongoose OS came from very worthy beginnings, the Mongoose Networking Library runs on many projects already out there today (both open source and commercial)… Mongoose even serves scientific experiments on NASA’s International Space Station! The team at Cesanta were helping customers integrate that library and noticed a bunch of repetitive and common functionality. They decided to do something to make things much easier. The result? Mongoose OS.

Mongoose OS is an open source, cross-platform operating system for connected microcontrollers. Sergey explains that — from the very basics — “In order to make any product smart or connected, one needs to attach a computer to it. The cheapest computer is a microcontroller. It’s low on resources and thus cannot run traditional software like Linux or Windows, instead it runs specialised software called firmware.”

When would you use Mongoose OS? What cases are best for it? Sergey strongly suggests giving it a go if you’re looking for secure communication with the cloud:

“If you’re writing firmware for one of the hardware platforms we support (currently ESP32, ESP8266, TI CC3200, STM32 – and more to follow), you should seriously consider Mongoose OS especially if secure communication with the cloud is planned.” — Sergey Lyubka

Sergey points out that firmware consists of two parts:

  1. Generic functionality (e.g. over-the-air updates)
  2. Product-specific functionality, like “switch the lights on when the motion sensor wakes up”.

Sergey and his team develop firmware regularly and had observed a few key things:

  1. Generic functionality, common to most products, “takes up to 90% of the development time”
  2. Firmware for a new product is developed from scratch in most cases, despite the fact that industry is not that young anymore! “Huge fragmentation contributes to the fact that every new project reinvents many wheels.”
  3. Security is hard. Sergey reenacted a typical thought process around security and firmware which is all too familiar for many devs out there — “it’s harder to program… need to do certificate management… Store keys securely… Oh, now handshake takes 30 seconds on that chip, I need hardware acceleration… Oh, a TLS library on my platform can’t do mutual TLS, I need to port another one… All that will take another quarter or two to implement, meh, let’s go with no security for now, fix it later…”

That generic functionality which takes up to 90% of the development time? That’s where Mongoose OS can save a tonne of effort! It also has security covered to help you avoid the typical thought process which Sergey describes. Both of those are pretty valuable reasons to give Mongoose OS a go, especially if you’re struggling in those areas with your own project at the moment!

There are a whole lot of potential advantages to using Mongoose OS, from its cryptography chip support for security to integrations with cloud solutions like AWS.

An ESP32 working with AWS IoT

An ESP32 working together with AWS IoT

It is cross-platform!

My personal favourite feature of Mongoose OS is its ability to be cross-platform. It works on the following hardware:

  • Espressif Systems ESP32
  • Espressif Systems ESP8266
  • Texas Instruments CC3200
  • ST Microelectronics STM32 Nucleo F746ZG
  • ST Microelectronics STM32 Discovery F746G

“It is multi-platform and provides unification, so it has the same look and feel on all supported hardware platforms.” — Sergey Lyubka

Security

Mongoose OS provides a reliable over-the-air update system which can be essential for IoT security, so that’s a great feature to see! It also has file system encryption, mbedTLS library for encryption and mutual TLS authentication, TLS footprint tuning, cryptography chip support and more!

A lot of that security stuff is way over my head and I know I’d struggle to build it all from scratch — this would be a perfect way to learn! It’s nice to know that security hasn’t been an afterthought in this case, and as IoT security is one of the biggest issues right now in this space, this is a huge plus!

How would you use Mongoose OS?

You’d find yourself your hardware module, like an ESP32 or ESP8266, and connect it to your computer. From there, you can install Mongoose OS on it, provision cloud services, and have a running, remotely-controlled system that Sergey says takes less than 2 minutes. It supports C as its main language, as it is one of the “languages of the embedded world” that Sergey says is most appropriate because “to be cheap, microcontrollers are low-resource, thus modern frameworks simply do not fit there. Embedded engineers are left with a fairly low-level tools, and the main programming language, C, is not an exception.”

 

JavaScript is key too

My favourite part of the discussion was Sergey discussing their reasoning behind bringing JavaScript support to Mongoose OS. I’m personally a big fan of JavaScript as a tool to do great things on a whole range of platforms, including the IoT (I’ve got a whole course on that from a few years back!). Sergey and I share some common beliefs!

“We believe that the future is in scripting. That’s what accelerates and streamlines new product development. That’s what gave such a huge boost to web technologies. So, what scripting language to choose? The answer is — the most widespread, most known and most popular. That’s JavaScript. Existing solutions do not simply fit. Thus we developed our own engine.” — Sergey Lyubka

Sergey believes that JavaScript is “an unbelievably valuable tool for many tasks”, including prototyping and end-user configuration. However, it doesn’t need to be JavaScript necessarily, JavaScript is just the best option right now. He says, “we believe that scripting will expand in an embedded market. What is going to dominate, JavaScript or something else (Python, Lua, etc.) is not relevant, the main point is that the industry will definitely shift focus into scripting.”

Where to from here?

“Moore’s law makes it feasible to connect a wider and wider number of products, because it gives vendors live connection to their customers after sale. The embedded market will react to this pressure with technologies that streamline product development. Mongoose OS is exactly such a product.” — Sergey Lyubka

Thanks to Sergey for taking the time to chat about Mongoose OS! If you’ve got a compatible device, head over to Mongoose OS’s website and give it a go!

Thanks for reading! Dev Diner is a new hub for developers keen to keep up with emerging tech.
Know others who might want to read it too? Please like and share this post with them!

Would you like to republish this article in your own publication?
Contact Dev Diner to request official republication of this article.

Leave a Reply

Your email address will not be published. Required fields are marked *

Want more?