# Node-RED access ROCK GPIO?

**URL:** <https://discourse.nodered.org/t/node-red-access-rock-gpio/77912>\
**Category:** General\
**Created:** [25 April 2023 10:38 UTC](https://discourse.nodered.org/t/node-red-access-rock-gpio/77912 "2023-04-25T10:38:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [25 April 2023 10:38 UTC](https://discourse.nodered.org/t/node-red-access-rock-gpio/77912/1 "2023-04-25T10:38:53Z")

</div>

Having established that the Raspberry Pi GPIO nodes won't work:

> [@Rock 4C+ - Raspberry Pi Specific Nodes?](https://discourse.nodered.org/t/rock-4c-raspberry-pi-specific-nodes/77876/2):
>
> I would not expect the GPIO nodes to work unless there is a python package called RPi.GPIO installed... - In reality you can install the extra nodes if you like - but they just won't work and take up that menu space... no harm either way - and it would let you edit flows from the Pi version if you needed to.

What would be the suggested/recommended way to access the GPIOs on a ROCK 4C+ (or similar)?

It looks like there is a `pyRock` to provide similar features to `rpi.GPIO`:

> [@Rock 4C+ - Raspberry Pi Specific Nodes?](https://discourse.nodered.org/t/rock-4c-raspberry-pi-specific-nodes/77876/3):
>
> Thanks. Looks like the equivalent on Rock is pyRock: [https://wiki.radxa.com/News/2014/10/pyRock-python-gpio-library](https://wiki.radxa.com/News/2014/10/pyRock-python-gpio-library) Am I correct that the "Pi-specific nodes" mentioned by the script are just the 4 nodes rpi-gpio-in, rpi-gpio-out, rpi-mouse, and rpi-keyboard ?

Some don't like it:

> **[ROC-RK3328 GPIO Node Red Raspbain](https://hub.libre.computer/t/roc-rk3328-gpio-node-red-raspbain/529/2)**
>
> rpi.GPIO is not a supported library due to poor coding and bad design. We recommend using libgpiod which is the de-facto Linux way of controlling all aspects of GPIOs. To get the proper chip and line numbers for use with libgpiod, we made a handy...

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [25 April 2023 11:52 UTC](https://discourse.nodered.org/t/node-red-access-rock-gpio/77912/2 "2023-04-25T11:52:50Z")

</div>

> [@Libre Computer](#):
>
> We recommend using libgpiod

It seems that `libgpiod` is available for the ROCK:

[https://wiki.radxa.com/Gpiod](https://wiki.radxa.com/Gpiod)

and there is a Node-RED node:

> **[node-red-contrib-libgpiod](https://flows.nodered.org/node/node-red-contrib-libgpiod)**
>
> A set of input and output nodes for controlling General Purpose Input and Outputs (GPIOs) though libgpiod (ioctl)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 June 2023 11:53 UTC](https://discourse.nodered.org/t/node-red-access-rock-gpio/77912/3 "2023-06-24T11:53:29Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
