pitrix
What is pitrix?
pitrix is a software to run on an ESP8266 microncontroller connected to a LED matrix. It will display the time and a few other nice effects and stuff.
pitrix fetches the current time via NTP, is controllable via MQTT and can be flashed over-the-air, so you don't need to disassemble your nice-looking LED matrix everytime you want to update the software.
Effects
How to use
Checkout the code, rename include/config.sample.h to include/config.h
and edit it to match your preferences / environment.
Then compile and flash it, preferably using PlatformIO.
Control it
Currently, control is possible via MQTT and / or HTTP REST API.
To use MQTT, you have to define MQTT_ENABLE and configure your MQTT sever's credentials. MQTT_TOPICis set ininclude/config.hand defaults topitrix`.
To use the HTTP REST API, you have to define HTTP_SERVER_ENABLE and set a port number to listen on (80 is set by default).
Possible commands / topics are:
MQTT_TOPIC/mode/POST /modelets you select an effect to show. Seesrc/effects.cppfor a list. Default effect iscycle, which will cycle through some of the available effects. Another effect isoff, which will just display black, effectively turning the display off. (pitrix stays running, so you can turn it on again by simply selecting another mode.)MQTT_TOPIC/brightness/POST /brightnesssets the brightness of the display. Valid values are between 1 (darkest possible setting) and 255 (maximum brightness).MQTT_TOPIC/reboot/POST /rebootreboots pitrix. Send any value.
You can set retained values to have pitrix read them at startup, effectively
setting a default effect or brightness. (Do NOT set a retained value for
MQTT_TOPIC/reboot unless you want pitrix to reboot all the time.)
Monitor it
The current status ("ONLINE" or "OFFLINE") of pitrix will be set at
MQTT_TOPIC/status.
If you enabled MQTT_REPORT_METRICS, metrics are sent via MQTT every 15
seconds:
MQTT_TOPIC/free_heapcontains the free heap memory in Bytes.MQTT_TOPIC/uptimecontains the uptime of pitrix in seconds.MQTT_TOPIC/fpscontains the currently reached frames per second.
If you enabled HTTP server, you can always make GET requests to /free_heap, /uptime or /fps to get those values.
If you enabled DEBUG, log messages will be sent to MQTT_TOPIC/log.
Aknowledgements
Libraries
| Library | Author | Link |
|---|---|---|
| PubSubClient | knolleary | https://pubsubclient.knolleary.net/ |
| FastLED (with small modifications) | Daniel Garcia & Mark Kriegsman | https://fastled.io |
| NTPClient (with modifications) | https://github.com/arduino-libraries/NTPClient | |
| ESP8266WebServer | https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer | |
| ErriezCRC32 | Erriez | https://github.com/Erriez/ErriezCRC32 |
| ESPAsyncTCP | me-no-dev | https://github.com/me-no-dev/ESPAsyncTCP |
Inspirations and stuff
- This whole project was inspired by https://github.com/orithena/Arduino-LED-experiments/tree/master/Ribba16x16_v2_ESP32. The sinematrix3 effect was also taken from there.
- The firework effect was heavily inspired (aka copied) from https://gist.github.com/kriegsman/68929cbd1d6de4535b20
- The sines effect is based upon https://github.com/atuline/FastLED-Demos/blob/master/sinelon/sinelon.ino
















