Skip to content
sowmyasurampalli edited this page May 7, 2018 · 1 revision

Welcome to the Decentralized-Weather-Monitoring-System wiki!

Installation procedure:

  1. Clone or download the project zip file from the github repository in the following link. https://github.com/ujwalamanasa/AirPollutionMonitoring

  2. Install the apk file in your mobile phone.

  3. In the folders downloaded, copy the jsp files. Create a new project in the eclipse IDE with name as airmonitor and paste the two jsp files in the project.

  4. Place the .ino file in the arduino /home/username/Arduino. Make sure that libraries such as DHT11 and Pubsubclient are installed. If they are not installed, refer to the installations section above to install them.

  5. Open mysql using either terminal or phpMyadmin. 5.1. Opening mySQL using terminal, $ mysql -h localhost -u username -p And enter the password. 5.2. To open mySQL using phpMyAdmin, open http://localhost/phpmyadmin/ in the browser and enter username and password.

  6. Create database named as airmonitor.

  7. Create a table named ‘monitor’ with fields as location, temperature, humidity, smoke and timestamp with enough space to store characters. 20 is the recommended length of each field.

  8. Create a table named login to store login credentials as username, password, location, type (to store data of the user as general/admin ) and token. The token field requires length of 300 characters.

  9. Place the php files in the /var/www/html folder to make them host in the apache server.

  10. Now deploy the code on NODE MCU by connecting the DHT11 to D6 pin and MQ2 sensor to A0 pin.

  11. Turn on the MQTT server using the command and redirect the output to a text file. In the project case, the text file is named as ‘sample1.txt’ $ mosquitto_sub -v -t ‘output’>>sample1.txt

  12. Now run the python file using the command to move the data from text file to mySQL Database. $ python textToDatabase.py

  13. Switch on the apache server that has been installed. $ sudo systemctl restart apache2

  14. Reopen the eclipse IDE and start inbuilt tomcat server. Run either of the jsp files.

  15. Open the application in the mobile app and connect to the server with the ip address of the server, username and password. To determine the ip address of the server, in the server terminal use command as $ ifconfig

  16. Enter the ip address along with the port number of the tomcat server of eclipse IDE, which usually is 8080.

Clone this wiki locally