PlatformIO - seurat-atreides/Sonoff-Tasmota GitHub Wiki
How to setup and configure PlatformIO for Tasmota compilation and upload.
Download PlatformIO from http://platformio.org/
Install PlatformIO to a known folder.
Download the latest Tasmota release Source code from https://github.com/arendst/Sonoff-Tasmota/releases and unzip to another known folder.
Copy all files from the Tasmota release Source code into your platformIO base folder.
The default environment configuration generates multiple firmware variants. To build and/or flash exactly one of these, uncomment one of the env_default lines in file platformio.ini.
- sonoff.bin - the default firmware for all devices
- sonoff-minimal.bin - is interim firmware to be used when the above firmware images become too big to fit as OTA or web upload; installing this one first and THEN uploading the desired sonoff.bin allows for future firmware size growth over the OTA file limit of 1/2 flash size.
- sonoff-sensors - is a version with most common used sensors enabled
Select Build
from the menu.
Note that where the Arduino IDE automatically includes the main Arduino library, you may need to manually do this when using PlatformIO. In your main .cpp
file, add #include <Arduino.h>
at the top.
PlatformIO uses the serial interface to upload the firmware to your device. On Windows these interfaces are named COM1, COM2 etc. On Linux these interfaces are called /dev/ttyUSB0, /dev/ttyUSB1 etc.
When performing a firmware upload do not connect the device to AC but use the power supply provided by your (FTDI type) serial interface.
Put the device in firmware upload mode by grounding pin GPIO00 while applying power.
Grounding pin GPIO00 can often be achieved by pressing button 1 on the Sonoff device or using a wire between GPIO00 and Gnd if the button is not available. Deviations may apply.
Connect the serial interface of your PC to the device while GPIO00 to Gnd.
Select Upload
from the menu.
NOTE: For a proper device initialization after first firmware upload power down and power up the device.