An application to turn a Raspberry Pi with an LED Matrix into a wearable LED screen t-shirt.
Note: Some of the toolchain (Build tasks etc) are currently Windows-specific (WSL - Windows Subsytem for Linux is a requirement). If running a different OS, very minor adaptations will need to be made (Convert WSL commands to native linux)
- .Net 10 SDK
wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb -O packages-microsoft-prod.debsudo dpkg -i packages-microsoft-prod.debrm packages-microsoft-prod.debsudo apt update && sudo apt install -y dotnet-sdk-10.0You probably need the .NET SDK 8 on the Pi too, to build the RGB LED Matrix library
Installing .Net 10 SDK is probably best, as that covers all scenarios. - (For debugging) VSDBG
curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -l ~/vsdbg
Pick a folder to deploy to (eg /root/dev/WearWare)
This folder should contain the following subfolders:
- bin - WearWare binaries should be in here.
When developing, deploy to this folder, not to the parent folder. This is because the rsync will wipe everything in the deploy folder (Wipe your library and config etc) - config - This is where configuration of the app will be stored
- incoming - Uploaded files will go here
- library - Imported (Converted) files will go here
- playlists - Playlists will be stored here
- quickmedia - QuickMedia items will be stored here
- tools - Tools (eg the
frame-sequence-playerexecutable) will go here
- Build the rpi-rgb-led-matrix library and utils.
The provided build tasks can be used to do this
(remote-build-native-libfollowed byremote-build-lib-utils) - Place a compiled copy of
frame-sequence-playerin the tools folder
This can be done with thecopy-util-remote-to-remotetask
- .NET 10 SDK must be installed
- Set the environment variable
WEARWARE_REMOTE_MACHINEto point to the hostname and username used to SSH into the Pi (egroot@DietPi) - Set the environment varibale
WEARWARE_REMOTE_DIRto point to the folder name where WearWare is to be deployed to on the Pi (eg/root/dev/WearWare) - Set the environment variable
WEARWARE_REMOTE_LIB_DIRto point to the folder where the RGB LED Matrix repo lives, eg/root/dev/rpi-rgb-led-matrix
Ensure thebinfolder is created in this folder (eg/root/dev/WearWare/bin)
-
Passwordless SSH to the Pi as root must be configured
Launch configurations are included in the repo
-
WSL must be installed, and Rsync must be added to WSL
This is to allow VSCode to transfer the built files to the Pi -
The Command Variable VSCode extension must be installed
This allows us to build linux style paths for use intasks.json -
Select the
Debug (Remote Pi) - WSLconfiguration -
Hit F5 to debug - code will be run on the Pi
Launch configurations are not included in the repo
However, the majority of tasks are absolutely compatible with linux with linux / mac
You should only need to: -
Re-implement the
wsl-rsync-ww-to-pitask (Very simple, just remove WSL) -
Duplicate the
wsl-deploy-pi-debugcompound task, replacewsl-rsync-ww-to-piwith your new task. -
Duplicate the
Debug (Remote Pi) - WSLconfiguration and point it at your new compound task
In this mode, you can work on business logic etc without needing to run on the Pi
It should work fine on any OS
- Select the
Debug (Local with mocks)configuration - Hit F5 to run
- A debug interface will be available on http://localhost:5000/mocks
This will allow you to simulate GPIO button presses. - In this mode, all LOOP type animations will only last for 1 second, as it has no way of knowing how long the animation is
- What the Pi would be playing on the screen is shown in the Debug Console of the IDE
remote-build-native-libwill build the RGB LED Matrix library on the Pi via SSHremote-build-lib-utilswill build the RGB LED Matrix utils on the Pi via SSHcopy-util-remote-to-remotewill copy theframe-sequence-playerutility to thetoolsfolder of WareWare on the Piremote-build-bindingswill build the C# bindings on the Pi via SSHwsl-deploy-pi-release(Windows only) will deploy to the Pi in RELEASE mode
Be sure that the above two build tasks have been performed at least once before
This app supports playing media on press of a button.
Buttons can be connected via either the Pi's normal GPIO pins, or via an I2C GPIO expander.
Currently, only the Adafruit MCP23017 is supported as an I2C expander, but more could be easily added.
Button hardware is configured in config/buttonsconfig.json, which defaults to an empty PiGpio configuration. WearWare creates the same default if the file is absent. Configure the provider and buttonPins before using QuickMedia. The list order maps pins to QuickMedia slots, starting at slot 0.
For Raspberry Pi GPIO, buttonPins contains BCM GPIO numbers. Use only pins that are available with the installed matrix HAT and other peripherals. With I2C enabled, set excludeI2cPins to true to reject a config that includes GPIO2 or GPIO3. The pins are not remapped. For example, with an Electrodragon Active-3 matrix driver board that has channel 3 disabled, and I2C is disabled:
{
"provider": "PiGpio",
"buttonPins": [2, 3, 14, 16, 21, 26],
"excludeI2cPins": false
}With an Electrodragon Active-3 matrix driver board that has channel 3 disabled, and I2C is enabled (Being used for something other than buttons):
{
"provider": "PiGpio",
"buttonPins": [14, 16, 21, 26],
"excludeI2cPins": true
}For an Adafruit MCP23017, the I2C bus is fixed to bus 1 and address 0x20. Button pin numbers are MCP23017 driver pin numbers: 0-6 for A0-A6 and 8-14 for B0-B6. Pins 7 and 15 are kept as outputs. interruptPins has exactly two entries in IA, IB order; use null for an unconnected line:
{
"provider": "Mcp23017",
"buttonPins": [0, 1],
"interruptPins": [14, null]
}Connect normally open buttons between A0/A1 and GND, and connect IA to Pi GPIO14 (physical header pin 8). Enable I2C on the Pi. The expander inputs use internal pull-ups.
Button events are ignored for 100ms after each handler is created to allow the input voltage to settle, and use 200ms debounce.
- Upload some GIFs or images to the
incomingfolder of the Pi - Point a web browser at port 5000 (eg
http://dietpi:5000) - Go to the Options page, click the
Matrix Optionsbutton and set the matrix options for your panel (You may need to restart the app after) - Go to the
Importpage and import files into the library. This will convert them to a stream - Go to the
Playlistpage, create a playlist, and add items to it from the library - Optionally, go to the
QuickMediapage and assign items to the configured button slots.