• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Example reading sensors and controlling led's

Q&A Forum › Category: ESP8266 › Example reading sensors and controlling led's
0 Vote Up Vote Down
Dick van de Wetering asked 1 year ago

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?

Question Tags: led control, sensor data Wifi Access Point
4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

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

0 Vote Up Vote Down
Dick van de Wetering answered 1 year ago

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

0 Vote Up Vote Down
Dick van de Wetering answered 1 year ago

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
 

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

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

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.