Self-compilation standardization

Michael Ingraham 2019-11-06 16:53:52 -05:00
parent 206bc13935
commit b45ad7735c
1 changed files with 19 additions and 19 deletions

@ -1,33 +1,33 @@
# Tasmota Slave # Tasmota Slave
It is possible to amend your existing Arduino Uno/Mini/Nano project to interface with a Tasmota powered ESP8266/ESP8285 generic development boards such as the Wemos D1 or NodeMCU branded hardware boards. **This feature is not included in precompiled binaries.**
To use it you must [compile your build](compile-your-build).
The creation of a slave driver interface implemented since Tasmota 7.0.0.2 enables this possibility but you need to be able to compile your own binary for Tasmota since the functionality is not included in any of the official releases. It is possible to amend your existing Arduino [Uno](https://store.arduino.cc/usa/arduino-uno-rev3)/[Mini](https://store.arduino.cc/usa/arduino-mini-05)/[Nano](https://store.arduino.cc/usa/arduino-nano) project to interface with a Tasmota powered ESP8266/ESP8285 generic development boards such as the Wemos D1 or NodeMCU branded hardware boards.
Tasmota powered devices running on generic ESP8266/ESP8285 boards such as the Wemos D1 mini and NodeMCU hardware variants can interface directly to Tasmota. The creation of a slave driver interface implemented since Tasmota 7.0.0.2 enables this possibility.
## Compiling Tasmota to include Tasmota Slave support ## Compiling Tasmota to include Tasmota Slave support
To enable support for the Tasmota Slave functionality you must [compile your build](compile-your-build). Add the following to `user_config_override.h`:
```
#ifndef USE_TASMOTA_SLAVE
#define USE_TASMOTA_SLAVE // Enable the driver
#endif
If you do not already have a development environment configured please read the wiki article on [flashing and compiling from source](https://github.com/arendst/Tasmota/wiki/Flashing#flashing-and-compiling-from-source) #ifndef USE_TASMOTA_SLAVE_FLASH_SPEED
#define USE_TASMOTA_SLAVE_FLASH_SPEED 57600 // Configure the baud rate of the bootloader
#endif
Once you have successfully compiled and flashed your own compilation you would have confirmed that you have a working compiling environment. #ifndef USE_TASMOTA_SLAVE_SERIAL_SPEED 57600
#define USE_TASMOTA_SLAVE_SERIAL_SPEED 57600 // Configure the baud rate at which the slave microcontroller will be interfacing to Tasmota
To enable support for the Tasmota Slave functionality you need to uncomment the following defines in the `my_user_config.h` file. #endif
```
Enable the driver:
`#define USE_TASMOTA_SLAVE`
Configure the baud rate of the bootloader:
`#define USE_TASMOTA_SLAVE_FLASH_SPEED 57600`
Configure the baud rate which the slave microcontroller will be interfacing to Tasmota at:
`#define USE_TASMOTA_SLAVE_SERIAL_SPEED 57600`
Please note that the `USE_TASMOTA_SLAVE_FLASH_SPEED` will depend on the variant of Arduino Uno/Mini/Nano board you are using - The general observation is that the 3.3V devices usually run at 57600 whereas the 5V devices usually run on 115200 but this is provided for guidance only as it has been found that some boards will not necessarily adhere to this. The main driving factor behind the baud rate is the crystal oscillator on the board which is usually 8Mhz for 3.3V variants and 16Mhz for 5V variants - hence 57600 being 1/2 of 115200. Please note that the `USE_TASMOTA_SLAVE_FLASH_SPEED` will depend on the variant of Arduino Uno/Mini/Nano board you are using - The general observation is that the 3.3V devices usually run at 57600 whereas the 5V devices usually run on 115200 but this is provided for guidance only as it has been found that some boards will not necessarily adhere to this. The main driving factor behind the baud rate is the crystal oscillator on the board which is usually 8Mhz for 3.3V variants and 16Mhz for 5V variants - hence 57600 being 1/2 of 115200.
It should also be noted that this option is only really applicable if you're actually using an Arduino UNO/Mini/Nano as a slave device and you want to be able to update the firmware on the Arduino OTA via the Tasmota Web UI. It should also be noted that this option is only really applicable if you're actually using an Arduino UNO/Mini/Nano as a slave device and you want to be able to update the firmware on the Arduino OTA via the Tasmota Web UI.
If you are using another type of microcontroller obviously the OTA update functionality will not work (for now, until support is added for other microcontrollers) but if you are still able to program the device manually there is no reason why you cannot use any microcontroller or development board as a slave to your Tasmota powered ESP8266/8285 hardware. If you are using another type of microcontroller, obviously the OTA update functionality will not work (for now, until support is added for other microcontrollers). But if you are able to program the device manually there is no reason why you cannot use any microcontroller or development board as a slave to your Tasmota powered ESP8266/8285 hardware.
Once you have compiled your own variant with the correct settings and flashed the self-compiled binary to your Tasmota device it is time to make the necessary configuration within Tasmota. Once you have compiled your own variant with the correct settings and flashed the self-compiled binary to your Tasmota device it is time to make the necessary configuration within Tasmota.
@ -59,7 +59,7 @@ So to visualize the above:
## Compiling a test sketch for the slave ## Compiling a test sketch for the slave
The TasmotaSlave driver requires your slave to operate within specific parameters allowed by the driver itself so head over to [The TasmotaSlave Library](https://github.com/andrethomas/TasmotaSlave) and install the library in your local Arduino development environment. The TasmotaSlave driver requires your slave to operate within specific parameters allowed by the driver itself so head over to the [TasmotaSlave Library](https://github.com/andrethomas/TasmotaSlave) and install the library in your local Arduino development environment.
Once installed you should be able to access the examples from the menu system: Once installed you should be able to access the examples from the menu system:
@ -69,7 +69,7 @@ Make sure you have the correct board and speed selected:
![Arduino Board Configuration](https://user-images.githubusercontent.com/470015/68074633-d36bcf80-fda5-11e9-8023-633ccba3e017.png) ![Arduino Board Configuration](https://user-images.githubusercontent.com/470015/68074633-d36bcf80-fda5-11e9-8023-633ccba3e017.png)
Now that everything is set its time to export the compiled binary by selecting it from the Arduino menu: Now that everything is set, it's time to export the compiled binary by selecting it from the Arduino menu:
![Export compiled Binary](https://user-images.githubusercontent.com/470015/68074653-1a59c500-fda6-11e9-89c2-fbab9f0471ae.png) ![Export compiled Binary](https://user-images.githubusercontent.com/470015/68074653-1a59c500-fda6-11e9-89c2-fbab9f0471ae.png)