For putting historical data into server and displaying a line chart of values of the same on client side
-
Extract THERM0001.rar file in the same directory
-
Go to ServerSide folder and start node.js server by typing
cd ServerSide
&nodemon
(NodeJS should be installed, if it isn't install it using sudo apt-get install nodejs) -
Start mongo client by
sudo service mongod start
andmongo --host localhost
, this ensures that mongo is running on localhost and the default port is 3000. -
Go to ClientSide folder and run the index.html to begin demo. The file "THERM0001.json" takes some time to get sent. Around 10-15 seconds maximum. After the popup "File Transferred" proceed with the demo.
-
To view the chart in getchart.html, give any start date and end date between Feb 2015 - Feb 2016 only. The dataset does not have values beyond these two dates.
-
Run the simulator.py file & keep it running indefinitely. This will send documents to the server at 10 second intervals.
-
To view the chart, open up realtime.html file in the ClientSide Folder. The initial chart takes 10 seconds to appear, after that the page is refreshed automatically to update the datapoints.
-
To stop simulation, stop the execution of simulator.py