Download mos.exe by clicking on the button above, then
choose installation type:
mos.exe and follow a Web UI wizard.
mos.exe
to your c:\Windows folder, start command line prompt
and use extended mos.exe functionality:
mos flash mos-esp8266 mos wifi YOUR_WIFI_NETWORK YOUR_WIFI_PASSWORD mos console
Start terminal, copy-paste the following command and press enter:
curl -fsSL https://mongoose-os.com/downloads/mos-release/install.sh | /bin/sh
This will download and install the mos tool into ~/.mos/bin/ directory.
Choose installation type:
~/.mos/bin/mos
~/.mos/bin/mos flash mos-esp8266 ~/.mos/bin/mos wifi YOUR_WIFI_NETWORK YOUR_WIFI_PASSWORD ~/.mos/bin/mos console
mos flash mos-esp32 # Install on ESP32
mos flash mos-esp8266 # Install on ESP8266
mos flash mos-cc3200 # Install on TI CC3200
mos flash mos-stm32-nucleo-F746ZG # Install on STM32 Nucleo
mos flash mos-stm32-disco-F746G # Install on STM32 Discovery
mos ls # List files
mos get FILENAME # Print contents of FILENAME
mos put FILENAME # Copy FILENAME to the device
mos rm FILENAME # Delete FILENAME
mos wifi WIFI_NETWORK_NAME WIFI_PASSWORD
mos get index.html > a # Fetch index.html
vim a # Edit local file
mos put a index.html # Upload back to index.html
mos config-get
mos config-set debug.level=3
mos config-set mqtt.server=a.b.c:12345
mos call Control '{"state": 0}'
mos call GetNetworkStatus
curl -d '{"state": 1}' ws://IP/rpc/Control
mos --port ws://IP/rpc call Control '{"state": 0}'
mos --port mqtt://MQTT_SERVER:PORT/DEVICE_ID call Control '{"state": 0}'
mos init --arch esp8266 # Initialise empty project
mos build # Build firmware
mos flash # Flash firmware
mos call Control '{"state": 0}' # See prev. tutorial
mos call RPC.List
mos call RPC.Describe '{"name": "GPIO.Write"}'
mos call GPIO.Write '{"pin": 16, "value": 0}'
mos --port ws://DEVICE_IP/rpc call OTA.Update '{"url": "http://MYSITE/fw.zip", "commit_timeout": 100}'
mos --port ws://DEVICE_IP/rpc call OTA.Commit
load('api_mqtt.js');
load('api_gpio.js');
let pin = 0, topic = 'my/topic';
GPIO.set_button_handler(pin, GPIO.PULL_UP, GPIO.INT_EDGE_NEG, 200, function() {
MQTT.pub('my/topic', JSON.stringify({ a: 1, b: 2 }));
}, null);
MQTT.sub('my/topic/#', function(conn, topic, msg) {
print('Topic:', topic, 'message:', msg);
}, null);
mos flash esp32
mos flash-read --arch esp32 0x190000 2000 -
mos -X esp32-gen-key flash_encryption_key fe.key \
--esp32-enable-flash-encryption --dry-run=false
mos flash esp32 --esp32-encryption-key-file fe.key