Giter VIP home page Giter VIP logo

tasmota-on-wemos's Introduction

Tasmota on WEMOS

Install Tasmota software on a WEMOS D1 mini (pro) with PlatformIO.

I assume you are familiar with the Sonoff-Tasmota software by Theo Arends. To get started do read the Sonoff-Tasmota wiki pages. This page is merely to help those who are trying to get the Sonoff-Tasmota software running on a WeMos D1 mini or WeMos D1 mini pro board.

Requirements:

Software Versions

  • Sonoff-Tasmota v5.1.3
  • PlatformIO IDE v2.0.0-beta3 | Core 3.4.0b3

WeMos Hardware used

  • WeMos D1 mini v2.1.0
  • WeMos D1 mini Pro v1.0.0
  • WeMos DHT11 Shield
  • WeMos Relay Shield
  • WeMos 1-Button Shield v2.0.0

I tested the Tasmota software with the DHT11-, Relay- and Button-shield but these are optional.

PlatformIO

Load the Sonoff-Tasmota base folder, including platformio.ini in PlatformIO.

Changes via the PlatformIO Home page:

  • Platforms: Install the platform "Espressif 8266".

Changes in the file platformio:ini

In platformio.ini we are going to add a new environment section and set the default environment to the newly created section.

First we create the new environment section.

  • Copy the first environment section named "sonoff".
  • Paste the section at the bottom of the file.
  • Name the new section "wemos-d1-mini".
  • Change the board type from esp01_1m to d1_mini.

The section should look like the following:

; WeMos (ESP8266 based)
[env:wemos-d1-mini]
platform = espressif8266
framework = arduino
board = d1_mini
board_flash_mode = qio
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMQTT_MAX_PACKET_SIZE=512
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON

The next step is to set the default environment to our newly created environment. In the [platformio] add the following line:

env_default = wemos-d1-mini

Your platformio.ini should look like this:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter, extra scripting
;   Upload options: custom port, speed and extra flags
;   Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/en/stable/projectconf.html

[platformio]
src_dir = sonoff
env_default = wemos-d1-mini

; Sonoff et al (ESP8266 based)
[env:sonoff]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = qio
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMQTT_MAX_PACKET_SIZE=512
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON

; Sonoff Touch and Sonoff 4CH (ESP8285 based)
[env:sonoff-touch-4ch]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMQTT_MAX_PACKET_SIZE=512
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON

; WeMos (ESP8266 based)
[env:wemos-d1-mini]
platform = espressif8266
framework = arduino
board = d1_mini
board_flash_mode = qio
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMQTT_MAX_PACKET_SIZE=512
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON

Change the user_config.h

Change the user_config.h to match your situation:

  • Set the WiFi SSID and WiFi password
  • Set the MQTT Username and MQTT password or disable MQTT

Build and Upload the firmware

Build and run the software. Make sure there are no errors in compiling and uploading.

Configure the Tasmota software

You can use a tool like fing or your wireless router to find the IP-address of your WeMos device.

The MAC-address starts with:

  • 5C:CF:7F for the WeMos D1 mini and
  • 60:01:94 for the WeMos D1 mini Pro

Open a browser and go to the IP-address of your WeMos device. You should be greeted with the familiar Tasmota configuration screen.

Set the device to "WeMos D1 mini" in the Configuration and save the configuration. The device will reset, just wait for it to return.

WeMos pins vs ESP8266 pins

The WeMos boards have a different pin layout than the ESP8266 layout used in the Tasmota software. The table below shows the correlation:

WeMos Pin Function ESP-8266 Pin
TX TXD TXD
RX RXD RXD
A0 Analog input, max 3.3V input A0
D0 IO GPIO16
D1 IO, SCL GPIO5
D2 IO, SDA GPIO4
D3 IO, 10k Pull-up GPIO0
D4 IO, 10k Pull-up, BUILTIN_LED GPIO2
D5 IO, SCK GPIO14
D6 IO, MISO GPIO12
D7 IO, MOSI GPIO13
D8 IO, 10k Pull-down, SS GPIO15
G Ground GND
5V 5V -
3V3 3.3V 3.3V
RST Reset RST

WeMos DHT11 Shield

WeMos D1 mini with DHT11

To configure the DHT11 shield we return to the Configuration screen. The DHT11 uses D4 on the WeMos and therefore GPIO2 on the ESP8266.

Set GPIO2 to DHT11 like below:

WeMos DHT11 on GPIO2

After saving the configuration and the required reset we should see the following screen:

WeMos DHT11 info in the configuration page

WeMos Relay and Button Shield

WeMos D1 mini Pro with relay and button

To configure the Relay and Button shield go to the Configuration screen. The Relay uses D1 on the WeMos and therefore GPIO5 on the ESP8266. The Button uses D3 on the WeMos, GPIO0 on the ESP8266.

Set GPIO5 to Relay and the GPIO0 to the Button:

WeMos Relay on GPIO5 and Button on GPIO0

Both the webinterface and the button can now be used to toggle the relais on and off.

tasmota-on-wemos's People

Contributors

tisgoud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tasmota-on-wemos's Issues

Needs update

It seems the latest version of Tasmota uses variables

[common] ; ************************************************************
; *** Esp8266 core for Arduino version
platform = [email protected]  ; v2.3.0
;platform = [email protected]  ; v2.4.0
;platform = [email protected]  ; v2.4.1
;platform = espressif8266

framework = arduino
board = esp01_1m
board_flash_mode = dout

; *** Fix [email protected] induced undesired all warnings
build_unflags = -Wall

build_flags =
  -Wl,-Tesp8266.flash.1m0.ld
  -DVTABLES_IN_FLASH
  -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
;  -DUSE_CONFIG_OVERRIDE

; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
monitor_baud = 115200

; *** Upload Serial reset method for Wemos and NodeMCU
;upload_speed = 115200
upload_speed = 512000
upload_resetmethod = nodemcu
upload_port = COM5

; *** Upload file to OTA server using SCP
;upload_port = user@host:/path
;extra_scripts = pio/strip-floats.py, pio/sftp-uploader.py

; *** Upload file to OTA server using HTTP
;upload_port = domus1:80/api/upload-arduino.php
;extra_scripts = pio/strip-floats.py, pio/http-uploader.py

; *********************************************************************
[env:sonoff]
platform = ${common.platform}
framework = ${common.framework}
board = ${common.board}
board_flash_mode = ${common.board_flash_mode}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags}
monitor_baud = ${common.monitor_baud}
upload_speed = ${common.upload_speed}
upload_resetmethod = ${common.upload_resetmethod}
upload_port = ${common.upload_port}
extra_scripts = ${common.extra_scripts}

This tutorial needs a update!

The following parameters have been changed what is the right value for Wemos d1 mini?

  • board_flash_mode (here qio in latest version dout)
  • build_flags (here -Wl,-Tesp8266.flash.1m0.ld -DMQTT_MAX_PACKET_SIZE=512 in the latest version -Wl,-Tesp8266.flash.1m0.ld -DVTABLES_IN_FLASH -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY)
  • lib_deps (has been removed?)

Upgrade to tsamota 6.2.1

I couldn't compile your version, but I managed to compile and upload version 6.2.1
There is not a specific module wemos in that version, how should I configure it for a somple relay? (I plan to do all control over MQTT)

Thanks

screenshot_2018-10-21 wemos - configure module

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.