# Ubuntu Server 21.04 GPIO Not Working

**URL:** <https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947>\
**Category:** General\
**Created:** [13 September 2021 08:00 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947 "2021-09-13T08:00:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdazmir](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@mdazmir](https://discourse.nodered.org/u/mdazmir)\
**Post date:** [13 September 2021 08:00 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947/1 "2021-09-13T08:00:08Z")

</div>

Based on this [post](https://ubuntu.com/tutorials/gpio-on-raspberry-pi#1-overview), as of Linux kernel 5.11, the old methods of communicating with header pins on the Raspberry Pi no longer work. This means packages such as RPi.GPIO no longer function properly with newer kernels hence the [node-red-node-pi-gpio](https://flows.nodered.org/node/node-red-node-pi-gpio) is not functioning as well.

According to that post, a new package called LGPIO able to communicate with the header pins on the Raspberry Pi. I've installed it using the command below but it's not working within Node-Red:  
sudo apt install python3-lgpio

I assumed that this require a new Node that able to interact with LGPIO library. Can anyone point me to this Node as I'm not able to find it anywhere on the Net?

FYI, below is the specs that I'm currently using for my project:  
Hardware: Raspberry Pi 4 Model B Rev 1.2  
Operating System: Ubuntu Server 21.04  
Kernel: Linux 5.11.0-1017-raspi  
Architecture: arm64  
Node.js: v14.17.6  
Node-RED: v2.0.6

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [13 September 2021 08:11 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947/2 "2021-09-13T08:11:27Z")

</div>

Yes it will probably require a new node - or extensive rework of the old one... Something that I'm not aware of anyone having done. Is this something that will also affect RaspiOS ? What is their solution ?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 September 2021 10:22 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947/3 "2021-09-13T10:22:16Z")

</div>

In one article I found it said the the author of rpi.gpio was making changes to allow for this, but I haven't been able to find anything concrete.

---

<div class="post-metadata">

**Author:** ![sammachin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sammachin/32/5121_2.png) [@sammachin](https://discourse.nodered.org/u/sammachin)\
**Post date:** [13 September 2021 10:24 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947/4 "2021-09-13T10:24:52Z")

</div>

[https://github.com/jahudka/node-lgpio](https://github.com/jahudka/node-lgpio) Looks interesting, its a set of node bindings direct to the lg library, a new node based on this would avoid the need for the python installs

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [13 September 2021 11:12 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947/5 "2021-09-13T11:12:41Z")

</div>

does it manage to run without having to be root ?

---

<div class="post-metadata">

**Author:** ![mdazmir](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@mdazmir](https://discourse.nodered.org/u/mdazmir)\
**Post date:** [14 September 2021 02:46 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947/7 "2021-09-14T02:46:53Z")

</div>

I'm able to run it without being root. I followed this [tutorial](https://ubuntu.com/tutorials/gpio-on-raspberry-pi#3-basic-gpio-example) and manage to run the script using the default user (ubuntu)

---

<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:** [13 November 2021 02:47 UTC](https://discourse.nodered.org/t/ubuntu-server-21-04-gpio-not-working/50947/8 "2021-11-13T02:47:10Z")

</div>

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