dersimn/SonoffS20/ABC123/online → true
dersimn/SonoffS20/ABC123/maintenance/info → {
"board_id": "SonoffS20_ABC123",
"build_hash": "847c24d8f7c80245878a8a73af440e924f363374",
"build_tag": "master",
"build_timestamp": 1607178964,
"ip_address": "10.1.1.216"
}
dersimn/SonoffS20/ABC123//onoff → {"val": false}
dersimn/SonoffS20/ABC123//led → {"val": false}
dersimn/SonoffS20/ABC123//config → {"button-toggle": false}
Using retained messages for dersimn/SonoffS20/ABC123/set/config
will reload the configuration on boot.
Clone this repository, cd
into it. Connect wires to the Sonoff S20 (I've been using a FT2232 breakout board). Flash using PlatformIO CLI.
Run
platformio run
first to see if everything compiles, first.
To get the Sonoff into programming mode, connect every pin, except 3.3V. Press the button on the PCB and then plug in the 3.3V, hold it for further ≈4s:
In case you have multiple USB-Serial adapters, or your adapter offers multiple ports:
platformio device list
platformio run --upload-port /dev/cu.usbserial-00202102A
For WiFi OTA upload:
platformio device list --mdns
platformio run -t upload --upload-port <SonoffS20_1234567.local or IP address>
Debug with:
platformio device monitor
or
platformio device monitor --port /dev/cu.usbserial-00202102A
Flash on Wemos D1 Mini board for better debugging:
platformio run -e d1_mini
I recommend to flash debugging firmwares via OTA as well, since it's much faster. You can still connect USB-Serial adapter for debugging monitor output simultaneously.