npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-opi-gpio

v0.0.7

Published

Orange Pi GPIO. Digital input/output for most Pi computers

Downloads

112

Readme

node-red-contrib-opi

Control I/O for Digital Pins

There are two nodes, one for output and one for input. These are Node-RED nodes that interface GPIO pins on Orange Pi boards as well as on other Pi's.

Background

These nodes are using the great onoff library, which includes the pins via the sysfs filesytem. Therefore, it should work on all platforms that support sysfs. Your system should have the path /sys/class/gpio/ and this directory should be populated. Watch for additional entries if node-red start flows using GPIO.

Additional Setup

Run node-red from console and watch for error messages. In order to use GPIO also as a standard user without root rights, some conditions have to be fulfilled.

  • The user group gpio must exist and the user must belong to this group.
  • The kernel must map gpio access to the user space, but this is not necessarily always the default behaviour.

User setup

To meet these requirements for user pi, run this commands as root: Check if user pi belongs to gpio:

$ groups pi

Otherwise, run this:

$ addgroup gpio
$ usermod -a -G gpio pi

If pi is not allowed to use GPIO now, additional steps are required:

Kernel Setup

Create a new file:

$ touch /etc/udev/rules.d/99-com.rules

copy this text to the file:

KERNEL=="gpio*", RUN="/bin/sh -c 'chgrp -R gpio /sys/%p /sys/class/gpio && chmod -R g+w /sys/%p /sys/class/gpio'" 

and do a reboot.

Remarks

This is tested on Orange Pi PC, Banana Pi M1, Banana Pi M2+ under Armbian. Compared to the solution, which is provided for Raspberry Pi, this way is much more efficient. The whole code runs direct in Node.js and uses kernel live support. But Raspberry Pi I/O nodes create for each pin an own shell and run a not so lightweighted Python process in it... If you have a new set of gpio pins tested at another Pi, feel free to send me a file with pin-number, pin and IO-port name which I can include to the setup.

g.prand(at)gmail.com

Release history

0.0.7 Added support for Active Low pin mode. Thank you, Stanislav Y.

0.0.6 Update dependencies

0.0.5 Added Orange Pi Zero Plus 2 (h5). Changed to the latest onoff library.

0.0.4
Wrong pin numbering corrected. Added pins to NanoPi Neo/Air. Section "other" now defaults to PA0 after initial selection.

0.0.3
Added some Pi's, changed interrupt initialisation and warning. If you upgrade your flows from 0.0.2, you should delete GPIO nodes and then add again.

0.0.2 First release