Using an ESP8266 I am trying to find an example where leds can be controlled but also sensor data can be displayed.
Each function separately (led control or sensors readings) there are plenty examples but up to now I dit not find the combination.
Who has an example of this?
Hi.
In the Build Web Servers eBook, check project 4.4.
For something more basic, you can take a look at this tutorial: https://randomnerdtutorials.com/esp8266-web-server-spiffs-nodemcu/
Regards,
Sara
Dear Sara.
Thank you for your reply. I followed the example you mention of esp8266-web-server, but after some hours trying it does not work. I noticed follwing:
- to be sure the BME280 sensor works correctly, I made the example with BME280 (no buttons), that worked correctly so the sensor is ok
- I have Adruino IDE 1.8.15 using ESP8266 LittleFS Data Upload, this seems to work fine, but I can not use Flash Size: ” 4M (1MSPIFFS)” instead I select Flash Size: 4MB (FS:1MB OTA:~1019KB)”
- I have selected Board ” NodeMCU 1.0 (eSP-12E Module)” For other projects I always chose ” Generic ESP8266 Module” . Is this selection important to get it working?
I do not know what is wrong, maybe you have another hint for me?
Kind regrds,
Dick
After trying out LittleFS without success, I installed SPIFFS files, ESP8266FS-0.5.0.zip, place esp8266fs.jar in ..\Arduino\tools\ESP8266FS\tool\
Upload the files in directory data, using Arduino IDE (1.8.15) / Tools / esp8266 Sketch Data Upload
then use Board NodeMCU 1.0 (ESP-12E Module) and Flash Size: ” 4MB (FS:1MB OTA:~1019KB)”
Now it is working fine.
If anyone has information on using LittleFS for the same purpose, that is appricialted.
Regards, Dick
Hi.
You need to be a little more specific.
You mentioned ” I followed the example you mention of esp8266-web-server, but after some hours trying it does not work.” – what exactly does not work?
Do you get any errors during compilation or during the execution of the program? Where do you get the errors? What is exactly the issue?
That example uses SPIFFS. If you want to use LittleFS with that project, you need to change all mentions to “SPIFFS” in the code to “LittleFS”.
Regards,
Sara