Skip to content

Matter Raspberry Pi GPIO Commander - Turn your Pi into a Matter lighting device!

License

Notifications You must be signed in to change notification settings

canonical/matter-pi-gpio-commander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matter Pi GPIO Commander

matter-pi-gpio-commander

This small application can turn your Raspberry Pi into a Matter lighting device. Once setup and commissioned, it allows control of a configured GPIO pin via Matter on/off commands. The GPIO output can be used switch an LED or another device via a relay.

The application is based on CHIP's Linux Lighting App example. It uses the character device API to control the GPIO of Raspberry Pi.

Hardware Compatibility

This snap is expected to work on the following Raspberry Pi hardware:

  • RPi 5 Model B Rev 1.x
  • RPi 4 Model B Rev 1.x
  • RPi 400 Rev 1.x
  • RPi CM4 Rev 1.x
  • RPi 3 Model B Rev 1.x
  • RPi 3 Model B Plus Rev 1.x
  • RPi 3 Model A Plus Rev 1.x
  • RPi CM3 Rev 1.x
  • RPi Zero 2W Rev 1.x

Note: If you have one of the listed hardware, and this snap doesn't work on it, please open an issue.

Usage

Please refer to this tutorial to install and configure the application.

Development

Build:

snapcraft -v

This will download >500MB and requires around 8GB of disk space.

To build for other architectures, customize the architectures field inside the snapcraft.yaml and use snapcraft's Remote build.

Install:

sudo snap install --dangerous *.snap

Manually connect the following interface:

sudo snap connect matter-pi-gpio-commander:custom-gpio matter-pi-gpio-commander:custom-gpio-dev 

Continue by following the usage instructions.

Test Blink

This project includes an app to quickly validate the GPIO configuration without using a Matter Controller. The app will toggle the output voltage of the pin to high/low periodically.

To use, install the snap and configure the GPIO. Then, run it via sudo snap run matter-pi-gpio-commander.test-blink snap command or directly:

sudo matter-pi-gpio-commander.test-blink