Linux serverlinux web serverNETWORK ADMINISTRATIONS

ESP32 Send Temperature and Humidity Data to localhost XAMPP for Absolute Beginners Step by Step

In this tutorial video, you will learn how to send temperature and humidity data from an ESP32 microcontroller to a localhost XAMPP server using a simple PHP script. This video is specifically designed for absolute beginners who have little or no experience with programming and web development.

The video covers all the necessary steps in a step-by-step manner, including downloading and installing XAMPP, setting up the project folder, writing and testing the PHP script, and finally, sending fake data to the server using the ESP32 serial monitor.

Additionally, the video also explains the code used to send the temperature and humidity data from the ESP32 to the server and provides line-by-line explanations of the PHP script used to receive and store the data in a MySQL database.

By the end of the video, you will have a working system that can send and store real-time data from your sensors.

——————————————————————————————————————–
Buy On Amazon
——————————————————————————————————————–
1. ESP32 Espressif – https://amzn.to/3YCq2dS
2. DHT11 Temperature Humidity Sensor – https://amzn.to/421TIUD
3. Breadboard – https://amzn.to/3ysOvHX

——————————————————————————————————————–
Useful Video Links
——————————————————————————————————————–
Send DHT11 data to PHP MySQL Server

——————————————————————————————————————–
Social Media Links
——————————————————————————————————————–
GitHub:
https://github.com/ahmadlogs/
YouTube:
https://www.youtube.com/ahmadlogs?sub_confirmation=1

——————————————————————————————————————–
Download Code
——————————————————————————————————————–
https://github.com/ahmadlogs/xampp-esp32

——————————————————————————————————————–
Disclaimer
——————————————————————————————————————–
Disclaimer: All videos are for educational purposes and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.

Warning: I will use High Voltages which if incorrectly or improperly used could result in serious injuries or death. So be careful of what you are doing because I will take no responsibility for any of your actions.

Warning: In some countries it is required to register GSM module from govt authorities before using it. So, get proper understanding of govt laws related to GSM technologies.

#esp32 #dht11 #xamppserver

source

by Ahmad Logs

linux http server

