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.
There are three scenarios in which this could happen:
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.
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.
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");
18.118.145.114