Mongoose OS
2.20.0Features
-
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 (21)
ESP Temperature to Losant using Mongoose OS
A Mongoose OS application for ESP32 and ESP8266 that periodically publishes internal temperature sensor readings to the Losant IoT platform via MQTT. It features deep sleep support for power efficiency, an OTA mode for configuration, and adjustable temperature offsets to compensate for MCU internal heat.
Adafruit E-Paper / E-Ink Library for Mongoose OS
A comprehensive port of the Adafruit EPD library for Mongoose OS, providing drivers for various e-paper displays. It supports multiple programming interfaces including C, C++, and JavaScript (mJS), and features automated hardware configuration via YAML.
Chronothermostat: An AWS-Powered IoT Climate Control System
A comprehensive IoT chronothermostat system utilizing ESP32 nodes and a Raspberry Pi 3 gateway integrated with Amazon Web Services. It features multi-room temperature and humidity monitoring, remote control via MQTT, and a web-based GUI for scheduling and statistics.
ElectricityDisplay: MQTT Remote Control for ESP8266/ESP32
This project demonstrates remote device control using MQTT on ESP8266 and ESP32 hardware via Mongoose OS. It provides a JSON-based interface for GPIO manipulation, button event reporting, and I2C bus communication, with built-in support for AWS IoT integration.
Energy Consumption Monitor (energymon-c)
A Mongoose OS-based application designed to monitor energy consumption by counting LED pulses from a standard power meter. It provides a non-intrusive way to track electricity usage using ESP8266 or ESP32 microcontrollers and features a built-in web dashboard.
ESP32 Experiments
A collection of experimental projects for the ESP32 microcontroller, featuring implementations for both the Arduino framework and Mongoose OS. The repository includes practical applications such as a cryptocurrency ticker with LCD output and a remote-controlled LEGO camera system using WebSockets.