Comment by zxexz
7 hours ago
What I'll never understand about this whole thing is why most people seem to easily tolerate the rigamarole of maintaining an entire host SBC OS and sending or even cross compiling binaries to it, for microprocessor work. I much prefer maintaining a dev env on machine(s) and sending and flashing a binary over the wire. Maybe I just dislike state, but the pico (and several other MCU ecosystems these days) make it so easy to
The advantage is familiarity, I think.
Like: I suck at code. But I've known how to walk around in *nix systems and use things like bash to chain together commands like awk, grep, and sed for ~30 years. Maybe I'd even toss in some badly-cooked perl or python (or both!), when that seemed necessary.
For a very long time, I've been able to get some things done, but my skillset was focused on doing these things with real computers with live filesystems and real user interfaces, not MCUs.
So, some years ago: When I wanted to turn a window fan on and off based on some network-retrieved weather conditions, I didn't even consider an MCU. I didn't want to learn a new way of doing things; I just wanted a computer to get some data and decide whether to turn the fan on and off. And I wanted that done sooner instead of later.
I accomplished this with a Raspberry Pi Zero W -- with the whole OS. I didn't cross-compile anything. I didn't have to target some weird-looking external environment, or learn a new way of doing things.
Setting up the dev environment was very familiar: Dump a binary onto an SD card, boot it, get it onto the network, and use it.
I just SSH'd into that tiny little computer like I would any other Linux box and wrote my stupid little cobbled-up scripts right there, in-situ, on the final device that would be performing the work -- with a familiar interactive shell.
The end result worked very well. I'm not ashamed of any of this at all.
---
Later, I switched from networked weather reports to an RTL-SDR dongle and software decoding to listen for over-the-air broadcast reports from someone else's nearby APRS weather station, and used that as a source of weather data instead.
Can we even get that done in MCU land? (Should we even try to do so for just one window fan?)
Regarding the SDR, the Pico can act as a USB host (honestly a huge win as you can plug in a keyboard/mouse). But it’s not able to run at USB 2 speed. There’s no software for it and the CPU probably isn’t powerful enough. So in that case a Linux machine is completely justified. I tell people to reach for a Pi when they need both Linux and GPIO. But if you just need GPIO you should really save the money (and get major wins in simplicity) with the Pico.
I get the familiar angle of using a Pi Zero. But don’t be intimidated by the Pico. Especially these days with the help of an LLM, you’re not slowed down too much. The version of Python they run feels very familiar. The tooling is good. They’re awesome!
Oh, these days I still suck at code. And with the bot, I can hammer out a project for ESP32 or a Pi Pico in no time. (I didn't even put together the dev environment for that. I had the bot do it.)
And because I still suck at code: If I want to create something myself, then I still get to do that with a Linux box using unix methods.
That all said: I do enjoy working with RP2040 PIO assembler sometimes. The combination of its severe limitations and robustly resolute timing makes it both approachable, and fun. :)
Anyway, I think all methods are OK. There's no reason to judge them. (I think it's also OK to just use a computer to read Facebook, or as a porn machine, or to become an Amish leatherworker and leave all of this digital nonsense behind.)
I'm sure you're aware, but for the record the Pico has state. That's one of the best things about it. You have a very fully featured Python environment (or rust, or C) with a read/write filesystem. The WiFi SDK is also super useful. They can make HTTP requests (and HTTPS without full CA validation), host an HTTP server, even host an access point.