Member-only story
Featured
PROGRAMMING
A WebSockets server on the RPi Pico
All I wanted was a simple WebSockets server on a Raspberry Pi microcontroller. Was that too much to ask? Well, yes and no, and not in that order.
This did not go the way it was supposed to. At one point in this project I was reminded of that old joke about a person asking for directions only to be told, “I wouldn’t start from here”.
All I wanted was a simple WebSockets server running on a Raspberry Pi Pico 2W to act as a communications hub for an embryo robotics project. I got there in the end, but it took two goes. And the reason was an error in judgment at the beginning. Learn from my mistake.
The right environment
With any project, there are many factors involved in choosing your development environment — and especially the programming language — including considerations such as ‘can it deliver the necessary performance?’ and ‘does it fully support the target hardware?’. But to those pragmatic factors you also have to account for more conceptual concerns such as, ‘am I really up to this?’.
And the answer was, no I wasn’t. At least, not on my first attempt. The second try was, I’m glad to say, entirely successful, but I offer…








