Flashing SONOFF Tasmota Firmware on NodeMCU

92,103

29

19

Introduction: Flashing SONOFF Tasmota Firmware on NodeMCU

About: Loves Innovation, Technology, Gadgets and Caring People :)

Sonoff is a WiFi controlled switch which is embedded with ESP8266 IC and has relays to control the device via the Internet. This IC can be flashed and reprogrammed by Arduino IDE. The makers of Sonoff published the libraries and Arduino files on their GitHub page. Initially, it has only for Sonoff made boards only, after that it supports many ESP8266 boards and Development boards like NodeMCU. In this tutorial, we will see how to flash the Sonoff Tasmota Firmware into the NodeMCU development boards. In the new updated firmware, you can easily choose the different ESP8266 Boards easily.

Step 1: Components Needed - Prerequisites

Download the Sonoff Tasmota Firmware from this link.

Make sure you have the ESP8266 Library installed on your Arduino IDE. If you want to know how to install ESP8266 library properly visit this complete blog of Flashing SONOFF Tasmota Firmware on NodeMCU.

Step 2: Include Sonoff Libraries to Arduino IDE

Once the SONOFF Tasmota Firmware is downloaded from GitHub. Open the Sonoff Tasmota folder. Navigate to ‘lib’ folder and copy all the contents, then paste it into Arduino libraries’ folder on your computer.

Now we included the necessary library files into Arduino IDE Library. Let's configure our code.

Step 3: Sonoff Main File and User Config

Inside the downloaded file, Open the sonoff.ino file. It will open all the necessary files in next tabs in Arduino IDE. Now open the userconfig.h tab to enter our Wi-Fi Credentials.

Step 4: Configure SSID, Password and Project Name

Now edit the SSID and Password fields with your WiFi network SSID and Password. Also, give a unique project name by your choice in #define PROJECT “sonoff” line.

Eg. #define PROJECT “nodefactory”

Step 5: Choose the Correct NodeMCU Board

Now connect your NodeMCU and choose the correct COM Port and Board Version. Make sure the settings are like this for NodeMCU 1.0 Board.

Board: NodeMCU 1.0 (ESP12-E Module)

Flash Size: “4M(1M SPIFFS)

CPU Frequency: 80 MHZ

Upload Speed: “115200”

Then Flash the Firmware by clicking Upload.

Step 6: FInd NodeMCU IP Address on Your Network

Once Flashing is done Open Advanced IP Scanner . And search for the IP address inside your network IP. In my case, My IP will range from 192.168.255.0-255 (Means the IP will be range from 0-255). Click scan and you can see the project name you given in the userconfig.h file as device name here.

Note down the IP Address you found and paste it into your browser URL and click enter. It will show the Sonoff Tasmota page to configure your module.

Step 7: Configuration for ESP8266 Boards

By default, it will be in Sonoff Basic. So you need to change it to ‘Generic’ in ‘Configuration’ menu. Click ‘Configuration’ and inside that choose ‘Configure Module’.

Step 8: Save the Configuration

Select the board as Generic and Save. The device will restart. This option is for all ESP8266 boards.

Step 9: New GPIO Options According to the ESP8266 Board Types

Now if you click the configuration, then you can able to see more GPIO options. Using that you can select the GPIO Functions.

Depending on the GPIO setting the option will appear on the Homepage like DHT, Relay, Switch and Many more.

For more tutorials, visit our blog - Factory Forward Blog

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    19 Discussions

    0
    AmbroR
    AmbroR

    Question 4 months ago

    I am following the procedure: where is the sonoff.ino file please ?
    I am stuck here !
    Thanks

    0
    solamenpaul
    solamenpaul

    Answer 2 months ago

    there is an tasmota.ino in the tasmota folder that seems to be the one

    0
    richardsg307
    richardsg307

    Answer 3 months ago

    I found it in lib/esp-knx-ip-0,5,2/examples/sonoff. But it doesn't look like the one above and it doesn't load any other tabs so I'm stuck there. Are these instructions still current?

    0
    plbenn
    plbenn

    8 months ago

    Do I have to follow this procedure or will flashing with standard tasmota.bin using ESP Easy or Tasmotizer work?

    0
    RaimisB
    RaimisB

    1 year ago

    Maybe someone has a Tasmota ESP8266 connected to Thingsboard MQTT ?

    0
    PercyF
    PercyF

    Question 1 year ago

    yo want flash a nodemcu lolin with tasmota, with the 4ch pro configuration. i cant control the sd3 port. do you have any solution fot this?

    0
    thostie2002
    thostie2002

    2 years ago

    by verifying i get the following error : 'StaticJsonBuffer' was not declared in this scope

    what is the problem?



    not declared.PNG
    1
    enoe
    enoe

    Reply 2 years ago

    I had to downgrade the ArduinoJson library to 5.13.4 and it worked.

    0
    sgoel4
    sgoel4

    Question 2 years ago

    How do i get a created device into eWeLink?

    0
    Sarath341
    Sarath341

    Answer 2 years ago

    eWeLink app works only with Official Sonoff devices only. You can create your own using MIT App Inventor

    0
    DiegoR175
    DiegoR175

    2 years ago

    buenas tardes , anduvo de maravillas , como hago para configurar con la app ewelink ? diegorabbia@gmail.com , gracias

    0
    Sarath341
    Sarath341

    Reply 2 years ago

    Unfortunately you can't use eWelink app (even flashed this on Original SONOFF) with this firmware. Alternatively you can use many other apps for this like Blynk, MQTT Dash, IFTTT and Many more third party applications. Or You can create your own App using MIT App inventer. All you can do with is your IP Address that you can find with Advanced IP Scanner.

    0
    DiegoR175
    DiegoR175

    Reply 2 years ago

    El problema que tengo es que
    En off - enciende
    On - apaga
    0 - enciende
    1 - apaga

    Como invierto ?

    0
    factoryforward
    factoryforward

    Reply 2 years ago

    Are you testing it in D0 On Bord LED? Because in NodeMCU the D0 Pin LED is inverterd. If 0 it turns ON & 1 Turns OFF. Use other Pins.

    0
    DiegoR175
    DiegoR175

    Reply 2 years ago

    Muchas gracias !!

    0
    DIY Hacks and How Tos

    Great tutorial. Very well written. Thanks for sharing.

    0
    Sarath341
    Sarath341

    Reply 2 years ago

    Thank You :)