MQTT Scroller for the Galactic Unicorn

I had a couple of hours on the train to try out the Unicorn (its great) - i have added an MQTT version of the scroller text at:

[Galactic-Unicorn-MQTT-Scroller/micropython at main · ucl-casa-ce/Galactic-Unicorn-MQTT-Scroller · GitHub]

Thought some people might find it useful,

Andy

4 Likes

Exactly what I’m looking for.
I havn’t managed to get it working yet, but it’s my first project.

Thanks for getting me started.

1 Like

Just to update - there is now also a 3D printed case as part of the MQTT scroller github …

and Fusion360 files if anyone wants to edit - eg make it a little deeper…

Andy

2 Likes

Mind if I link your great project from the Github docs @Smithee11 ? :)

It would be an honour :)

Andy

1 Like

Hi Andy, this looks amazing. The reason I bought the GU was to try and interface it with my Home Assistant. This appears to be exactly what I need. I’m a novice tinkerer so need to get my head around MQTT but I’m sure I’ll get there eventually - Thank you so much.

Pete

2 Likes

Home Assistant has a nice MQTT integration - so you could use HA to send our messages :)

This is cool! how do i send my own messages to the broker which then display on the unicorn, MQTT newbie here. is there a tutorial?

Thank you for this code! Got it up and running.
I have an Mosquitto “server” running on a spare Pi 4 and the scroller code working a charm on my Galactic Unicorn.

However, I am trying to figure out how to have a clock show up between published messages.

Would love any help!

Hi,
How did you configure your mosquitto server ? I installed mosquitto on my RPI4, setup an account and password for it. The Galacic Unicorn connects to my wifi, connects to my RPI4, and disconnects. Did you need to do anything beside generate /etc/mosquitto.d/pwfile ? I can send messages to every linux host running the mosquitto client using the same account I created for the Galactic Unicorn.

Here’s an output from stdout:

Checking WiFi integrity.
Got reliable connection
Connection failed.
Connection lost (read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?))

Any Ideas ?
An answer to your question is I would research to see if MicroPython would support a scheduler script that will kick off a script, run a timer in the background, kill the script running in the foreground and start another one. I am not sure if you can do that with a Pico. If we can’t then we need to add a timer to each module that will exit the script after a set amount of time, and we need to write a script that will sequentially call each script ending with the last script will be rerunning the scheuler script.
I would prefer it if we can create a scheduler script that will run in the background, wake up, fire off a script, and go back to sleep for a set amount of time, wake up, start a new script and repeat…

This is super useful and can push updates for weather and 3d printer progress via home assistant.

I have very little knowledge of coding but I think there is 2 improvments that could make it even more useful. It looks like it grabs everything from the topic, so could we modify it to pull a colour/action (like scroll/center) for the message?

It also seems to check the retain flag but then doesn’t seem to use it. Could that be used to hold a message until the next so maybe we could push the time last and it sticks.

Hi @paulcdb
Please see my modified code.

I have allowed for the first word of the message to be a known colour to change the background colour.

It also plays an 8-bit tune when the message scrolls.

You could use the example of where I am looking for a key word in the start of the string to make other changes to how it displays the message.

1 Like