HowTo: ESPEasy – Compile firmware, flash and configure WLAN access data

In addition to many important hardware components, each project also consists of the appropriate software. It is often less time-consuming to assemble the project than to write the appropriate software later.

But this work can be saved thanks to some OpenSource projects. One of them is the often mentioned here Tasmota firmware. Another is the ESPEasy project.

ESPEasy is almost a kind of “operating system” for the ESP8266 microcontroller, which can be used to control and read out various sensors and actuators. A wide variety of sensors and actuators can even be linked together using simple rules.

Also many of the projects on Nerdiy.de are based on ESPEasy and a plugin that fits to the project.

A general procedure how to install ESPEasy and if necessary desired plugins on your ESP8266 is described in the following article.


Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/

Affiliate links/advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂 


Requirements

Helpful articles:
Before you start with this article you should have installed and configured the Arduino IDE. You can find information about this in the following article.
Install programs - an example
ArduinoIDE - Tips and Tricks

Required material:

In the following list you will find all the parts you need to implement this article.

Required tool:

In the following list you will find all the tools you need to implement this article.


Compile it yourself or not?

Basically there are two “different” ways to get the desired firmware on your ESP8266.

  1. You can compile the program code yourself (i.e. translate the program code into machine code) and transfer the resulting .bin file to the ESP8266.
  2. You can transfer already compiled .bin files directly to the ESP8266.

Both have advantages and disadvantages.

The advantage of 1. is that you can activate or deactivate all desired features. You have more configuration options, but of course more potential sources of error.

The advantage of 2. is that you can transfer working .bin files to the ESP8266 quite quickly. In most cases this is enough. Only in the case that you want to have more “control” over the individual firmware options should you choose the first option.

Nevertheless, this article describes the first way.

Way two is in the article ESP8266 – flash .bin files under Windows with the “Esptool”. described.


Copy the current ESPEasy version from the GitHub

To transfer the firmware to your ESP8266 you have to download it first.

This is on the one hand included in the GitHub of the original project, which you can find here:
https://github.com/letscontrolit/ESPEasy/tree/mega

There is also a mirrored version on the Nerdiy.de GitHub account, which you can find here:
https://github.com/Nerdiyde/ESPEasy

The advantage of the Nerdiy.de-ESPEasy version is that all plugins written by Nerdiy.de are already included and tested with the used ESPEasy version. So - if you want to use one of the Nerdiy plugins - you don't have to copy additional plugin files into the project. The disadvantage is that the ESPEasy version in the original git is probably newer.


Activate required plugins

Some ESPEasy plugins are not enabled by default. This way you can save the disk space for plugins that are not needed.

If you want to use these plugins, it is important that you “activate” them before compiling. To do this, switch to the corresponding plugin in the Arduino IDE.

There you will usually find something like “//#define USES_PXXX” shown relatively high up. If this part is commented out (i.e. preceded by two slashes), the corresponding plugin is also deactivated. To activate the plugin you just have to...
... remove the two preceding slashes. The part should then look as shown.

Flash firmware

To finally compile the firmware with the desired settings and transfer it to the connected ESP you first have to specify the configuration of your board.

To do this, click on “Tools” and adjust the settings according to your ESP. For a Wemos D1 MIni or similar ESP8266 versions you can use the settings shown.
To transfer the firmware to the ESP, just click on the marked arrow.

Configure WLAN access data

After you have transferred the ESPEasy firmware to your ESP8266, you have to connect it to your WLAN.

The ESPEasy firmware offers a practical function for this purpose. If there is no valid WLAN access stored on the respective ESP8266 with which the firmware can log into a WLAN, a separate WLAN will be opened automatically. You can then connect to this WLAN and provide the ESPEasy firmware with the login details for your “actual” WLAN.

In the following, this way is described with an Android cell phone. In principle, however, this also works with any other WLAN-enabled device that is also Internet-enabled. The process should be identical with an iOS device or a normal laptop.

First switch to the window in which you can configure your WLAN access. The still unconfigured ESPEasy device should already be switched on. Then you can also see a WLAN called “ESP_Easy-0”. This is the WiFi created by your ESPEasy device.
Now connect to this WLAN and use the access key “configesp”.
The connection process then takes a few seconds.
If you are connected, you may receive the error message “Internet may not be available”. This also makes sense because the ESP8266 (via whose WLAN you would actually access the Internet) is not connected to the Internet. For the current case, this is not a problem and you can ignore this error message.
Now switch to an Internet browser of your choice and open the website under “192.168.4.1”. This is the IP address of your ESPEasy device.
After a few seconds you will be redirected to the website shown. Here you will find a list of all radio networks in your area that are also received by the ESPEasy device.
Now select the desired radio network (preferably your own. 🙂 ) using the – unfortunately poorly visible – radio buttons on the left side of the respective radio network. Then enter the password for the selected wireless network in the lower text field next to “Password”. Once you have selected the correct settings, confirm the whole thing by clicking on the “Connect” button.

Your ESPEasy device will then restart and should connect to the selected WLAN after the restart.

You can recognize this, for example, by the fact that a new device is now present in your network. How you can display the devices in your network and also find out their IP address is described in the article Display/find out the IP address of the devices in the network described.

If you have entered the wrong WLAN access data, you can easily reset your ESPEasy device (i.e. reset it to factory settings). This will delete all settings - even if they are incorrect - and you can configure new correct access data in the same way as described above.
To reset your ESPEasy device to factory settings, simply execute the “reset” command. How to execute commands on an ESPEasy device is in the article ESPEasy - Execute commands and actions via HTTP, MQTT, UDP and directly described. Since you only have access to your ESPEasy device via the serial interface, this is the only way to execute commands on it.


Configuring WLAN access data via the serial interface

I personally find it easier to configure the WLAN access data via the serial interface. Most of the time you have flashed the ESP anyway and the serial connection is still active.

In this case you can use the command

Settings

display the currently saved settings and (if already connected to a WLAN) also the assigned IP address of the ESP.

You can now use the “WifiSSID” command to set the SSID of your WiFi access point. You first send the command and then the name of your WLAN access point, separated by a space. For example, if your WiFi is called “myTollesWLAN”, it would look like this

WifiSSID myGreatWLAN

For the password you need the command “WifiKey”. For example, if your password is “myGreatPassword”, the command to set it would look like this

WifiKey myToolPassword

It is important that you save the written settings afterwards. This is done with the command

Save

After that you can restart the ESP by entering the following command and it should connect to the configured WLAN access point afterwards:

restart

Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at ko-fi.com       

2 comments

  1. Hello,
    Many thanks for the many detailed instructions!
    Unfortunately, not everything is quite clear for the beginner, so please ask a few questions about the above instructions:

    1. Is uploading an *.ino file using the Arduino IDE identical to flashing one of the ready-made binaries offered? Then what would be the ESPeasy firmware file to upload to get the ESPeasy firmware onto the D1 mini for example? Where exactly can this *.ino file be found in the repository?

    2. Where exactly can you find the plugins when you have downloaded the whole linked folder from Github, which you can then deactivate / activate?

    3. Where in the ESPeasys firmware file should additional plugins be copied?

    Thank you very much for your effort!
    Best regards

    1. hey christian,
      Thank you very much for your good advice. Sometimes you become a bit “operationally blind” to the important questions. 🙂
      I will add the tips to the article. 🙂
      Best regards
      Fab

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.