Mongoose OS

2.20.0
Mongoose OS is a modular IoT firmware development framework designed for microcontrollers, enabling rapid development in both C/C++ and JavaScript. It provides a comprehensive environment for connected devices with built-in support for secure OTA updates, remote management via a robust RPC mechanism, and native integration with major cloud providers like AWS IoT and Google IoT Core.

Features

  • Dual-language development support allowing application logic to be written in C/C++ or JavaScript (mJS).

  • Reliable Over-The-Air (OTA) firmware updates with automatic rollback on failure to prevent bricking.

  • Integrated RPC (Remote Procedure Call) mechanism for device management over UART, MQTT, HTTP, and BLE.

  • Built-in flash encryption and support for external hardware security modules like ATCA crypto chips.

  • Native integration for AWS IoT, Google Cloud IoT Core, Microsoft Azure, and IBM Watson IoT.

  • Embedded JavaScript engine (mJS) specifically optimized for low-memory microcontroller environments.

  • Support for multiple file systems including LittleFS, SPIFFS, and RAM-based virtual file systems.

  • Comprehensive networking stack including WiFi, Ethernet, and PPPoS for cellular connectivity.

  • Built-in configuration management system with persistent storage and remote access capabilities.

  • Integrated device management via the mDash dashboard service for remote monitoring and control.

  • Support for Bluetooth Low Energy (BLE) including GATT services for configuration and debugging.

  • Extensive driver library for various sensors, barometers, and LED displays.

  • Real-time event system for handling hardware interrupts and network state changes.

  • Cryptographic support via ARM mbedTLS optimized for small memory footprints.

  • Built-in SNTP support for time synchronization over the network.

  • Support for various industrial protocols and transports including MQTT and WebSockets.

Architecture

Mongoose OS features a highly modular architectural design consisting of a core engine and a vast ecosystem of pluggable libraries. The system is designed to be lightweight yet extensible, allowing developers to include only the necessary components for their specific hardware and application requirements. At its heart, the framework utilizes an event-driven model, where the core manages system events, network transitions, and hardware interrupts, dispatching them to registered handlers in either C or JavaScript.

A central pillar of the architecture is the RPC (Remote Procedure Call) mechanism. This subsystem allows for seamless communication between the device and external entities (such as a cloud dashboard or a mobile app) over various transports like MQTT, WebSockets, or Serial. The framework also includes a Virtual File System (VFS) layer that abstracts different storage backends, enabling consistent file operations across SPIFFS, LittleFS, or FAT systems.

Core Components

  • mJS Engine: A restricted JavaScript engine designed for microcontrollers with limited RAM.
  • RPC Layer: Provides remote management, configuration, and diagnostic capabilities.
  • Configuration System: A structured, persistent storage system for device settings.
  • Networking Stack: Integrated support for WiFi, Ethernet, and TCP/IP protocols.
  • Security Module: Handles flash encryption, TLS/SSL termination, and hardware crypto-chip interfacing.

Use Cases

This RTOS is ideal for:

  • Industrial IoT: Deploying remotely manageable sensors and controllers that require secure, reliable OTA updates in the field.
  • Smart Home Appliances: Building connected consumer devices that benefit from rapid prototyping using JavaScript and native cloud integration.
  • Asset Tracking: Developing low-power cellular or WiFi-based trackers using the integrated PPPoS and GPS/location libraries.
  • Cloud Gateways: Creating bridge devices that aggregate local sensor data (via BLE or Modbus) and push it to AWS, Azure, or Google Cloud.
  • Secure Edge Computing: Applications requiring hardware-level security and encrypted storage for sensitive data processing.

Getting Started

To begin development with Mongoose OS, the primary tool is mos, a cross-platform command-line utility and Web UI. Developers should first download and install the mos tool for their operating system (Windows, macOS, or Linux). The typical workflow involves connecting a supported development board (like an ESP32 or STM32) via USB, using mos clone to start from a template application, and then running mos build and mos flash to compile and deploy the firmware.

Comprehensive documentation, including quickstart guides for C and JavaScript, API references, and cloud integration tutorials, is available at mongoose-os.com/docs. Technical support is provided through an active community forum and a Gitter chat room for real-time collaboration.

Related Projects

View All Projects →

IoT Framework for NodeMCU

A base IoT framework for NodeMCU (ESP8266) built on Mongoose OS and integrated with AWS IoT. It features a modular architecture supporting JavaScript-based application logic, OTA updates, and Remote Procedure Calls (RPC).

mongoose-os spiffs

Mongoose OS App on STM32F446RE

An experimental Mongoose OS application skeleton tailored for the STM32F446RE microcontroller. It provides a customized build environment and patched core libraries to enable Mongoose OS support on the STM32F4 platform using the NUCLEO-F446RE board.

mongoose-os

Mongoose OS ESP8266 PIR Monitor

A low-power motion detection application for the ESP8266 that utilizes a PIR sensor and MQTT for reporting. It features advanced power-saving techniques including deep sleep, RTC memory persistence, and conditional WiFi activation to minimize energy consumption.

mongoose-os

Mongoose OS Robot Car

An embedded application for driving a small off-the-shelf car robot using Mongoose OS. It targets ESP32 and ESP8266 microcontrollers, featuring mDNS support, RPC services, and integration with the DRV8833 motor driver. The project was developed as a support tool for CoderDojo robotics projects.

mongoose-os

Pellet Stove AWS IoT Bridge for ESP32

A Mongoose OS firmware for ESP32 that connects Micronova-based pellet stoves, specifically the Piazzetta P937, to AWS IoT. It enables remote monitoring and control of stove parameters like temperature and fan speed by interfacing with the stove's control board via UART.

mongoose-os

PPPoS Example for Mongoose OS

A demonstration application for Mongoose OS that establishes internet connectivity via a GSM modem using the Point-to-Point Protocol over Serial (PPPoS). It targets the ESP32 microcontroller and the SIM868 module, utilizing the Mongoose OS PPP library for automatic network connection and IP acquisition.

mongoose-os

QDBM Library for Mongoose OS

A port of the QDBM high-performance embedded database for Mongoose OS, specifically optimized for ESP32 and ESP8266 platforms. It provides a C-based key-value storage solution with custom shims to handle Mongoose OS virtual file system limitations.

mongoose-os

Rainnow Core

A Mongoose OS-based firmware for controlling NeoPixel LED strips via RPC. It provides a JavaScript-driven interface to manage LED states, colors, and blinking effects over a network, specifically targeting ESP32 or ESP8266 hardware.

mongoose-os