An app for Raspberry Pi GPIO Output control and Input visualization, built in rust using the Iced GUI toolkit and rppal GPIO crate.
The GUI binary (Pi Gpio GUI - PIGGUI) is affectionately known as "piggy".
|
Currently, when run on a Pi, you can configure the Pi's GPIO hardware Inputs or Outputs, controlling the level of the Outputs and view the level of the Inputs.
It runs on macOS/Linux/Windows. When we add networking support, this will allow you to control the Pi GPIO hardware remotely.
You can see more gifs and videos of features here
We would like input from Raspberry Pi users to help us decide the order of things to work on in the future, and input on how integrate new functionalities (e.g. I2C buses, SPI, UART, etc.).
Please let us know what you think, and suggestions, via GitHub discussions or GH issues, or in threads where we communicate its existence (discord, reddit, etc.).
We have identified a number of areas we would like to work on after this initial release, but would really appreciate your input on what could be most useful or just the coolest, many have GH issues.
A binary that shows a GUI for configuring pins, observing input levels and controlling output levels. On Raspberry Pi it has a real GPIO hardware backend (via rppal). On macOS, linux and windows it uses a fake GPIO hardware backend.
A "GUI-less" binary. Currently, it has minimal functionality. It can be built on any platform and will use the fake Hardware backend (but not be very useful!).
If built on the Pi (with the "pi_hw" feature), then it has a real GPIO hardware backend.
It takes a file command line option. It will load the GPIO configuration from the file (like "piggui" can) and it will apply it to the hardware. But currently there is no way to interact with it after that.
cargo install pigg
NOTE: cargo
will build for the machine where you are running it, so you will get a version of piggui
with a fake hardware backend, not real Pi GPIO hardware, but you can play with the GUI.
To be able to interact with real Pi GPIO hardware you have two options:
cargo install --features "pi_hw"
on your Pimake
to build on macOS/linux/Windows and cross-compile for your Pi, but you will need Docker
/Podman
and cross
installedSoon, we will add support for cargo binstall
to allow you to get a binary for Pi directly.
We use "cross"
to cross compile for Raspberry Pi from Linux or macOS or Windows.
None of the developers currently has a Windows machine, so we have been unable to test this on Windows.
Install docker or podman and "cross"
for cross compiling rust on your host for the Raspberry Pi.
If you run "make"
on a Raspberry Pi, it will not use "cross"
and just compile natively.
So, to be clear "cross"
is not a pre-requisite for Raspberry Pi native building.
Run "make"
on macOS, linux, Windows (or in fact RPi also) host to build these binaries:
target/debug/piggui
- GUI version without GPIO, to enable UI development on a hosttarget/aarch64-unknown-linux-gnu/release/piggui
- GUI version for Pi with GPIO, can be run natively from RPi command
linetarget/aarch64-unknown-linux-gnu/release/piglet
- Headless version for Pi with GPIO, can be run natively from RPi
command lineUse "make run"
to start piggui
on the local machine - for GUI development.
If you use make
that builds for local host AND pi (using cross).
If you get strange build errors from cross
, check first that your Docker daemon is running.
There are a couple of env vars that can be setup to help you interact with your pi.
You can set these up in your env, so you always have them, or set them on the command line when invoking make
PI_TARGET
Which Pi to copy files to and ssh into
PI_TARGET := pizero2w0.local
PI_USER
The username of your user on the pi, to be able to copy files and ssh into it
PI_USER := andrew
make
to run clippy
, build for the Pi using cross
, build for the local machine using cargo
and to run testsmake pibuild
to build only for the Pi. This will build both piggui
(with GUI and GPIO) and piglet
binary
with GPIO onlymake copy
to copy the built binaries to your raspberry pi.make ssh
to ssh into your Pi to be able to run the binaries.You should be able to use make
or make run
directly, and it will build piggui
with a GUI and
also build piglet
Use make run
One macOS/linux/Windows this will build for the local machine, and start piggui
with a fake hardware backend.
If you run that on a Raspberry Pi, it will detect that, and build for the Pi, with the real Pi GPIO hardware backend.
Piggui takes an optional filename argument, to attempt to load the code from. If there is an error loading a config, the default config will be used.
To do this you can use the equivalent of what make run
does, adding the filename:
cargo run --features "pi_hw" -- <filename>
cargo run -- <filename>
See CONTRIBUTING.md
See LICENSE
See SECURITY.md