-
Notifications
You must be signed in to change notification settings - Fork 1
Arduino IDE
How to setup and configure Arduino IDE for Tasmota compilation and upload.
- Download Arduino IDE from https://www.arduino.cc/en/Main/Software
I prefer a dedicated standalone version of the IDE allowing easy ESP8266 file manipulation and library management. This can be achieved by downloading the Arduino IDE ZIP file for non admin install.
- Windows: Unzip the installation file to a known folder.
- Mac: Move the .app file into your Applications folder.
IMPORTANT: For Windows users, before executing arduino.exe add an empty folder called portable in the known folder.
- Open Arduino IDE and select
File
→Preferences
(Arduino
→Preferences
on Mac) and add the following text for field Additional Boards Manager URLs:http://arduino.esp8266.com/stable/package_esp8266com_index.json
and select OK. - Open
Tools
→Boards...
→Boards Manager...
and scroll down and click on esp8266 by ESP8266 Community. Click the Install button to download and install the latest ESP8266 board software. Select Close.
- Download the latest Tasmota release Source code from https://github.com/arendst/Sonoff-Tasmota/releases and unzip to another known folder.
- If not available copy from the Tasmota release Source code folder arduino\version 2.3.0\tools\sdk\ld file eagle.flash.1m0.ld to Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.3.0\tools\sdk\ld.
- Replace in Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.3.0 file boards.txt with the Tasmota Source code file arduino\version 2.3.0\boards.txt.
Remove default compile options for floating point printf
and scanf
which are not being used by Tasmota and save 15k code space.
- Replace in Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.4.0 file platform.txt with the Tasmota Source code file arduino\version 2.4.0\platform.txt.
Remove default compile options for floating point printf
and scanf
which are not being used by Tasmota and save 15k code space.
- Replace in Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.4.1 file platform.txt with the Tasmota Source code file arduino\version 2.4.1\platform.txt. https://github.com/arendst/Sonoff-Tasmota/tree/development/arduino/version%202.4.1
- Copy all files from the Tasmota release Source code folder lib into your sketchbook\libraries folder.
- Copy the Tasmota release Source code folder sonoff to your sketchbook.
- Note: your sketchbook location can be found in the Arduino IDE preferences, default on the Mac is
~/Documents/Arduino
.
- Select
Tools
and verify the following settings for All Tasmota devices.
Tasmota release Source code provides scripts to be installed in the Arduino IDE and your webserver to copy the compiled binary to your webserver. This webserver can then provide the firmware via OTA to the device.
- If not available install PHP on your webserver and copy the Tasmota release Source code folder api to the root of your webserver.
- If not already done in the previous steps replace in Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.3.0 file boards.txt with the Tasmota Source code file arduino\version 2.3.0\boards.txt.
- Replace in Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.3.0 file platform.txt with the Tasmota Source code file arduino\version 2.3.0\platform.txt.
- Copy from the Tasmota release Source code folder arduino file espupload.py to Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.3.0\tools and change in the script HOST_ADDR to point to your webserver ip address.
After restarting your Arduino IDE you now have an extra option for Tools
- Upload Using: "OTA_upload"
.
Open Arduino IDE and select file sonoff.ino from your sketchbook\sonoff folder.
- Compile Tasmota with
Sketch
-Verify/Compile
.
Arduino IDE 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.
In the following commands I use COM5 as an example.
Before using Arduino IDE upload make sure you know to which serial interface name your device is connected to.
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.
- Make the correct serial interface selection in the Arduino IDE via
Tools
-Port: "COM5"
. - Upload the compiled firmware with
Sketch
-Upload
.
NOTE: For a proper device initialization after first firmware upload power down and power up the device.
If a webserver is available you can upload the compiled firmware using optional scripts and prepare it for OTA download by any Tasmota device using the MQTT upgrade 1
or upgrade 5.1.2
command.
- Make sure that
Tools
-Upload Using: "OTA_upload"
is selected. - Upload the compiled firmware to the OTA server with
Sketch
-Upload
.
Home | Wiki | What's new | Tutorials | FAQ | Troubleshooting | Button usage | Commands | Rules
Home
Theo's Tasmota Tips
What's New
Getting Started
Upload tools
- SonOTA
- OTA over SCP
- Esptool
- Arduino IDE
- PlatformIO
- PlatformIO CLI
- Visual Studio Code
- Python HTTP OTA server
- Node Red OTA server and firmware manager
Usage
- Button Functionality
- MQTT Features
- Supported Commands
- Using Rules
- Sensor Configuration
- PowerOnState Configuration
- SwitchMode/SwitchTopic
- Button Multipress
- Energy Saving
- KNX Features
- Misc. Tips
Devices - Additional Info
- Sonoff Basic
- Sonoff SV
- Sonoff S20 Smart Socket
- Sonoff S26 Smart Socket
- Sonoff Dual / Dual R2
- Sonoff 4CH / 4CH Pro
- Sonoff RF and Slampher
- Sonoff RF Bridge 433
- Sonoff Pow / Pow R2
- Sonoff Touch
- Sonoff T1
- Sonoff B1 / B1 R2
- Sonoff iFan02
- Sonoff SC
- Sonoff PSA
- Sonoff S31
- Shelly 1 and 2
- Wemos D1 R1 & R2
- Wemos D1 Mini
- HuaFan Smart Socket
- Hyleton-313 Smart Plug
- MagicHome LED controller
- H801
- Arilux LC02
- SP108E LED controller
- Blitzwolf SHP2
- Tuya Dimmer
- PS-16-DZ Dimmer
- Armtronix Dimmers
- Other Devices
- retired
Home Automation Integration
- OpenHAB
- Home Assistant
- Domoticz - Manual configuaration
- Domoticz - Automatic discovery
- HomeBridge
- HomeSeer
- SmartThings
- IP-Symcon
- IOBroker
- TasmoAdmin
- Alexa
- Yeti
- NodeRed Examples
- Securing your Setup
Other Integrations
Further Topics
- MQTT Overview
- Remote Button
- Modified Kaku
- PZEM004T Energy Monitor
- IR Extension
- S20 sensor
- Wiring additional things to a module
- Sonoff Basic DHT11 Wiring
- Expand Sonoff 4CH with jack plug
- Defining new module types
- GPIO Locations
- JSON Status Responses
- Expand Sonoff Basic to 4MB Flash
- Time Proportioned Output support
- PID Control with Sonoff Devices
- Sensor-API
- Sensors Supported by Tasmota
- Syslog Setup
ESP32
Misc