Weather station (Server side) - Team 03
This project is a part of larger project which aims at collecting, storing and analyzing weather related data of a given location, currently it is Mandi, H.P., India. This team has been tasked at maintaining a server to collect and to transfer data, from sensor team to display team.
The goal of this project was to build and deploy a remote data network to gather environmental data from around campus and display it on a standard web interface.
The server runs an opensource data gathering software, Phant and relays data to display team to be presented in graphical form on a web server (Plotly, Flot, Google Charts, Initial State, etc.).
The Phant currently works on port 8080. Data must sent to the server by visinting a url which has public key of the stream and field values in it.The data can be access at any time by visiting a link in many formats like csv, json and jsonp.
As mentioned above phat runs on port 8080, which is also the default port of apache server running on the beaglebone. Thus we had to shut down apache server to run phant. Phant has also been susceptible to crashing down when the network is probed with nmap.
Beaglebone to run a server on, Lan network and wifi adapter or wired connection or a system which has a port forwarded to the bone.
This server is almost completely automated. After installation you need power up the bone and make sure that it is connected to the network.
Installing phant behind a proxy can be tricky.
Be sure to set npm proxy. Using
also you might have to give proxy as a cmd argument as
npm --http-proxy=http://10.8.0.1:8080 install -g whatevef
You can also pass proxy as environment variables, as
npm npm_config_proxy http://proxy:port
Then install phant via npm package.
root@beaglebone:~# npm install -g phant npm http GET https://registry.npmjs.org/phant npm http <span class="m">304</span> https://registry.npmjs.org/phant
This should install phant on the bone.
You must also export the system proxy on your bone with
Make sure to export both http and https.
Post installation steps
You must stop apache running on 8080 and start Phant. for this
sudo service stop apache2
phant (command prompt)
phant starts up… phant http server running on port 8080 phant telnet server running on port 8081
You must create a stream on phat where data will be logged into. Note down the keys as you will need them later and you cannot re-generate them.
Creating Stream :
telnet beaglebone.local 8081 (command prompt)
phant> create Enter a title> Data_Test Enter a description> just_a_test Enter fields (comma separated)> temp,wind,rain,humidity Enter tags (comma separated)> weather data Stream created! PUBLIC KEY: ****** PRIVATE KEY: ***** DELETE KEY: *****
This creates a stream to log data.
A second and easier method is to the web gui provided in phant, which you can access by
Use the following step to log data to the server, you must enter this url on your web browser:
where beaglebone.local:port = 192.168.7.2:8080, if you are logging data to a bone connected directly to your system, otherwise if bone is connected to a network enter the ip of the bone on the network.
And to retrieve Data we used the following url: http://beaglebone.local:8080/output/PUBLIC_KEY.<enter your desire format>
If your bone is not connected directly to the network, then to directly log data to beaglebone via an unconnected host we used postForward.sh which forwards the port to a connected host in turn connecting the desired host to the bone. This script is provided in the link given below in setup directory. This provided by Prof. Mark A. Yoder.
The whole process can be automated by running a file which uses crontab, given here
Also this is the server side of project thus it does not play a very visible role in it, it does has its special The server which we have setup is completely automated. All end user has to do is to power it up and be sure to provide it a static ip on the network. Stream can be downloaded in various formats like JSON, CSV and JSONP. Also, the server takes care of unpredicatable crashes.
Theory of Operation
The theory is that the sensors will sense and get data which is pushed to the server( our BeagleBone) and which we send to any askers having a key. For example, a person who wants to make graphs for the data.
Installing, setting up phant and port forwarding over the network was done by Sanjeev Khare, b13266. Automating the whole process of starting the phant server when the bone was powered on and creating a back up was done by Tushar Jain, b13236.
We will then try to patch the nmap bug. Software to archive data so that it could be sent to display team needs to be investigated. Team Server This team of two students will look at the server that archives all the data. Currently the system uses Phant as the server, but there are other systems available. This team will discover what other options are available, install, test and evaluate them and recommend and implement one for the project. we may look into socket.io
Instruction to setup socket are provide here
Our google doc folder
Our Github repo
Prof. Mark A. Yoders github repo
Phant official website