After that, follow the next steps to create your database, username, password and SQL table. Preparing Your MySQL DatabaseĪfter signing up for a hosting account and setting up a domain name, you can login to your cPanel or similar dashboard. This allows you to easily access your ESP readings without relying on a third-party IoT platform. However, the purpose of this tutorial is to publish readings in your own domain name that you can access from anywhere in the world. Note: you can also run a LAMP (Linux, Apache, MySQL, PHP) server on a Raspberry Pi to access data in your local network. If you like our projects, you might consider signing up to one of the recommended hosting services, because you’ll be supporting our work. This is what makes this project interesting: you’ll be able to go your domain name () and see your ESP readings. When buying a hosting account, you’ll also have to purchase a domain name. Get Hosting and Domain Name with Bluehost » If you don’t have a hosting account, I recommend signing up for Bluehost. Any hosting service that offers PHP and MySQL will work with this tutorial. Those two services are the ones that I use and personally recommend, but you can use any other hosting service. I only recommended this option for advanced users. Digital Ocean : Linux server that you manage through a command line.I recommend choosing the unlimited websites option Bluehost (user-friendly with cPanel): free domain name when you sign up for the 3-year plan.I recommend using one of the following hosting services that can handle all the project requirements: Here’s a high level overview of the project: You can visualize the readings from anywhere in the world by accessing your own server domain. The goal of this project is to have your own domain name and hosting account that allows you to store sensor readings from the ESP32 or ESP8266. Hosting Your PHP Application and MySQL Database To see how the project works, you can watch the following video demonstration:ġ. PHP Script – Visualize Database Content in a Chart.PHP Script HTTP POST – Insert Data in MySQL Database.Hosting Your PHP Application and MySQL Database.The project is divided into the following main sections: ESP32/ESP8266 Plot Sensor Readings in Real Time Charts – Web Server.ESP32/ESP8266 Insert Data into MySQL Database using PHP and Arduino IDE.You might also find helpful reading these projects: PHP script to plot data from database in charts.PHP script to insert data into MySQL database and display it on a web page.ESP32 or ESP8266 programmed with Arduino IDE.To create this project, you’ll use these technologies: You can modify the code provided to send readings from a different sensor or use multiple boards. In summary, you’ll build an ESP32 or ESP8266 client that makes a request to a PHP script to publish sensor readings in a MySQL database.Īs an example, we’ll be using a BME280 sensor connected to an ESP board. In this project, you’ll create a web page that displays sensor readings in a plot that you can access from anywhere in the world.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |