Mongoose OS is a framework for building apps (firmwares) for low-power microcontrollers (uC), and consists of the following main components:
mostool. Provides device management and firmware building capabilities
mos buildcommand builds a firmware (we call it an "app") by taking
mos.ymlfile in the current directory and invoking a build docker image either remotely (
mos build) or locally (
mos build --local).
Since Mongoose OS is based on the vendor's SDK, it extends the capabilities of the native SDK. For example, on ESP32 uC, Mongoose OS uses an ESP-IDF SDK, therefore it provides all capabilities that ESP-IDF provides, plus extra that come with Mongoose OS. If user code uses crossplatform API only, it can be built on all supported hardware platforms with no code changes:
mongoose-os/ - repository root common/ - various utility functions docs/ - documentaion you are reading now frozen/ - JSON parser/emitter fw/ - main source tree src/ - cross-platform sources platforms/ - platform-specific sources mongoose/ - networking core
The boot process is driven by a cross-platform mgos_init.c. In short, the subsystems are initialised in the following order:
MGOS_HOOK_INIT_DONEhooks are invoked
If any of those init functions returns
false, that means error. In this case,
the firmware reboots immediately. This is done intentionally, in order to
revert back to the previous firmware in case of failed OTA update.
Mongoose OS implements Virtual File System layer, VFS. That means it can attach (mount) different storage types into a single file system tree. For example, a device can have an SPI flash storage and an SD card storage. For each storage type, a filesystem driver must be implemented. For example, it is possible to write a driver that implements a Dropbox or Google Drive storage type, and a device (e.g. ESP8266 module) can mount a Dropbox folder.
Mongoose OS provides a Filesystem RPC service that allows remote filesystem management - for example, you can edit files remotely.