Skip to content

Failed to open gpio chip on Ubuntu Core #67

Open

Description

@jpm-canonical

Beta version of snap, following Wiki:

$ sudo snap install matter-pi-gpio-commander --beta
matter-pi-gpio-commander (beta) 2.0.0 from Canonical IoT Labs installed
$ sudo snap set matter-pi-gpio-commander gpio=4
$ sudo snap connect matter-pi-gpio-commander:gpio-memory-control
error: snap "matter-pi-gpio-commander" has no plug named "gpio-memory-control"
$ sudo matter-pi-gpio-commander.test-blink
GPIO: 4
GPIOCHIP: 0
Failed to open gpio chip: /dev/gpiochip0

Release version of snap following docs:

$ sudo snap remove matter-pi-gpio-commander --purge
matter-pi-gpio-commander removed
$ sudo snap install matter-pi-gpio-commander
matter-pi-gpio-commander 1.1.0 from Canonical IoT Labs installed
$ sudo snap set matter-pi-gpio-commander gpio=4
$ sudo snap connect matter-pi-gpio-commander:gpio-memory-control
$ sudo matter-pi-gpio-commander.test-blink
GPIO: 4
Oops: Unable to determine board revision from /proc/cpuinfo
 -> No "Hardware" line
 ->  You'd best google the error to find out why.

Beta version following #60 - these steps work on Ubuntu Server 24.04 on Raspberry Pi 5, but not when using Core 24:

$ sudo snap remove matter-pi-gpio-commander --purge
matter-pi-gpio-commander removed
$ sudo snap install matter-pi-gpio-commander --beta
matter-pi-gpio-commander (beta) 2.0.0 from Canonical IoT Labs installed
$ sudo snap set matter-pi-gpio-commander gpiochip=4
$ sudo matter-pi-gpio-commander.test-blink
Unset or empty environment variable: GPIO
$ sudo snap set matter-pi-gpio-commander gpio=4
$ sudo matter-pi-gpio-commander.test-blink
GPIO: 4
GPIOCHIP: 4
Failed to open gpio chip: /dev/gpiochip4

System info

$ ls /dev/gpio*
/dev/gpiochip0  /dev/gpiochip2  /dev/gpiochip4  /dev/gpiomem1  /dev/gpiomem3
/dev/gpiochip1  /dev/gpiochip3  /dev/gpiomem0   /dev/gpiomem2  /dev/gpiomem4
$ cat /proc/cpuinfo 
processor	: 0
BogoMIPS	: 108.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x4
CPU part	: 0xd0b
CPU revision	: 1

processor	: 1
BogoMIPS	: 108.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x4
CPU part	: 0xd0b
CPU revision	: 1

processor	: 2
BogoMIPS	: 108.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x4
CPU part	: 0xd0b
CPU revision	: 1

processor	: 3
BogoMIPS	: 108.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x4
CPU part	: 0xd0b
CPU revision	: 1

Revision	: d04170
Serial		: <redacted>
Model		: Raspberry Pi 5 Model B Rev 1.0

