Connect your device to your computer via the USB cable.
mos by double-clicking the executable or by typing
mos in your
Linux or Mac terminal. This will start a simple Web UI. The drop-down list
for the device address must list the corresponding serial device.
If it does not, go back to the downloads page and install
Select serial device from the dropdown list, click on Connect button, choose your device architecture, flash the firmware and configure wifi:
init.js file after boot,
therefore if you needs to customise a default app, you need to modify
that file and reboot the device. Let's do it.
Click on "Device files" tab, and click on
init.js file in the list:
This default code does several things: sets up a timer to blink a built-in LED if your device has it, sets up a button press handler that sends an message to an MQTT server on a button press, etc.
Modify a blinking interval from 1 second to 100 millisecond, click on "Save and Reboot" button, and see notice the change in the blinking speed:
Note that the firmware has not been modified. What was modified is a file
init.js on the filesystem, which gets loaded after firmware boot and
api_*.js files present on a device to get an idea what API is available
in the default app. If you need other API, for example some specific
sensor, you will need to include appropriate library and rebuild the app,
which is subject of the following sections. However, the default app
provides quite broad functionality in terms of accessing hardware
(e.g. PWM, GPIO, I2C, etc) and cloud integrations (e.g. AWS IoT).