PlatformIO CLI - seurat-atreides/Sonoff-Tasmota GitHub Wiki

How to flash the Tasmota firmware onto a device using the platformio command line interface on Linux. This manual was tested on Ubuntu 17.10.

Prerequisites

Install Python and PIP

sudo apt-get install python-pip

Install PlatformIO CLI

sudo pip install -U platformio

Download the Sonoff-Tasmota source code

Either download the latest Tasmota release Source code from https://github.com/arendst/Sonoff-Tasmota/releases and extract it or clone the Git repository:

git clone https://github.com/arendst/Sonoff-Tasmota.git

Select the environment

Edit the file platformio.ini and uncomment one of the env_default lines by removing the ;, eg.:

; *** Uncomment one of the lines below to build/upload only one environment
env_default = sonoff
;env_default = sonoff-minimal
;env_default = sonoff-basic
;env_default = sonoff-classic
;env_default = sonoff-knx
;env_default = sonoff-sensors
;env_default = sonoff-display
;env_default = sonoff-BG
;env_default = sonoff-BR
;env_default = sonoff-CN
;env_default = sonoff-CZ
;env_default = sonoff-DE
;env_default = sonoff-ES
;env_default = sonoff-FR
;env_default = sonoff-GR
;env_default = sonoff-HE
;env_default = sonoff-HU
;env_default = sonoff-IT
;env_default = sonoff-NL
;env_default = sonoff-PL
;env_default = sonoff-PT
;env_default = sonoff-RU
;env_default = sonoff-SE
;env_default = sonoff-TR
;env_default = sonoff-TW
;env_default = sonoff-UK

Compile and upload

Once all the prerequisites are in place compiling and uploading is one simple command. Execute this from within the Sonoff-Tasmota source code directory:

platformio run --target upload --upload-port /dev/ttyXYZ

Just make sure to replace /dev/ttyXYZ with the actual serial port your device is connected to.

Depending on your configuration your user account may need to be in the dialout group.