Code for accepting data from the sensors, packaging it, and uploading it to the server.
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
requirements.txt
serial_monitor.py

README.md

RaspberryPi

Code for accepting data from the sensors, packaging it, and uploading it to the server.

Launch with the command 'python serial_monitor.py

The USB Port will default to 'ttyUSB0' if none is specified or the USB port specified is invalid. The server will default to 'http://solarsunflower.herokuapp.com/dc/' if none is specified

While the listener is running, it reacts every time the JeeNode sends data successfully. It takes the data, converts it into a set of URL parameters, and sends a POST request to the URL.

Example URL: http://solarsunflower.herokuapp.com/dc?node_readings=[{"rainfall": "", "temp": "45", "soil2": "26", "soil3": "34", "soil1": "1", "voltage": "56", "id": "1"}]&site_id=1

(this will be encoded in a URL parameter-safe format).

To quit, Ctrl + C.

To set the site_id, modify the variable in the defaults section at the top of the file.

Useful Pi Links