Beach Cleaning Robot Blog

redis pub/sub with websockets - part V

Date: 2021-02-17
Author: Andrew

Started building out the other redis channels starting with the operating system and beach bot version number. Getting the OS info was pretty easy by taking the first line of the /etc/os-release file. Both this and the version number are in the server script just after the listener thread has been started.

I wanted to keep it simple so the listener now subscribes to multiple channels. So it takes the channel message loads it into a dict, jsonifys it and sends it to the websocket. At the client end I'm trying to update it so that there is only one function to parse any messages that arrive. For some reason it is not updating the message from the server with the system/bb version and the generic one is crashing. Out of time to fix.

Note: I generally write this blog the next morning and I think I just worked out what I was doing wrong for at least one of the two bugs that I need to deal with!