-e command line argument

Michael Ingraham 2019-08-20 09:52:50 -04:00
parent 2401d5bb3d
commit 6ffb234a7e
1 changed files with 12 additions and 18 deletions

@ -1,27 +1,21 @@
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.
How to flash the Tasmota firmware onto a device using the `platformio` command line interface. This manual was tested on Ubuntu 17.10.
# Prerequisites
## Install Python and PIP
```
sudo apt-get install python-pip
```
`sudo apt-get install python-pip`
## Install PlatformIO CLI
```
sudo pip install -U platformio
```
`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
```
'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.:
The default environment configuration can be used to easily generate Tasmota firmware variants (sonoff, sensors, display, etc.). If you're not sure which binary is the right one for you, consult the [builds table](Builds) or just start with [sonoff.bin](http://thehackbox.org/tasmota/release/sonoff.bin). To build and/or flash exactly one of these, use the `-e` command line argument (e.g., `-e sonoff-sensors`). Alternatively, uncomment (i.e., remove the leading `;`) the desired *env_default* line in the *platformio.ini* file and do not use the `-e` argument on the command.
```
; *** Uncomment one of the lines below to build/upload only one environment
env_default = sonoff
;env_default = sonoff-minimal
;env_default = sonoff-basic
@ -51,10 +45,10 @@ env_default = sonoff
```
# 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.
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 -e <variant> --target upload --upload-port <port>`
Just make sure to replace `<port>` with the actual serial port your device is connected to. On Windows these interfaces are named COM ports (COM1, COM2, etc.). On Linux these interfaces are named [TTY ports](https://unix.stackexchange.com/questions/144029/command-to-determine-ports-of-a-device-like-dev-ttyusb0) (e.g., /dev/ttyUSB0, /dev/ttyUSB1, etc.)].
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).