Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sensetecnic/demo-cloudgate
Scripts and configurations to send data to a WoTKit sensor using Option's CloudGate
https://github.com/sensetecnic/demo-cloudgate
Last synced: 28 days ago
JSON representation
Scripts and configurations to send data to a WoTKit sensor using Option's CloudGate
- Host: GitHub
- URL: https://github.com/sensetecnic/demo-cloudgate
- Owner: SenseTecnic
- Created: 2015-03-10T21:04:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-18T22:05:36.000Z (almost 10 years ago)
- Last Synced: 2024-03-26T17:19:29.843Z (10 months ago)
- Language: Python
- Size: 121 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
================
CloudGate Router
================This is a very simple script that posts data to a sensor in WoTKit using an Option Cloudgate (http://www.option.com/). Data is received as a JSON object in the serial port ```/dev/ttySP0```, and posted to ```/api/v2/sensors/{sensorname}/data```.
Dependencies
================* Python >2.7
Setting up Script
================Edit the wotkit_demo.py file and modify the following lines:
```
SENSOR_NAME = "your_sensor_name"
USERNAME = 'a_key_id'
PASSWORD = 'a_key_password'
```You can generate a key and password at: http://wotkit.sensetecnic.com/wotkit/keys. You can create a sensor to receive the data at: http://wotkit.sensetecnic.com/wotkit/sensors
Running Script
================To run the script run:
```
python wotkit_demo.py
```In any scripts you must run python directly from its location (found using ```which python```). In the CloudGate version of OpenWRT it lives in:
```
/rom/mnt/cust/usr/bin/python wotkit_demo.py
```Running at boot
================Use the provided "startwotkitdemo.sh" script to run your script. First, create a logfile, in our case we have created it at ```/root/logs```. Then, edit the ```/etc/rc.local``` file and add the following line:
```
sh /root/startwotkitdemo.sh > /root/logs/cronlog 2>&1 &
exit 0
```NOTE: The linux version running in the CloudGate is a proprietary version of OpenWRT, adding a ```@boot ...``` line using ```sudo crontab -e``` will not work.