This is a very simple application for controlling GPIO sensors on a Raspberry Pi. It uses node, Express and the OnOff package. Use at your own risk.
$ npm install express-pi-controller
- Controls any GPIO you have connected
- Config file to enable/disable every GPIO
- Button On/Off to enable/disable the app
- Status Led that shows if the app is enabled
- A web service API based on JSON
cd node_modules/express-pi-controller
sudo npm start
Then go to the http://127.0.0.1 in a web browser
Edit the file model\bcms.json
- BCM 17: Led
- BCM 18: Led
- BCM 24: Status Led
- BCM 25: Button
- "/:type(led|button|status_led)" -> Return JSON of enabled items
- "/:type(led|button|status_led)/:item(\d+) -> Return JSON of an specific item
- "/:type(led)/:item(\d+)/on" -> Switch on a led (obviously, only for leds).
- "/:type(led)/:item(\d+)/off" -> Switch off a led (obviously, only for leds).
- "/:type(led)/:item(\d+)/switch" -> Switch a led (obviously, only for leds).
The author of this module is Aaron Planell