Activity

  1. jpm-canonical commented on May 2, 2024

    @jpm-canonical
    ContributorAuthor

    Manually connection for gpio worked:

    $ sudo matter-pi-gpio-commander.test-blink
    GPIO: 4
    GPIOCHIP: 4
    Failed to request output line.
    Permission denied
    $ sudo snap connect matter-pi-gpio-commander:custom-gpio matter-pi-gpio-commander:custom-gpio-dev 
    $ sudo matter-pi-gpio-commander.test-blink
    GPIO: 4
    GPIOCHIP: 4
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    ^C
    

    Assertion file: https://pastebin.canonical.com/p/NpqPcyv3Jr/

  2. changed the title [-]Ubuntu Core 24 on Raspberry Pi 5 issues[/-] [+]Failed to open gpio chip on Ubuntu Core 24 / Raspberry Pi 5[/+] on May 2, 2024
  3. farshidtz commented on Jun 20, 2024

    @farshidtz
    Member

    The Custom GPIO interface doesn't auto connect on Ubuntu Core. See: https://forum.snapcraft.io/t/approval-and-auto-connection-for-custom-device-interface-on-matter-pi-gpio-commander/38891/7

    The workaround, as mentioned, is to connect manually:

    sudo snap connect matter-pi-gpio-commander:custom-gpio \
        matter-pi-gpio-commander:custom-gpio-dev
  4. SecondSkoll commented on Aug 19, 2024

    @SecondSkoll

    On Raspberry Pi 5, the custom-device plug is unavailable on the stable branch (v1.1.0) for both Ubuntu Server 24.04 and Ubuntu Core 24.

    skoll@ubuntu:~$ sudo snap install matter-pi-gpio-commander
    matter-pi-gpio-commander 1.1.0 from Canonical IoT Labs installed
    skoll@ubuntu:~$ sudo snap connections matter-pi-gpio-commander
    Interface            Plug                                          Slot           Notes
    avahi-control        matter-pi-gpio-commander:avahi-control        -              -
    bluez                matter-pi-gpio-commander:bluez                -              -
    dbus                 matter-pi-gpio-commander:otbr-dbus-wpan0      -              -
    gpio-memory-control  matter-pi-gpio-commander:gpio-memory-control  -              -
    network              matter-pi-gpio-commander:network              :network       -
    network-bind         matter-pi-gpio-commander:network-bind         :network-bind  -
    skoll@ubuntu:~$ sudo snap connect matter-pi-gpio-commander:custom-gpio
    error: snap "matter-pi-gpio-commander" has no plug named "custom-gpio"
    

    This gave the same error as jpm's second example when triggering the test blink.

    skoll@ubuntu:~$ sudo matter-pi-gpio-commander.test-blink
    GPIO: 4
    Oops: Unable to determine board revision from /proc/cpuinfo
     -> No "Hardware" line
     ->  You'd best google the error to find out why.
    

    However, the --beta branch (v2.0.0) worked for me on server 24.04:

    skoll@ubuntu:~$ sudo snap install matter-pi-gpio-commander --beta
    matter-pi-gpio-commander (beta) 2.0.0 from Canonical IoT Labs installed
    skoll@ubuntu:~$ sudo snap set matter-pi-gpio-commander gpio=4
    skoll@ubuntu:~$ sudo snap set matter-pi-gpio-commander gpiochip=4
    skoll@ubuntu:~$ sudo matter-pi-gpio-commander.test-blink
    GPIO: 4
    GPIOCHIP: 4
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    ...
    

    And the --beta branch (v2.0.0) worked for me on UC 24:

    secondskoll@localhost:~$ sudo snap install matter-pi-gpio-commander --beta
    matter-pi-gpio-commander (beta) 2.0.0 from Canonical IoT Labs installed
    secondskoll@localhost:~$ sudo snap connections matter-pi-gpio-commander
    Interface      Plug                                      Slot                                      Notes
    avahi-control  matter-pi-gpio-commander:avahi-control    -                                         -
    bluez          matter-pi-gpio-commander:bluez            -                                         -
    custom-device  -                                         matter-pi-gpio-commander:custom-gpio-dev  -
    custom-device  matter-pi-gpio-commander:custom-gpio      -                                         -
    dbus           matter-pi-gpio-commander:otbr-dbus-wpan0  -                                         -
    network        matter-pi-gpio-commander:network          :network                                  -
    network-bind   matter-pi-gpio-commander:network-bind     :network-bind                             -
    secondskoll@localhost:~$ sudo snap connect matter-pi-gpio-commander:custom-gpio \
                      matter-pi-gpio-commander:custom-gpio-dev
    secondskoll@localhost:~$ sudo snap connections matter-pi-gpio-commander
    Interface      Plug                                      Slot                                      Notes
    avahi-control  matter-pi-gpio-commander:avahi-control    -                                         -
    bluez          matter-pi-gpio-commander:bluez            -                                         -
    custom-device  matter-pi-gpio-commander:custom-gpio      matter-pi-gpio-commander:custom-gpio-dev  manual
    dbus           matter-pi-gpio-commander:otbr-dbus-wpan0  -                                         -
    network        matter-pi-gpio-commander:network          :network                                  -
    network-bind   matter-pi-gpio-commander:network-bind     :network-bind                             -
    secondskoll@localhost:~$ sudo snap set matter-pi-gpio-commander gpio=4
    secondskoll@localhost:~$ sudo snap set matter-pi-gpio-commander gpiochip=4
    secondskoll@localhost:~$ sudo matter-pi-gpio-commander.test-blink
    GPIO: 4
    GPIOCHIP: 4
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    Setting GPIO 4 to Off
    ^C
    
  5. farshidtz commented on Aug 19, 2024

    @farshidtz
    Member

    I've just promoted 2.0+chip-v1.3.0.0 from candidate to stable. The custom-device interface should now be available on stable, but a manual connection is still required on Ubuntu Core.

  6. SecondSkoll commented on Aug 20, 2024

    @SecondSkoll

    I can confirm the current steps in the documentation now work as described on UC24.

    secondskoll@localhost:~$ sudo snap remove matter-pi-gpio-commander --purge
    matter-pi-gpio-commander removed
    secondskoll@localhost:~$ sudo snap install matter-pi-gpio-commander
    matter-pi-gpio-commander 2.0+chip-v1.3.0.0 from Canonical IoT Labs installed
    secondskoll@localhost:~$ sudo snap set matter-pi-gpio-commander args="--passcode 1234"
    secondskoll@localhost:~$ sudo snap connect matter-pi-gpio-commander:custom-gpio \
                      matter-pi-gpio-commander:custom-gpio-dev
    secondskoll@localhost:~$ sudo snap set matter-pi-gpio-commander gpio=4
    secondskoll@localhost:~$ sudo snap set matter-pi-gpio-commander gpiochip=4
    secondskoll@localhost:~$ sudo matter-pi-gpio-commander.test-blink
    GPIO: 4
    GPIOCHIP: 4
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    Setting GPIO 4 to Off
    Setting GPIO 4 to On
    ^C
    
  7. changed the title [-]Failed to open gpio chip on Ubuntu Core 24 / Raspberry Pi 5[/-] [+]Failed to open gpio chip on Ubuntu Core 24[/+] on Aug 26, 2024
  8. changed the title [-]Failed to open gpio chip on Ubuntu Core 24[/-] [+]Failed to open gpio chip on Ubuntu Core[/+] on Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions