This project implements a Pixelflut server on a Raspberry Pi Pico (RP2040) with a 128x128 LED matrix using the Hub75 interface. It supports both traditional Pixelflut commands over TCP and modern HTTP requests for flexibility and easy integration with web clients. The project also includes a minimalistic web interface for setting pixels and viewing the current grid state in real-time.
- TCP Pixelflut Mode: Supports classic Pixelflut commands (
PX x y RRGGBB
) over TCP. - HTTP Mode: Allows setting pixels using HTTP GET requests for easy integration with web clients.
- Minimalistic Web Interface: A simple HTML interface to interact with the LED matrix directly from a web browser.
- WiFi/Access Point Setup: Connect the Pico to an existing WiFi network or set it up as an Access Point (AP).
- Raspberry Pi Pico W (RP2040) - preferably the Pimoroni Interstate 75 W
- Hub75 compatible 128x128 LED matrix (configured with 512x32 modules)
- MicroPython firmware installed on the Raspberry Pi Pico
- Flash MicroPython on your Raspberry Pi Pico using Thonny or another Python editor.
- Upload the server code (
main.py
) to the Pico. - Upload the HTML file (
index.html
) to the Pico’s filesystem for the web interface. - Configure WiFi credentials:
- Update the SSID and PASSWORD in the
main.py
file to match your WiFi network. Alternatively, the server can run in Access Point mode if no WiFi network is configured.
- Update the SSID and PASSWORD in the
- Connect the Raspberry Pi Pico to power and open a serial console (e.g., via Thonny or another serial terminal).
- The server will either connect to the specified WiFi network or start in AP mode (
pico_ap
with password12345678
). - The IP address of the server will be printed in the console.
- Access the server via your web browser at
http://<Pico_IP>:8080
to use the web interface.
- The server listens for Pixelflut commands on TCP port
1234
. - Example Pixelflut command:
PX 10 20 FF0000
(sets the pixel at coordinates(10, 20)
to red). - The server supports the following Pixelflut commands:
PX <x> <y> <RRGGBB>
: Set pixel at(x, y)
to the specified color.SIZE
: Get the size of the pixel grid.HELP
: Get help information about the Pixelflut commands.QUIT
: Close the connection.
- example (setting a pixel with netcat):
$ echo -e "PX 10 20 FF0000\n" | nc <Pico_IP> 1234
- The server listens on HTTP port
8080
. - Set a pixel using a GET request:
Example:
GET /px?x=<x>&y=<y>&color=<RRGGBB>
GET /px?x=10&y=20&color=FF0000
- Open the
index.html
file in your browser:- You can click on the canvas to set pixels.
- Latency: The Pico’s performance can vary based on the complexity of the HTTP requests and the number of clients.
- WiFi Stability: Ensure the WiFi module is connected properly. In case of issues, reboot the Pico and check connections.
- Implement UDP support for Pixelflut for faster pixel setting.
- Add authentication for the web interface and API endpoints for secure access.
- Improve performance optimizations for the server to handle more requests efficiently.
Feel free to submit pull requests or open issues if you encounter bugs or want to suggest improvements.
This project is licensed under the MIT License. See the LICENSE file for more details.