From 6e88eaf481993cdaa245e247498eb07ab587a187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20W=C3=BCrtinger?= Date: Wed, 18 Apr 2018 22:33:02 +0200 Subject: [PATCH] Created PlatformIO CLI (markdown) --- PlatformIO-CLI.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 PlatformIO-CLI.md diff --git a/PlatformIO-CLI.md b/PlatformIO-CLI.md new file mode 100644 index 00000000..ab13161c --- /dev/null +++ b/PlatformIO-CLI.md @@ -0,0 +1,44 @@ +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-CN +;env_default = sonoff-DE +;env_default = sonoff-ES +;env_default = sonoff-FR +;env_default = sonoff-IT +;env_default = sonoff-NL +;env_default = sonoff-PL +;env_default = sonoff-minimal +;env_default = sonoff-ds18x20 +``` + +# 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](https://unix.stackexchange.com/questions/144029/command-to-determine-ports-of-a-device-like-dev-ttyusb0) your device is connected to. + +Depending on your configuration your user account [may need to be in the `dialout` group](https://askubuntu.com/questions/112568/how-do-i-allow-a-non-default-user-to-use-serial-device-ttyusb0). \ No newline at end of file