Troubleshooting basic ESP8266 issues

You may run into some issues when using the ESP8266's advanced functions. We will list some of the common problems that many people face and some ways of troubleshooting them.

The Arduino IDE does not show the OTA port

There are three scenarios in which this could happen:

  • The ESP8266 board has not successfully connected to the Wi-Fi network
  • The firewall is blocking your Arduino IDE from accessing the OTA port
  • The Arduino IDE needs a restart

To solve the issue, start by restarting the Arduino IDE. If that does not work, troubleshoot the first scenario by checking whether the ESP8266 IP address was displayed on the serial monitor after uploading the OTA code. If it wasn't, check the Wi-Fi credentials in your sketch and make sure they are correct.

If all that does not work, try changing the firewall settings on your computer, so that it allows the Arduino IDE to access Wi-Fi network features.

The library no longer compiles

This sometimes happens after updating libraries. It can be solved by deleting the library in question and reinstalling the ESP8266 core using the board manager.

The txt file in my filesystem only holds one value even after saving several values in it

This is caused by the use of the wrong file access mode of the SPIFFS open function. When you use w or w+ as the file access mode, it clears the file every time you open it. That way the only available data in the file is what you saved last. Instead of using w or w+ file access modes, you should use a or a+. In these file modes, any data that is added to the file is appended, at the end of file, to the already existing data. Therefore, the function should look like this:

SPIFFS.open("/filename.txt", "a");

Instead of like this:

SPIFFS.open("/filename.txt", "w");
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.145.114