--port optionmos tool connects to the device specified by --port flag, which is
set to 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, --port ws://IP_ADDR/rpc
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
environment variable MOS_FLAGNAME. For example, to set the default value
for --port flag, export MOS_PORT variable - on Mac/Linux,
put that into your ~/.profile:
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:
| Platform | Wiring Notes |
|---|---|
| bare bones ESP8266 | flash via UART: GPIO15 LOW, GPIO0 LOW, GPIO2 HIGHboot from flash: GPIO15 LOW, GPIO0 HIGH, GPIO2 HIGHboot from SD: GPIO15 HIGH |
| bare bones ESP32 | flash via UART: GPIO0 LOWboot from flash: GPIO0 HIGH |
| CC3200 launchpad | connect J8 to SOP2 (see guide) |
The mos tool could be self-updated via the Web UI or via the console
command 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 casemos update release. This is the default.
Released are created once in 1-2 weeksmos update latest. Get the most latest
updates, but experience breakages sometimes