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

Each project consists not only of many important hardware components but also of the appropriate software. It is often less work to assemble the project than to write the appropriate software later.

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

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

Many of the projects on Nerdiy.de are also based on ESPEasy and a plug-in for the project.

A general procedure for how to install your ESPEasy and any desired plug-ins on your ESP8266 is described in the following article.

Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂


Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/en/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 shop via this link, Nerdiy.de receives a commission from the online shop or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂


Requirements

Helpful Articles:
Before you start with this article, you should have the Arduino IDE installed and configured. Information on this can be found 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 tools:

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 (= translate the program code into machine code) and transfer the resulting .bin file to the ESP8266.
  2. You can transfer a pre-compiled .bin file directly to the ESP8266.

Both way have advantages and disadvantages.

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

The advantage of 2. is that working .bin files can transfered quite fast to the ESP8266. In most cases this is sufficient. Only in the case that you want to have more “control” over the individual firmware options is the first way to choose.

Nevertheless, the first way is described in this article.

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


Copy the current ESPEasy version from the GitHub

To be able to transfer the firmware to your ESP8266, of course you have to download it first.

This is 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 have been tested with the ESPEasy version used. If you want to use one of the Nerdy plugins, you do not have to copy any additional plugin files into the project. The disadvantage is that the ESPEasy version in the original Git is probably newer.


Enabled required plugins

Some ESPEasy plugins are not enabled by default. In this way you can save the storage space for unneeded plugins.

If you want to use these plugins, it is important that you “enable” them before compiling. Switch to the Arduino IDE in the appropriate plugin.

There you will usually find something relatively high up like the one pictured “//#define USES_PXXX”. If this part is commented out (that is, preceded by two slashes), the corresponding plugin is also disabled. To activate the plugin you just have to …
… remove the two preceding slashes. The part should then look like the in picture.

Configure WLAN access data

After transferring the ESPEasy firmware to your ESP8266, you will need to connect it to your WiFi.

The ESPEasy firmware offers a practical function for this purpose. If no valid WiFi access has been stored on the respective ESP8266 with which the firmware can log into a WiFi, then a separate WiFi will automatically be opened. With this WiFi you can then connect and communicate with the ESPEasy firmware and enter the login data to your “actual” WiFi.

The following describes this way on an Android phone. In principle, this also works with any other wireless-enabled device that is also Internet-enabled. The operation should be identical to an iOS device or normal laptop.

First, switch to the window in which you can configure your WiFi access. The unconfigured ESPEasy device should already be switched on. Then you can also see a WiFi called “ESP_Easy-0”. This is the WiFi created by your ESPEasy device.
Now connect to this WiFi using the access key “configesp”.
The connection process then takes a few seconds.
If you are connected, it may happen that you receive the error message “Internet may not be available”. This also makes sense, because the ESP8266 (on whose WiFi you would actually access the Internet now) is not connected to the Internet. For the current case that 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 depicted website. Here are all the wireless networks in your area listed that also received by the ESPEasy device.
Now select with the – unfortunately badly visible – radio buttons on the left side of the respective radio network the desired (preferably your own. :)) wireless network. Then enter the password for the selected wireless network in the lower text box next to “Password”. If you have selected the correct settings you confirm this by clicking on the “Connect” button.

Your ESPEasy device restarts and should connect to the selected WLAN after the reboot.

For example, you recognize that there is a new device in your network. You can find out by checking the devices in your network. How to do this is described in the article “Displaying/finding the IP address of the devices in the network“.

If you have entered the wrong WiFi-access data you can easily reset your ESPEasy device (=reset to factory settings). This deletes all – also possible incorrect – settings and you can configure new correct access data in the same way described above.
To reset your ESPEasy device to factory settings it is sufficient to execute the command “reset”. How to execute commands on an ESPEasy device is described in the article ESPEasy – Commands and actions via HTTP, MQTT, UDP and direct execution. Since you only have access to your ESPEasy device via the serial interface, unfortunately you only have the possibility to execute commands on this way.


Configure WiFi access data via the serial interface

I personally like it more to configure the WiFi access data via the serial interface. Most of the time the ESP was flashed anyway and the serial connection is still active.

In this case, you can use the command

Settings

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

With the command “WifiSSID” you can now set the SSID of your WiFi access point. You send the command first and then the name of your WiFi access point separated by a space. If your WiFi is called “myGreatWiFi” for example, this would look like this

WifiSSID myGreatWiFi

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

WifiKey myGreatPassword

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

save

Then you can restart the ESP by entering the following command and it should then connect to the configured WiFi access point:

restart

I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

Fab

P.S. 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 appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at ko-fi.com

2 comments

  1. Hallo,
    vielen Dank für die vielen, ausführlichen Anleitungen!
    Dennoch ist leider für den Einsteiger noch nicht alles ganz klar, daher bitte ein paar Fragen zu obiger Anleitung:

    1. Ist das Hochladen einer *.ino-Datei mittels der Arduino IDE identisch mit dem Flashen einer der angebotenen fertigen Binaries? Welches wäre dann die hochzuladende ESPeasy-Firmware-Datei, um die ESPeasy Firmware z.B. auf den D1 mini zu bringen? Wo genau ist diese *.ino-Datei im Repository zu finden?

    2. Wo genau findet man die Plugins, wenn man sich den ganzen verlinkten Ordner aus Github geruntergeladen hat, die man dann de- / aktivieren kann?

    3. Wo müssten in der ESPeasys-Firmware-Datei ggf. zusätzlich zu nutzende Plugins hineinkopiert werden?

    Vielen Dank für Deine Mühen!
    Mit freundlichen Grüßen

    1. Hey Christian,
      vielen Dank für deine guten Hinweise. Manchmal wird man dann doch etwas “Betriebsblind” für die wichtigen Fragen. 🙂
      Ich werde die Tipps noch in den Artikel einbauen. 🙂
      Beste Grüße
      Fab

Leave a Reply

Your email address will not be published. Required fields are marked *