33 thoughts on “ESP32 Send Temperature and Humidity Data to localhost XAMPP for Absolute Beginners Step by Step

  • httpCode: -1

    how i can solve this ???
    i think the program is no error.
    please help

  • Data : temperature= 50&humidity= 50

    23:40:25.663 -> httpCode : 200

    23:40:25.663 -> payload : <br />

    23:40:25.663 -> <b>Fatal error</b>: Array and string offset access syntax with curly braces is no longer supported in <b>C:xampphtdocsWeather_Station_Projecttest_file.php</b> on line <b>18</b><br />

  • @ALL There is an Mistake on 26:56 in this tutorial – the header must written BEFORE postData, not AFTER – Thats why the code doesnt't work at many people!! Connection to Database is succesful, but no Dataset is written. When you fix it, it will work properly!

  • Thanks for this video . For the one step google tell me that : the request URL was not found on this server . Why ? Btw i do correctly all your steps , but i don't know where is the probleme . Can u help me ?

  • Hello Ahmad,

    thank you very much for this tutorial which corresponds quite well to what I want to do. That is, to log the measurements of a JSY-MK-194T module in a MySql database. Thanks to you, I have all the keys to finalize what I've started.

  • Hi There. So i have a problem. due to the nature of the project i have to use an Arduino Mega and i can't find a HTTPClient library that works with your code… any sugestions where to find it? Needless to say i'm a noob with little experience on programming…

  • nice video , please can you provide us an example of a real time monitoring system based on dht11 , co2 gaz sensor mq135 and mq2 and a flame detector please i need some aid for my project

  • now, i know PHP is not dead, it so simple,powerful and once you installed XAMPP everything is there, thank you the video

  • Bonjour, voila enfin un vrais tuto .Merci pour ce temps passé pour cette réalisation. Après avoir réalisé ce projet, j'ai put refaire le même avec un capteur DS18B20 avec un esp8266 ( avec quelque modifications très simple bien sur ).Cela fonctionne parfaitement que ce soit avec XAMPP ou Lamp sur le PI. Continuez , vos vidéos son très intéressantes et riches d'informations. Pour ceux qui on cherché comme moi pour ce genre de projet, ne cherchez plus vous avez trouvé.

  • Can i use the same arduino ide code but use arduino uno rev4 WiFi , without esp32???

  • the code is good but it is not proceeding in sending the data in database. There is no error showed but it is not sending the data in database. How to solve that issue? thanks
    It just showed 'Database connection is ok' in payload no 'new record created successfully '
    help me pls

  • Hello everyone! 😀

    First of all, thank you so much for the video because it's been really useful. Your explanation is clear and accurate.
    Secondly, as well as many other users I had some problems to connect my ESP32 to my database but finally I have achieved it and I want to share what solved it:

    1. Related to the httpCode: -1
    error.
    In my experience… there are two situations related to the HTTPClient library. a) If you use an external library added from the Library Manager or creating directly the folder in the Arduino Libraries Files and pasting one from internet, it might have problems to work properly with the ESP32 and does not allow the connection to the DataBase generating that ErrorCode. I already have read the author's advises in the comments and try them, despite this it didn't work exactly (I even tried to disable my firewall, my code was the same to the video's and my WiFi data was correct), so… I attribute the problem to that reason and that lead us to the second situation b) at the beginning when you use the Boards Manager to install the ESP32 package, it appears a window which notifies that some extra files are required to finish the installation and asks you if you want to include them or not, you have to ACCEPT the request and in that way you'll be able to include the HTTPClient.h without problems and getting the connection without any other step.

    2. A particular situation, my ESP32 was connected to my database but the POST method did not work.
    With my httpCode solved being 200, my serial monitor only showed that the connection was OK but there was no message to indicate that the recording was successfully which meant that my conditional IF was never reached. At the beginning I tried to put some echos inside my IF conditional to see if it was working but no, so there was a tough problem to find the reason (maybe the library's POST method was wrong, my syntax had an error, etc etc). After a long investigation in the web and with other YouTube channels I found this video https://www.youtube.com/watch?v=vZFud1fEyCM where you can use the WiFiClient library to create at the loop's beginning an object called: "client" used in the function that we already have as follows: http.begin(client,URL); and just in case XD moving the: http.addHeader("Content-Type", "application/x-www-form-urlencoded"); before the POST method. And THAT'S IT! My ESP32 is recording data in my database properly.

    I'm not a native English speaker… in fact, the video I suggested is in Spanish so I hope my comment can help you, if you are in the same situation. Because it takes me a lot to finally complete the process
    Remember, if you have the chance to help others, do it. Because one day you could be at the other side. Let's be a better community everyday.

    Greetings from UPIITA México

  • Hi Friend,
    First let me say that your vide is very good and very easy to follow for a relative newcomer to PHP and Sql. It gives lots of steps and chances to confirm progress throughout the video.
    I have followed your video to the letter yesterday and all went great until the final step. I have a LAMP server set up on a Raspberry Pi4 and I am using an ESP32 to supply sensor data. The problem I am having is that the (postData) variable does not seem to be accepted by the server. I have tried with two tables in the same database and different types of data but with no success. When I monitor the output of the ESP all looks fine and matches your output exactly. I do get a connection response from the server but no data entry into the database. I have spent hours searching for a solution but I don't have the experience or knowledge to now exactly what I am looking at. I do hope you can help me. Thank you in advance.

  • Thank you so much for the above video sir, but is it possible to make the ESP as an access point instead of station mode

  • thanks a lot your videos is very helpful. However I have a little problem, the serial monitor prints 200 like you said and the websocket client received it well but the table that will store the data didn't create new record, also I refreshed the database but nothing showed what i might be making wrong?

  • Thanks for this video. Would it be possible to get the HTTPClient library?

  • call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)

    I am facing this error, please give solution

  • Can i ask sir? I have project to make controlling temperature use AC dimmer and monitoring use max31855k, is it possible to send t temperature data to database? Thanks

  • Sir, what if I want to change it from localhost to the original server or vps server? thanks.

  • one more thing is -1 or -11 Response code is received in between what is Reason for it??

  • Hello ,

    Actually using this library HTTPclient is the synchronous method, because data send through HTTP POST it stuck CPU for sometime.

    Can you give some Asynchronous method.

Comments are closed.