Тёмный

ESP32 Web Server Tutorial with a BME280 Sensor 

educ8s.tv
Подписаться 124 тыс.
Просмотров 138 тыс.
50% 1

Welcome to another ESP32 video tutorial! In this video, we are going to build a simple HTTP Web Server on an ESP32 board with a BME280 sensor. We are also going to learn how to make some requests to it using a web browser. Subscribe for weekly videos ▶ bit.ly/33KIQ09
Hello, guys, I am Nick and welcome to educ8s.tv a channel that is all about DIY electronics projects. In this channel, I share everything about the projects I build to help you develop similar projects or inspire you to start making things because it is easy, fun and creative. Subscribe to the channel now if you do not want to miss any future video.
Today's project is this. An HTTP web server is running on this ESP32 board. If we open a Web Browser and make a request to the IP address of the ESP32, an HTML page will be loaded with the readings we get from the BME280 sensor. The values are updated once every minute. The BME280 sensor can measure the temperature, the humidity, and the barometric pressure and it communicates with the ESP32 using the I2C interface. Check the ESP32 Weather Station project for more information. The HTML page also enables us to control the state of an LED which is connected to the ESP32 board. We can set the state of the LED here and when we press the Submit button the state of the LED changes. How cool is that! In my opinion, this is a very useful functionality that it will enable us to build some very interesting projects in the future! Let's now see how to build this project.
💻 Code & Parts: github.com/edu...
👨‍💻 Check my new RU-vid channel: bit.ly/3tku2n0
🎮 My Android Game: bit.ly/QuizOfKn...

Опубликовано:

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 108   
@UpcycleElectronics
@UpcycleElectronics 6 лет назад
1:56 awesome little resistors storage container. I currently have an old portable cash/change container for most of my resistors but I need to store them by decade groups. I haven't seen your little solution before ;)
@PabloAymerich
@PabloAymerich 6 лет назад
I want that resistor box sooo bad , it was awesome!
@fvgoya
@fvgoya 6 лет назад
INDEED!
@r1273m
@r1273m 6 лет назад
I use an old plastic bag in which they are all thrown in together. Looks like a rat's nest but teaches you the colour code!!
@darrenp9454
@darrenp9454 6 лет назад
That resistor box is on Thingiverse.com.
@robertlongoria765
@robertlongoria765 3 года назад
I miss your well thought out videos. This one is very clear and well done.
@MaxSMoke777
@MaxSMoke777 6 лет назад
I like the idea of the web interface, but the lack of external network access makes it very limited. It's much more useful to use something like Thingspeak or Blynk, which can connect your devices to any computer or cellphone in the world, for control or monitoring. I personally use a Thingspeak widget on my Android phone to see the Temperature and Humidity of my home well I'm away.
@Perspectologist
@Perspectologist 6 лет назад
Nice tutorial. We used a similar project using MQTT on an ESP8266 to log room temperature and heat/AC duct output temperature at my office. We were able to prove there was an issue and have it quickly resolved by the landlord. Data is power!
@sebastianscala
@sebastianscala 6 лет назад
cool video - but you should add pull-up resistors to the I2C bus to make it work reliably. the ESP32 internal resistors are not sufficient.
@Educ8s
@Educ8s 6 лет назад
Thanks for the info! I am going to try it! Cheers!
@j.pierrelegare6969
@j.pierrelegare6969 10 месяцев назад
Well structured code so I could easily understand the webserver part and also adapt a DHT11 instead. Thanks!
@davebutler1264
@davebutler1264 Год назад
Thank you for this tutorial. You make it look easy! This could be very useful within the home. I am familiar with port forwarding, so I may try using it that way, sine it would bypass the need for an IoT server as the middle man!
@jtlusco
@jtlusco 6 лет назад
I get Could not find a valid BME280 sensor, check wiring! no matter what I do. I got the I2C address I set the pins. The BME280 works with an Arduino Nano but I cannot get it to work with your code Node MCU ESP32 I got it to work using P21 and P22 and uploading with the board set to Node32s. I found P21 and P22 are the I2C pins on the NodeMCU esp 32 for address 0x76 for anyone having issues.
@MrCardeso
@MrCardeso 6 лет назад
This is a cool little project. I think I may find a use for it in the future. Thanks!
@khimroy3958
@khimroy3958 6 лет назад
Hi Sir, my name is Roy Tan 👽 im from Singapore. Many thanks for the hard work of this esp8266 wifi project👍, i have do a modification in your circuit hardward and programming😊. I have change the temperature sensor to DS18B20, and the output LED i have change it to a 5Vdc relay. It work too😃 haha...thanks you Sir
@apangmui94
@apangmui94 3 года назад
Hi Nick, how can I set the static IP address? As such, I don't have to check the IP every time.
@gerardobriseno4473
@gerardobriseno4473 Год назад
Great video 👍
@hotrodmobile
@hotrodmobile 5 лет назад
4:12 after line 17 I waited for "THIS IS SPARTAAA!!!" ))) High! I love Greece.
5 лет назад
Excelente. Saludos desde El Salvador.
@fredflintstone8048
@fredflintstone8048 6 лет назад
Well done!
@AlexandreEglit
@AlexandreEglit 2 года назад
Really my very good friend. But it would be possible to make a mixture of the two systems. which has local visualization through the oled display and also by webserver... I'm counting on your help. With DHT11 or DHT22. Thanks
@RobertLopez66
@RobertLopez66 6 лет назад
I was wanting to make a project to control my sprinklers. I thought I had to use mqtt and a server. Could I use this instead? If so, would you consider showing how?
@pintaric007
@pintaric007 6 лет назад
Hi, nice video. What voltage do you have on VIN? I found out that it has to bo from 7-12 V. I put on Vin 5 V from phone accumulator battery but the bluetooth is then not working? The bluetooth is working only if I conect board thrue USB. Any advice?
@grumetenavegando
@grumetenavegando 5 лет назад
Thanks for your help. Do you know if the ESP32 web library is ready? I want to make a file on a server that collects the data from an SP32. Any ideas or videos to support me? Thank you.
@0124akash
@0124akash Год назад
This is a local area network based project ?
@xaradaa
@xaradaa 6 лет назад
Could you make a server automation, like send data to a web server with a data base and access anywhere, to control the system and get the data that the arduino/microcontroller generate.
@MPElectronique
@MPElectronique 6 лет назад
Hi. You should make a tutorial about uploading datas like gps data to thingkspeak... thank you. Marc
@kosa2004
@kosa2004 6 лет назад
I have a Wemos D1 mini that i dont use. I will try it out :)
@piotruszielinski6846
@piotruszielinski6846 6 лет назад
This code works only with ESP32. What changes are required to make it working with WemosD1 or ESP8266? Thanks
@MrHristoB
@MrHristoB 6 лет назад
Nice project.I was wondering if it would work with esp8266?
@sayantanmaiti2513
@sayantanmaiti2513 6 лет назад
Please show us a simple automation project where I can control my home appliances directly from my office....in one word..the port forwarding method
@squalazzo
@squalazzo 6 лет назад
just use this and look on google on how to do a port forward on your router on your own... no need for a new project...
@sayantanmaiti2513
@sayantanmaiti2513 6 лет назад
ok sir
@Educ8s
@Educ8s 6 лет назад
+Sayantan Maiti The procedure is different for each router so you have to find out how to make it work on your router by yourself. I wish I could make a video to help you with this
@sayantanmaiti2513
@sayantanmaiti2513 6 лет назад
thanks sir..
@GRBtutorials
@GRBtutorials 6 лет назад
Once you configure the port forwarding, you'll also need one of these: • A static public IP. • Dynamic DNS, like Dyn or NoIP. • An accessible web server (there may be services that allow you to do that).
@markpostlethwaite9672
@markpostlethwaite9672 4 года назад
it doesnt work for me. all i get is "invalid conversion from 'int' to 'SPIClass*' [-fpermissive]"
@РоманШептухов-о8ы
@РоманШептухов-о8ы 4 года назад
That's because you installed BME sensor library previously for Arduino-Uno-Nano-etc. You need to delete Adafruit_GFX_Library folder in your arduino path library/
@bannyspear
@bannyspear 6 лет назад
It can be accessible from external network?
@RobertLopez66
@RobertLopez66 6 лет назад
Please post Patreon link so people that request specific tutorials can sponsor them.
@fvgoya
@fvgoya 6 лет назад
I will pay for it.
@grindel80
@grindel80 6 лет назад
Good Video. But why you say distal pin instead of digital pin all the time?!
@MrBobWareham
@MrBobWareham 11 месяцев назад
I tried your code, but I get an error, Compilation error: invalid conversion from 'int' to 'SPIClass*' [-fpermissive], Any help would be good as your sketch looks interesting and would like to try it, Thanks Bob
@aaronchan1498
@aaronchan1498 5 лет назад
hi how does it interface with hmc5983?
@georgekot6377
@georgekot6377 6 лет назад
Another great and helpful tutorial. Νίκο, ξέρεις να μου πείς αν αγοράσω το esp32 απο το link που έχεις, το τελωνείο θα με σκίσει (με τα νέα μέτρα που έχουν βάλει) ??? Ρώταω γιατί κάποια "περνάνε" ενω κάποια άλλα "δέν περνάνε".
@Educ8s
@Educ8s 6 лет назад
+George Kot Ευχαριστώ φιλε για τα καλα σου λογια. Απο το banggood δεν θα εχεις θεμα τελωνειου με προιοντα μικρης αξιας. Θεμα θα εχεις αν παρεις κατι με αξια ανω των 100 δολαριων η με μεγαλο ογκο.
@MikeKranidis
@MikeKranidis 6 лет назад
Επέλεξε αν υπάρχει priority direct mail στο banggood. Σίγουρα ( τουλάχιστον μέχρι τώρα ) χωρίς τελωνείο...
@georgekot6377
@georgekot6377 6 лет назад
Σ'ευχαριστώ για την απάντησή σου. Θέλω να το αγοράσω απο το link γιατι είναι ο μόνος τρόπος για να υποστηρίξω τα πολύ ποιοτικά tutorial που μας χαρίζεις.
@MrBobWareham
@MrBobWareham 6 лет назад
Hi the project was very interesting I have seen a broker on a Raspberry Pi but was wondering if this ESP could run a Broker server for home automation instead of a Pi? thanks for your channel I have watched it for a long time and find it very interesting. Bob UK
@squalazzo
@squalazzo 6 лет назад
tech.scargill.net/mqtt-broker-on-an-esp8266/
@MrBobWareham
@MrBobWareham 6 лет назад
Thank you for the link I will have a look at it and thanks for your time Bob
@_who_cares_1123
@_who_cares_1123 6 лет назад
Can you post the thingiverse link for the resistor box?
@Educ8s
@Educ8s 6 лет назад
+E_404 Sure: www.thingiverse.com/thing:1617965
@_who_cares_1123
@_who_cares_1123 6 лет назад
Thank you so much :D
@mplenter9051
@mplenter9051 6 лет назад
Good job, and continue like that! Το κουτι που αποθηκευεις τις αντιστάσεις απο που το πειρες ρε συ! ωραιο και πρακτικο φαινετε. δωσε κανενα link. Thank you! Thumps up from me!
@Educ8s
@Educ8s 6 лет назад
+Mple Nter Here it is: www.thingiverse.com/thing:1617965
@mplenter9051
@mplenter9051 6 лет назад
educ8s.tv thanks my friend!
@browaruspierogus2182
@browaruspierogus2182 6 лет назад
Is it running bare-metal or some OS ?
@Educ8s
@Educ8s 6 лет назад
No, this chip does not run an OS as far as I know but you install one if you wish.
@MaxGoddur
@MaxGoddur 6 лет назад
Not sure if you entertain this type request on your channel if you prefer requests of this type are not made then please disregard this post. In need of a detailed video walking, no crawling, through the steps for several items related to the NodeMCU ESP8266. How to see what is loaded in the memory of the device. How to erase the contents of the memory. How to load different firmware, for example, MicorPython then back again to ESP8266 original firmware. List the tools for best carry out the listed items above. Discuss NodeMCU memory amounts used and why. Have seen discussion on 1Meg and 4Meg but not sure how they are implemented. Lastly, if you can dumb it down I am a hobbyist and started my journey down using IOTs a few months back and need all the hand holding I can get.
@dave-in-nj9393
@dave-in-nj9393 6 лет назад
I am with you but want the simple waling - difference between 8266 and 32. hardware pins for I2c. SPI, using multiple HW I2C and SPI... why some boards have so many more pins than others. etc
@deveshk5242
@deveshk5242 6 лет назад
I need a help can you make a web server with dht11 and nodemcu in ap mode
@mellee3436
@mellee3436 2 года назад
Random nerd tutorials will give you the idea how to make an esp32 ap.
@MPElectronique
@MPElectronique 6 лет назад
No more video ??
@ahmetaa1988
@ahmetaa1988 5 лет назад
The only thing you can do with an arduino or esp is weather station. is it everybodies dream.
@lazuardorramadhani9338
@lazuardorramadhani9338 6 лет назад
ESP32 to Thingspeak
@CiedJacaba
@CiedJacaba 4 года назад
Playback 0.5x
@franabet
@franabet 6 лет назад
Where is his accent from?
@paulmacgiollacaoine8619
@paulmacgiollacaoine8619 6 лет назад
He has a very Hellenic accent :)
@michaelpagalis1397
@michaelpagalis1397 4 года назад
Είσαι Έλληνας ;
@moamoa3303
@moamoa3303 5 лет назад
friend your video is good but please talk slowly and with lyrisme because your voice is so horrible ,i mean not your voice but you talk in one note ..
@gr7480
@gr7480 6 лет назад
Que pena no lo hagas en castellano.
@gerg6752
@gerg6752 Год назад
it looks so strange, tbh... function that concatenates full html page. bruh, you use wifi client, you use web server, you can just catch json from server. learn php, or java with its spring framework. its dirty coding
@Educ8s
@Educ8s Год назад
The web server is running on the esp board itself. No php no java nothing runs here.
@squalazzo
@squalazzo 6 лет назад
still waiting for some real use of the new advanced features of the esp32... no need on buying it for doing just these simple projects that could be done exactly the same with the much cheaper esp8266... now all you showed on video can be done with NO programming on an esp8266 with just flashing espeasy and using its web interface... 0 lines of code...
@GRBtutorials
@GRBtutorials 6 лет назад
"much cheaper" What is your definition of "much"? The difference is only about 3 €/$.
@squalazzo
@squalazzo 6 лет назад
GRBtutorials or, in other words, an esp32 is 3 times the price of an esp8266... To do what? The same things... Repeat: many youtubers are just changing the old for the new model, without ANY minimal use of the new features, but just because of the hype and the click bait...
@holetoanotheruniverse4690
@holetoanotheruniverse4690 6 лет назад
squalazzo Come on... Don't be so petty
@legoscratch
@legoscratch 6 лет назад
Lol, are you serious? The esp32 is MUCH faster and had two cores. Sure Bluetooth is still in development but the esp32 has many advantages over the previous esp8266 more ram, more io, 2 spi buses....
@squalazzo
@squalazzo 6 лет назад
try to read and actually UNDERSTAND what i wrote... i said that NONE of those publishing esp32 videos are REALLY using it for it's NEW functionalities... having them and not using them is WORTHLESS... what's the point of having a faster cpu with 2 cores, or bt, or more ram, or 2 spi buses, in a project like this? Clear, NOW? oh, look, i've a Ferrari! I use it to go on highways at 130km/h! Come on...
@georgetroulis
@georgetroulis 6 лет назад
I'm glad I stumbled upon this channel, you explain things fast but in a way that makes sense :) Φανταστική δουλειά Νίκο, keep up the good work!
@OttosTheName
@OttosTheName 5 лет назад
I just found your Channel and I've already binged a dozen video's. You just happen to do about every project I want to do, so thanks for all these video's :D This one was the first one I tried. The BME280 code werks perfectly, I just happen to have a very similar BME module that requires you to use I2C and your code helped me out. However the webserver code I couldn't get running. I installed the libraries, but I kept getting this error: 'class WiFiClass' has no member named 'enableSTA' I suspect they changed the Library or something.
@2112user
@2112user 3 года назад
Thank you for this video and sample code, was looking it over as I was watching the video. I'm learning or trying to learn exactly this for a project I'd like to build. You code and video have given me some direction, where I was at a total loss before. I do wonder, would you consider doing another video on this subject? One showing us how to input a value and then how to "inject" that number we entered into a sketch.... So that instead of the GPIO LED being a user (touch no/off), you can use one of the sensor values, and if it goes above or below a number you set on the screen, the light automatically does too.
@BakamonNO
@BakamonNO 6 лет назад
Hi Nick! Would you be able to teach us how to put this project into deep sleep mode please? I watched your deep sleep tutorial. But as you mention deep sleeps does not permit the use of void loop. So how would we go about writing this code in setup. And send the data to a web server?
@Mario-yp5pn
@Mario-yp5pn 8 месяцев назад
Juste a quick question my friend, is the temperature and humidity level displayed in real time or from time to time on the web page? Thanks
@MegaSkizzo83
@MegaSkizzo83 5 месяцев назад
Buonasera, bellissimo progetto, ottima la spiegazione, è possibile utilizzare una esp8266 invece della esp32?
@RDJunc
@RDJunc 3 года назад
Well done! Your enthusiasm is delightful! Keep up the good work. I am looking forward to a Bluetooth example using the ESP32.
@sarahmagdy1865
@sarahmagdy1865 2 года назад
Does this project require internet connection ? I mean can i use the esp32 as access point wifi and connect the mobile to this wifi and send the sensor's readings ? Thank you in advance
@plazmax
@plazmax 4 года назад
what about if you add blynk this project
@prathambhatnagar8653
@prathambhatnagar8653 6 лет назад
How can i make a program for a custom matrix display
@harfinbiu8502
@harfinbiu8502 6 лет назад
Sir, do you have a video about interfacing arduino with camera modul?
@antonios68
@antonios68 6 лет назад
coreography
@89pils
@89pils 6 лет назад
If you wanted to add another BME280 or multiple would you have to have a multiplexer with the ESP32?
@Educ8s
@Educ8s 6 лет назад
No, you can use two sensors at the same I2C bus, but the sensors must use a different I2C address.
@nathanas64
@nathanas64 5 лет назад
Outstanding!!!
@mansoormithaiwala509
@mansoormithaiwala509 5 лет назад
do we have to connect esp32 to wifi router for it to continuously transfer data to webserver??
@Educ8s
@Educ8s 5 лет назад
No
@avejst
@avejst 6 лет назад
Thanks for sharing 😀👍
@hafiznaimsahidi5132
@hafiznaimsahidi5132 4 года назад
What if we want to use the Modbus protocol. Do we need to change the entire code?
@marceloaguilarsanchez9414
@marceloaguilarsanchez9414 Год назад
I think would change the code, because it's a different protocol.
@Fillipser143
@Fillipser143 6 лет назад
Will you start making bigger projects?
@Educ8s
@Educ8s 6 лет назад
+Fillipser143 Sure, but big projects take a lot of time!
@EmmanuelVaripatis
@EmmanuelVaripatis 6 лет назад
Συγχαρητήρια για άλλη μια φορά.!!
@Educ8s
@Educ8s 6 лет назад
Ευχαριστώ πολύ!
@ytfp
@ytfp 6 лет назад
Nice but why the background music, its distracting.
Далее
ESP32 Web page creating and updating
32:11
Просмотров 160 тыс.
ESP32 Web Server - ESP32 Beginner's Guide
11:52
Просмотров 69 тыс.
ESP32 WebSocket Server
10:25
Просмотров 56 тыс.
Introduction to ESP32 - Getting Started
47:57
Просмотров 1,6 млн
ESP32 Deep Sleep Tutorial for Low Power Projects
8:14
Просмотров 187 тыс.