Mongoose OS uses
mos tool for various tasks:
installation (flashing firmware), building firmware from C sources,
managing files on
a device, calling device's RPC services, and so on.
Download and install
mos tool following instructions
mos tool can be used in both Web UI and command line mode. If you start
mos with no arguments, from the terminal or by double-clicking the executable,
it'll start a web server and open a browser window. Alternatively,
you can use it from the command line - that's useful for build automation.
mos --help to see available commands, and
mos --helpfull to see all
mos --help The Mongoose OS command line tool, v. 20170910-081234/master@f7f336fd+. Commands: ...
mos tool connects to the device specified by
--port flag, which is
auto by default. That means,
mos auto-detects the serial port
for the device. You can specify this value manually. It could be a
serial device, e.g.
--port COM3 on Windows or
--port /dev/ttyUSB0 on Linux.
It is possible to set
--port value to be a network endpoint instead of
serial port. Device listens for commands on serial, Websocket, and MQTT
transports (unless they are disabled). Therefore,
connects to the remote device via Websocket, and
--port mqtt://MQTT_SERVER/DEVICE_ID/rpc via the MQTT protocol.
That gives an ability to use
mos tool as a remote device management tool.
The default values for any
mos flag could be overridden via the
MOS_FLAGNAME. For example, to set the default value
--port flag, export
MOS_PORT variable - on Mac/Linux,
put that into your
export MOS_PORT=YOUR_SERIAL_PORT # E.g. /dev/ttyUSB0
In some cases, for example if you're using a bare-bones ESP8266 module instead of a development board, you need to perform extra steps to switch the module between flashing and firmware boot state. This table provides a summary:
|bare bones ESP8266||flash via UART:
boot from flash:
boot from SD:
|bare bones ESP32||flash via UART:
boot from flash:
|CC3200 launchpad||connect J8 to SOP2 (see guide)|
mos tool could be self-updated via the Web UI or via the console
mos update. The
mos tool version also influences the firmware
build: the libraries that are used during the build correspond to the
mos version. There are 3 ways you can stay updated:
mos update 1.18. This is the most stable approach, as nothing gets changed in this case
mos update release. This is the default. Released are created once in 1-2 weeks
mos update latest. Get the most latest updates, but experience breakages sometimes