An IoT project to send live local weather data gathered using Raspberry Pi's SenseHat to a remote database and display in an online dashboard at www.math.foodonya.com/iot Stack used: Python, Python external libraries, PHP, MySQL, Apache, Bootstrap, CSS, jQuery. This public repository must be used for non-commercial educational use only.
Clone this public repo to your local machine for your development and testing purposes.
- Some coding experience essential.
- XAMPP - Local web server. PHP comes with it.
- MySQL Workbench - Local database server.
- Any code editor. I used VS Code.
- Python - Latest version (or must be above 3.5).
- A web hosting account that supports PHP and MySQL.
- Raspberry Pi or similar.
- Sense Hat or similar.
- A Mac or PC for PHP, MySQL development. Python development can be done in Pi.
- Git of course, to clone this project.
- Python collects the SenseHat sensors' data and sends the data using POST request to the data_collector.php file in webserver.
- Data_collector.php is a backend file that writes the received data into a MySQL database, whenever a POST request is received.
- Iot_dashboard.php is the frontend file that periodically gets new data from the MySQL database and displays it in a dashboard. Iot_dashboard_tiles.php and conn_php_math_db.php are its helper files. Iot_dashboard.php is the file users will visit to see the weather data.
- Db_cleaner.php is for cleaning up the database once in a while to keep the database size smaller. This file works similar to Data_collector.php.
- PHP files will be served by your XAMPP local server.
- MySQL Database will be hosted in a live webserver's cPanel > phpMyAdmin
- MySQL Workbench serves this database locally for development.
- Python script runs in your IoT device. This was a Raspberry Pi connected with a SenseHat in my case.
- PHP files live in your webserver
- MySQL Database will be hosted in your webserver's cPanel > phpMyAdmin
- Python script runs in your IoT device. This was a Raspberry Pi connected with a SenseHat in my case.
Explaining deployment of this repo / project in both local and production environments is out-of-scope of this Readme page. However, there are plenty of resources available online posted by talented and generous IT community all around the world. Also, lots of comments were added through-out the code files for reading and understanding what is going on.
This public repository can be used for non-commercial and educational use only.
- Raja Palanivel - PHP, Python, MySQL, Bootstrap, CSS, jQuery, Git - Another project here: Foodonya.com
- Yavany Arumuga Raja - HTML, Bootstrap, CSS, Python - Year 7 Student.