node-red-node-iiotgw-gpiod

0.0.3 • Public • Published

node-red-node-iiotgw-gpiod

An alternative pair of Node-RED nodes to interact with IIot Gateway Controller GPIO using the PiGPIOd daemon that is now part of Raspbian.

The advantage is that it also talk to GPIO on a Pi that is remote as long as it is running the daemon, and also sharing pins works more cleanly as contention is handled by the multiple connections. This is also a good way to access GPIO when running Docker on a Pi as you can use the network connection to link out of the container to the PiGPIO daemon running on the host.

The disadvantage is that you must setup and run the PiGPIO daemon first.

Requirements

PiGPIOd must be running on the iiot gateway. The easiest way to ensure this is to add the following line to your iiot gateway /etc/rc.local file.

/usr/bin/pigpiod -x -1

See the instructions for more details.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

    npm install node-red-node-pi-gpiod

Usage

Input node

Can be used in Digital(1~8), soft-reset.

Outputs
  • msg.payload - number - the level of the pin (0 or 1)
  • msg.topic - string - GPIO{the pin number}

Output node

Can be used in Digital(1~4), sys-led, Buzzer.

Input
  • msg.payload - number | string - Digital - 0, 1 - set pin low or high

The initial value of the pin at deploy time can also be set to 0 or 1.

Package Sidebar

Install

npm i node-red-node-iiotgw-gpiod

Weekly Downloads

0

Version

0.0.3

License

Apache-2.0

Unpacked Size

28.1 kB

Total Files

6

Last publish

Collaborators

  • jinyistudio