UNPKG

homespun-grovepi

Version:

This is a Node.js module that reads sensors residing on a [Raspberry Pi](https://www.raspberrypi.org) and a [GrovePi+ Shield](http://www.dexterindustries.com/shop/grovepi-board/) and transcodes them to [TSRP](http://thethingsystem.com/dev/Thing-Sensor-Rep

119 lines (80 loc) 4.75 kB
# homespun-grovepi This is a Node.js module that reads sensors residing on a [Raspberry Pi](https://www.raspberrypi.org) and a [GrovePi+ Shield](http://www.dexterindustries.com/shop/grovepi-board/) and transcodes them to [TSRP](http://thethingsystem.com/dev/Thing-Sensor-Reporting-Protocol.html). You should review the [homespun root](https://github.com/mrose17/homespun) in order to understand home this repository fits into the homespun family. In brief, you need to be running a process on your home network that listens for TSRP traffic, and then feeds it to a server that listens for TSRP and uploads the sensor readings to the management cloud of your choice -- here's [my choice](https://github.com/homespun-wink). Note that this repository does not have the "Wiki" section -- if you want to discuss the homespun framework or homespun-grovepi, please send an email to the [maintainer](mailto:mrose17@homespun.io) requesting to be added to the [homespun team](https://homespun-io.slack.com). ## Installation The first step is to get a [Raspberry Pi](https://www.raspberrypi.org) and a [GrovePi+ Shield](http://www.dexterindustries.com/shop/grovepi-board/). (Note that there is an earlier version called the GrovePi shield -- no longer for sale; however, without loss of generality, the same instructions apply to both!) Once you have the RPi configured, you'll need to install software on your RPi that will talk to the GrovePi+ shield. You can find the QuickStart [here](http://www.dexterindustries.com/GrovePi/get-started-with-the-grovepi/), but here's the gist: First, gently mount on the GrovePi+ on the RPi, the pins should align exactly. Next, install the software: pi@raspberrypi ~ $ git clone https://github.com/DexterInd/GrovePi.git ... pi@raspberrypi ~ $ cd GrovePi/Script pi@raspberrypi ~/GrovePi/Script $ chmod +x install.sh pi@raspberrypi ~/GrovePi/Script $ sudo ./install.sh ... These commands may take a while, and (as of this writing) you'll be asked twice: Do you want to continue [Y/n]? Please be patient. When complete, your RPi will reboot. You can verify that everything installed OK, by running this command: pi@raspberrypi ~ $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- 04 -- -- -- -- -- -- -- -- -- -- -- ... At this point you might as well upgrade the firmware on the GrovePi+ to the latest: pi@raspberrypi ~/GrovePi/Firmware $ sudo ./firmware_update.sh ... The script may ask you to connect a jumper to the reset pin -- this is no longer necessary. You can check the firmware version by running: pi@raspberrypi ~/GrovePi/Software/Python $ python grove_firmware_version_check.py ('GrovePi has firmware version:', '1.2.2') Finally, here is the list of [supported sensors](http://www.dexterindustries.com/GrovePi/supported-sensors/). ## Programming The "preferred" language for programming the GrovePi+ is Python. However in the `GrovePi/Software` directory, you will find examples in C, C#, Go, Node.js, and Python. If you want to use the `homespun.js` script: pi@raspberrypi ~ $ cd homespun-master pi@raspberrypi ~/homespun-master $ npm -l install ... In the file `config.json`, there are several configurations: * the first configuration is an example of using a Grove Water Sensor connected to pin D7; and, * the second configuration, `the-kitchen-sink`, is purposefully incomplete -- it contains definitions for all the Grove sensors known to work with the `homespun.js` script. A configuration file is used to tell the `homespun.js` program which sensors are active, e.g., pi@raspberrypi ~/homespun-master $ node homespun.js --config name whatever.json ## Running pi@raspberrypi ~/homespun-master $ npm -l install ... pi@raspberrypi ~/homespun-master $ node homespun-grovepi.js Without any arguments, homespun.js will use the first entry in the file `config.json`. ## Not (Yet) Supported * [Grove - Alcohol Sensor](http://www.seeedstudio.com/wiki/Grove_-_Alcohol_Sensor) * [Grove - Barometer Sensor](http://www.seeedstudio.com/wiki/Grove_-_Barometer_Sensor) * [Grove - CO2 Sensor](http://www.seeedstudio.com/wiki/Grove_-_CO2_Sensor) * [Grove - Digital Light Sensor](http://www.seeedstudio.com/wiki/Grove_-_Digital_Light_Sensor) * [Grove - Dust Sensor](http://www.seeedstudio.com/wiki/Grove_-_Dust_Sensor) * [Grove - Luminance Sensor](http://www.seeedstudio.com/wiki/Grove_-_Luminance_Sensor) * [Grove - Tempture & Humidity Sensor (High-Accuracy & Mini)](http://www.seeedstudio.com/wiki/Grove_-_Tempture%26Humidity_Sensor_(High-Accuracy_%26Mini)_v1.0)