Instructions for flashing the device and using helper scripts.
- PlatformIO Core (
pio) ping(usually already available in the system)nc/netcatfor reading logs over TCP
Check:
pio --version
nc -hThe following environments are configured in platformio.ini:
usb- flash over USBota- flash over OTA (upload_protocol = espota)
- Connect the device over USB.
- Verify that PlatformIO can see the port:
pio device list- Upload the firmware:
pio run -e usb -t uploadIf the device is reachable on the network (known IP), you can flash without USB:
pio run -e ota -t upload --upload-port <ip-address>Example:
pio run -e ota -t upload --upload-port 192.168.1.42Connects to the device over TCP (via nc) and shows logs.
Usage:
./start_log.sh <ip-or-hostname> [port]<ip-or-hostname>- device address[port]- log port (default:2323)
What the script does:
- Waits until the device starts replying to
ping - Then connects to the log port via
nc
Examples:
./start_log.sh 192.168.1.42
./start_log.sh micron.local 2323Flashes the device over OTA and immediately opens logs.
Usage:
./upload_ota_and_log.sh <ip-address>What the script does:
- Starts OTA flashing:
pio run -e ota -t upload --upload-port "<ip-address>" - If flashing succeeds, runs:
./start_log.sh "<ip-address>"
Example:
./upload_ota_and_log.sh 192.168.1.42Typical Wi-Fi development loop:
./upload_ota_and_log.sh 192.168.1.42If OTA is unavailable, flash over USB:
pio run -e usb -t upload-
pio: command not found
PlatformIO is not installed or not added toPATH. -
nc: command not found
Install netcat (nc). -
OTA upload fails
Check that the device and computer are on the same network and the IP is correct. -
Log does not open on
2323
Verify the port and pass it as the second argument tostart_log.sh.