Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sensetecnic/demo-pi-cloudgate
Raspberry Pi scripts and files to send data over serial to CloudGate
https://github.com/sensetecnic/demo-pi-cloudgate
Last synced: 13 days ago
JSON representation
Raspberry Pi scripts and files to send data over serial to CloudGate
- Host: GitHub
- URL: https://github.com/sensetecnic/demo-pi-cloudgate
- Owner: SenseTecnic
- Created: 2015-03-10T21:22:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-18T22:27:29.000Z (almost 10 years ago)
- Last Synced: 2024-03-26T17:19:28.969Z (10 months ago)
- Language: Python
- Size: 719 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
======================
Pi-to-Cloudgate-Sensor
======================This is an example python script that reads sensor data from a Raspberry Pi's GpIO and prints it to serial as a JSON object. By default this script is to be used with a CloudGate and is configured to print to the following serial port:
```
/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
```Dependencies
================This assumes you are using raspbian
* Raspbian OS running in your Raspberry Pi.
* Python >2.7 (sudo apt-get install python-dev)
* Adafruit's DHT-sensor-library (https://github.com/adafruit/DHT-sensor-library)
* RPi modules (sudo apt-get install python-rpi.gpio)Wiring up the Raspbery Pi
=========================This script takes input from:
* Pin 17: A DHT11 humidity and temperature sensor
* Pin 4: A light sensor (photoresistor)
* Pin 18: A button to be used to poweroff the Pi safely.The pi can be wired like this:
![alt tag](https://raw.github.com/sensetecnic/{projectname}/master/sensor-setup.jpg)
Running the script
==================You can run the script using:
```
sudo python wotkitdemo.py
```Running at boot
===============We provide a bash script named ``runwotkitdemo.sh'' you can use to deploy at boot. First create a log file named 'cronlog', in our case we have created it at ```/home/pi/wotkitdemo/logs```.
Then you can add the following line to your crontab via ```sudo crontab -e```, which will boot the
```
@reboot sudo sh /home/pi/wotkitdemo/runwotkitdemo.sh > /home/pi/wotkitdemo/logs/cronlog 2>&1 &
```