Skip to content

fhopeman/puresec-handler-signal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

puresec-handler-signal Build Status

This microservice is part of the puresec ecosystem. It's supposed to be a handler which gives a signal to one of the gpio ports of the raspberry pi. The notifications are triggered by the master of the system.

Preconditions

First of all you need a raspberry pi with installed linux distribution.

Usage

Firstly, clone the repository to your rasbperry pi and change the directory to the created folder. To setup the microservice, you can use the ./bin/setupServer.sh script to install npm, node and other dependencies which are mandatory. If you run grunt successfully and all tests passing, you are ready to start the wiring.

Wiring

I'm using a standard LED which is turned on if a high value is given to the gpio pin (default pin is 7). A high value will be send to the pin, if the handler receives a message from the master to handle an alarm. The easiest wiring is the following: pin 7 -> LED -> resistor (e.g. 470 Ohm) -> 3.3V

Run the service

Run the following command to start the microservice:

node src/app.js

If you haven't configured your system to set gpio pins without root rights, you have to start the application with

sudo node src/app.js.

Options

Following options are configurable via env properties:

Property Description Default
MASTER_URL Url of the master server http://localhost:3000
NAME Name of the handler Signal Handler
DESCRIPTION Description of the handler
PORT Port on which the handler runs 3004
PIN Pin for LED/sirene/.. 7
TURN_OFF_DELAY Turn off delay 60

The start command with properties:

MASTER_URL="http://url/to/master:port" [some other properties] node src/app.js

Contribution

Feel free to contribute!

About

handler module which sends a signal to a gpio pin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published