Difference between revisions of "Weather station (Server side) - Team 03"

From eLinux.org
Jump to: navigation, search
m (Added Image for Theory of Operation)
Line 138: Line 138:
This server also create a back up, in case of network failures.  
This server also create a back up, in case of network failures.  
== Theory of Operation ==
== Theory of Operation ==
[[File:Beagle_Theory_of_Operation.jpg|200px|thumb|left|alt text]]
== Work Breakdown ==
== Work Breakdown ==

Revision as of 04:47, 27 November 2015

Team members: Tushar Jain,| Sanjeev Khare, | Merlin sundar


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.

Executive Summary

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 open­source 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.

Equipment needed

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.

User Instruction

This server is almost completely automated. After installation you need power up the bone and make sure that it is connected to the network.

Installation Notes

Installing phant behind a proxy can be tricky.

Be sure to set npm proxy. Using

npm config set proxy npm config set https-proxy

also you might have to give proxy as a cmd argument as

npm --http-proxy= 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

export http_proxy=http://proxy:port export https_proxy=https://proxy:port

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

1.type in 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 : 1.type in 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: http://beaglebone.local:8080/input/PUBLIC_KEY?private_key=PRIVATE_KEY&test=testvalue

where beaglebone.local:port =, 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. https://github.com/MarkAYoder/BeagleBoard-exercises

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 features. 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.

This server also create a back up, in case of network failures.

Theory of Operation

alt text

Work Breakdown

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.

Current State


Future Work

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 https://docs.google.com/document/d/1ifBIIhB8_Ozc-dCVj4NCb9MSygaXBei5mNQ7AB_S9Zg/edit?usp=sharing.


Our google doc folder


Our Github repo


Prof. Mark A. Yoders github repo


Phant official website