Replies: 1 comment 3 replies
-
Hi |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My real interest for the project is that I was looking for a simple way to control RGB LEDs from a custom computer program. I am developing a video game that should light up some LEDs at defined moments, and need good enough bandwidth to enable smooth animations.
Seems that HyperSerial devices with the AWA protocol is the only out-of-the-box solution I found that is technically capable of that.
I have set up an ItsyBitsy RP2040 with HyperSerialPico to light up 256 LEDs, and made a custom PCB to plug in a barrel-jack power supply. When I run the thing through HyperHDR or hyperion-ng, this works great, even using a 5V 5A wall wart to power the LEDS. There seems some nice current-limiting logic built-in in the HyperHDR software, which is great, as running all my LEDs at full current in such a setup makes a brown-out down the strip and puts too much strain on the power supply.
The next step is to understand the protocol so that my game can directly talk to HyperSerialPico and literally speak AWA.
I did a try in Python to reverse engineer the protocol - below is a code sample - to replicate what I understood from it based on the source code. One difficulty was to correctly compute the checksums, both for the header and the whole packet.
When I run the code, I get mixed results. For example, it may take 2-3 attempts to light up the LEDs. Or I may need to male a run of HyperHDR in between that seems to perform some handshake and put the device in a good state before. If I run a loop to simulate a smooth animation, after a dozen frames, the RP2040 goes in "PANIC", saying "No space left for program" or something similar, on the serial line, and freezes. Or it may simply hang when I attempt to read bytes from the serial port. I need to disconnect and reconnect the USB cable to rearm the device when this happens. Those issues are frequent and random.
I may try with something else than Python because the pyserial library has reports of issues about cleaning up or resetting the TX/RX buffers at some moments.
There is something I did not understand with the protocol or I am missing, as HyperHDR / hyperion-ng makes the lights still work perfectly. My open questions are:
Below is my Python code I used for my experiments.
Beta Was this translation helpful? Give feedback.
All reactions