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 (91)
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 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.
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.
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.
Sonoff Basic Firmware for openHAB
A specialized Mongoose OS firmware for the Sonoff Basic smart switch, designed for seamless integration with openHAB via MQTT. It supports the Homie Convention for auto-discovery and includes features like local scheduling, energy consumption analysis, and a web-based WiFi configuration interface.
Tasmota to Mongoose OS Converter
A minimal intermediate firmware designed for OTA flashing Mongoose OS onto ESP8266-based IoT devices currently running Tasmota or compatible firmware. It facilitates the restoration of Mongoose OS-based stock firmware, such as Shelly devices, by providing a bridge between different partition layouts and bootloaders.
Timezones for Mongoose OS
A C-based library for Mongoose OS that manages timezone data and converts Olson notation into POSIX TZ strings. It allows developers to configure device timezones using standard names like 'America/New_York' while handling the underlying POSIX string generation automatically.
Weather Station with Google Cloud IoT Core and Mongoose OS
An IoT weather station project utilizing Mongoose OS to connect ESP32 or ESP8266 microcontrollers to Google Cloud Platform. It features a complete data pipeline from device telemetry to BigQuery storage and a Firebase-hosted web dashboard.
mJS Array Prototype Polyfill
A library providing a partial polyfill for the JavaScript Array prototype in the mJS engine. It enables standard array methods like map, filter, and reduce on microcontrollers running Mongoose OS. The library is designed to maintain a small footprint for resource-constrained environments.
Mongoose OS Docker Image
A Dockerized environment for the Mongoose OS (mos) tool, providing a consistent and portable toolchain for building IoT firmware. It simplifies the development process by encapsulating the mos command-line utility and its dependencies within a lightweight Alpine Linux container.
Mongoose OS Programs and Examples
A collection of applications and configuration examples for Mongoose OS targeting ESP32 and ESP8266 microcontrollers. The project features implementations for MQTT, Google Cloud Platform (GCP) IoT Core integration, RPC services, and hardware interfacing for various sensors.
Mongoose OS
Mongoose OS is a comprehensive IoT firmware development framework designed for microcontrollers like ESP32, ESP8266, and STM32. It provides built-in support for over-the-air (OTA) updates, security via flash encryption and mbedTLS, and seamless integration with major cloud providers like AWS IoT and Google Cloud IoT Core.
Alexa WEMO Emulation for Mongoose OS
A library for Mongoose OS that emulates Belkin WEMO UPnP plugs, allowing Amazon Alexa to discover and control devices locally. It supports multiple virtual plug instances on a single ESP32 or ESP8266, mapping voice commands directly to GPIO pin toggles.
HLW8012 and BL0937 Energy Meter Library for Mongoose OS
A Mongoose OS library for the HLW8012 and BL0937 energy monitoring sensors, targeting ESP32 and ESP8266 platforms. It enables precise measurement of voltage, current, active power, and energy consumption through a pulse-based interface.
LilyGo HiGrow ESP32 Plant Monitoring Sensor Firmware (Hardware v1)
A Mongoose OS-based firmware for the LilyGo HiGrow ESP32 Plant Monitoring Sensor v1.0. It provides sensor data collection for soil moisture, temperature, and humidity, featuring RPC support and Bluetooth configuration for integration with the HiGrow ecosystem.
Losant MQTT Mongoose OS Example
An example Mongoose OS application designed to connect ESP32 and ESP8266 microcontrollers to the Losant IoT platform via MQTT. It demonstrates secure MQTT communication with SSL/TLS encryption and utilizes the Mongoose OS modular library system for hardware abstraction. The project provides a streamlined workflow for configuring WiFi and Losant credentials using the mos tool.
Losant Temperature Sensor for Mongoose OS
A power-efficient ESP32 application built on Mongoose OS that transmits internal temperature readings to the Losant IoT platform. It utilizes MQTT for communication and deep sleep for extended battery life, featuring a unique calibration system to approximate ambient temperature.
MEL-AC Demo App
A demonstration application for Mongoose OS that provides remote control for Mitsubishi Electric Air Conditioning and Heat Pump units. It utilizes the MEL-AC library to interface with HVAC hardware via UART and exposes control parameters through RPC over HTTP, WebSockets, and MQTT.
MEL-AC Library for Mongoose OS
A Mongoose OS library for controlling Mitsubishi Electric Air Conditioning (AC) and Air-to-Water (ATW) units via UART. It interfaces with the CN105 connector on indoor units and provides RPC handlers for remote management over MQTT, HTTP, or WebSockets. The library supports ESP8266 and ESP32 platforms.
mgos-combine
A Go-based utility for merging Mongoose OS firmware components into a single binary file. It facilitates the creation of unified firmware images from the standard Mongoose OS ZIP distribution, supporting configurable output sizes and integration into CI/CD pipelines via Docker.
Mongoose OS App Skeleton
A boilerplate project for developing Mongoose OS applications on ESP32 and ESP8266 microcontrollers. It provides a pre-configured environment with essential libraries for WiFi, RPC services, and OTA updates, supporting both C and JavaScript (mJS) development.
Mongoose to Tasmota, Home Accessory Architect or ESPurna
A minimal intermediate firmware for OTA flashing target firmwares like Tasmota, HAA, or ESPurna onto Shelly devices. Built on Mongoose OS, it provides a bridge for migrating ESP8266-based smart home hardware from stock firmware to open-source alternatives.
SD.h and FS.h Port for Mongoose OS
A port of the Arduino ESP32 SD.h and FS.h libraries to Mongoose OS, specifically targeting ESP32 microcontrollers. It provides a reliable SD card interface by integrating source files and static libraries directly from the Arduino ESP32 core, bypassing standard compatibility layers.
SGP30 Gas Sensor Library for Mongoose OS
A Mongoose OS library for the Sensirion SGP30 multi-pixel gas sensor that provides measurements for TVOC and CO2 equivalent levels. It integrates the official Sensirion embedded driver and utilizes the I2C interface for hardware communication. The library is designed for embedded IoT applications requiring air quality monitoring.
Telegram Bot API for Mongoose OS
A comprehensive library for Mongoose OS that implements the Telegram Bot API, allowing IoT devices to be controlled and managed through Telegram. It supports ESP8266 and ESP32 microcontrollers and provides both C and JavaScript (mJS) interfaces for messaging and interactive bot features.
e-Yantra IoT Workshop
A comprehensive collection of resources for learning IoT development, focusing on the e-Yantra IoT Platform and AWS IoT. It provides notes, exercises, and code samples for platforms like Raspberry Pi and Mongoose OS, covering IoT protocols, device shadows, and cloud integration.
Homey Smart Home Controllers
A collection of smart home device controllers built using ESP8266 microcontrollers and Mongoose-OS. The project includes firmware and hardware designs for blinds, heaters, air extractors, and portable sensors, designed to integrate with the Mozilla WebThings ecosystem.
HX711 Library for Mongoose OS
A port of the HX711 Arduino library to Mongoose OS, designed for interfacing with the HX711 24-bit analog-to-digital converter. It leverages the Mongoose OS arduino-compat library to provide a familiar interface for weight and force measurement in IoT applications.
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.