-
Notifications
You must be signed in to change notification settings - Fork 4
Documentation for the trafic light server
Vasileios Karavasilis edited this page Oct 24, 2015
·
2 revisions
The traffic light server consists of two parts.
The first part contains a LAMP server. The status (which lights are on) and the chain status (how light are turn on and off through time) are stored in a mysql database. In order to change the contents of the mysql the following php files exist:
- https://github.com/ellak-monades-aristeias/system-of-traffic-lights-and-raspberry-pi-for-air-quality-estimation/blob/master/src/raspberryServer/var/www/config.php : contains information about the mysql. It is included in every other php file.
- https://github.com/ellak-monades-aristeias/system-of-traffic-lights-and-raspberry-pi-for-air-quality-estimation/blob/master/src/raspberryServer/var/www/statusConfiguration.php : it is the main page of the web ui. If the user is not logged in, then it displays the login form. If the user is logged in, then it displays the configuration options (change password, status, etc).
- https://github.com/ellak-monades-aristeias/system-of-traffic-lights-and-raspberry-pi-for-air-quality-estimation/blob/master/src/raspberryServer/var/www/changePassword.php : if the user is not logged in, it displays a message that he must login. Otherwise, it displays a form in which the user can change its password. Moreover, it is responsible of changing the password in the database.
- https://github.com/ellak-monades-aristeias/system-of-traffic-lights-and-raspberry-pi-for-air-quality-estimation/blob/master/src/raspberryServer/var/www/viewStatus.php : this is the page that we can view and change the status. It has two parts. In the first part, there are the necessary controls that can insert a new status to the database. Moreover, this file is responsible in order to store the new record to the database. The second part, shows the status that are already stored in the database. This page is also responsible for deleting these status.
- https://github.com/ellak-monades-aristeias/system-of-traffic-lights-and-raspberry-pi-for-air-quality-estimation/blob/master/src/raspberryServer/var/www/viewStatusChain.php : this is the page that we can view and change the status chain. It has two parts. In the first part, the form for inserting a new status chain is displayed. Moreover, this file is responsible to insert the new chain into the database. In the second part, the status chains that are already inserted into the database are displayed. The file is also responsible for deleting these records.
- https://github.com/ellak-monades-aristeias/system-of-traffic-lights-and-raspberry-pi-for-air-quality-estimation/blob/master/src/raspberryServer/var/www/getStatus.php : this is the page that the traffic-light-clients use in order to get the status. It sends as a json string the current status.
The second part consists of the python program https://github.com/ellak-monades-aristeias/system-of-traffic-lights-and-raspberry-pi-for-air-quality-estimation/blob/master/src/raspberryServer/opt/trafficLight/traficLightServer.py. This program runs and periodically changes the current status in the database. So a client can get the current status from the database.