Live data from Hacker News

Unpopular Opinion: Don’t Use a Raspberry Pi for That

set-inform.com

121–130 of 270 posts

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#121
post #10

I often end up giving the opposite unpopular opinion: RPis are overkill for a lot of DIY IoT uses. Want to have something that opens your curtains or flashes some RGB lights in your hallway or whatever? Pick yourself up an Arduino / ESP32 with built-in WiFi, often an Ethernet port, tons of GPIO. It consumes milliwatts of power, boots in under a second, and is cheap enough to be disposable.

Even in the Raspberry ecosystem you can easily pick up a Pico, which offers all of that.

I prefer the Pico to the ESP32. I'm very impressed with the quality and organization of the Pico SDK and documentation.

Although I have heard the Pico is not very competitive in terms of power optimization. I haven't done many battery powered projects to encounter these issues though.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#122

Earlier quoted context omitted.

The point the GP made was that timing issues weren't a real problem on the rpi thanks to the tools mentioned.

There are different kinds of timing issues. There's knowing the time, which you can do with something like NTP. That the RPI can manage just fine. And there's acting with precise timing, eg, if you need to control a mechanism and reliably react on a deadline of a few ms. A RPI doesn't perform well there, which is why 3D printers use microcontrollers instead.

Bare metal C++ for PI. https://github.com/rsta2/circle

Access to most of the hardware and real-time deterministic behavior. It’s a really great project and lets you twiddle those gpio pins at ridiculous speeds with perfect timing (less than a millisecond).

A PI comes with a whole bunch of great hardware baked in, so if you have one laying around, and want to do some microcontroller stuff, I think it’s a great choice.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#123
post #63

Earlier quoted context omitted.

The thing that tripped me up the most was concurrent tasks. In languages like Go or JavaScript it’s pretty easy to figure out how to decrement a timer or wait until x time to perform a task without having the waiting period be blocking. On an arduino, you have a few options but none of them are likely to be familiar to high level software devs. It isn’t rocket science, but there are loads of little details like that…

RTOSes are developed to solve this exact problem of concurrency. Try Zephyr, ThreadX (from MS) or FreeRTOS (from Amazon) or whichever OS your microcontroller vendor supports. It will be eye opening, and you get to learn to write safe code in C with synchronization primitives just like our ancestors.

Amazon did not create FreeRTOS; they simply took over maintenance a few years back. I didn’t know that happened until I fact-checked your comment, but it is enough to make me never want to use it ever again. And that makes me very sad.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#124
It's unfortunate that people don't include nuance in their discussions. These "do" or "don't" type articles make broad generalizations, sometimes as arguments in favor of their position.

For instance, using SD cards for storage is problematic for certain uses, but that doesn't include the popular practices of using a small USB-attached SSD, nor of logging to RAM, nor of logging / writing to NFS. That by itself is just a factor, not a reason.

Likewise, price and availability make the assumption that we're talking about Raspberry Pis, which we know have gone commercial and are way too expensive and hard to get. There are many, many other kinds of Pis like Orange, Nano, Rock, et cetera.

There are plenty of other factors which are good or bad, depending on your situation, like power supplies - a single NUC power supply brick can be HUGE, but a single IKEA USB power adapter can power several USB devices - so it depends on your use case.

These are nitpicks, but what really irks me is when people make comments like this:

..."don’t have to put up with the quirks of Raspian or running an alternative distro that has zero community"

That's dismissive, reductive, and a rather shitty take. Perhaps this author shouldn't be running Linux at all because of all the quirks in each distro. Perhaps they should run Windows. Oh, wait! Windows has even more quirks, and arguably a community so large and disparate that I'd consider it worse than any community of any OS project with "zero community".

Oh, well. My take is that Pis of all sorts are wonderful little devices that have an assortment of advantages and shortfalls for many, many use cases, and you can learn lots using those advantages and overcoming those shortfalls, if you want. That last part - "if you want" - means more than anything. It's personal, and others shouldn't tell you what you should or shouldn't want.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#125
post #10

I often end up giving the opposite unpopular opinion: RPis are overkill for a lot of DIY IoT uses. Want to have something that opens your curtains or flashes some RGB lights in your hallway or whatever? Pick yourself up an Arduino / ESP32 with built-in WiFi, often an Ethernet port, tons of GPIO. It consumes milliwatts of power, boots in under a second, and is cheap enough to be disposable.

I can't really disagree with what you're saying about Pis often being overkill, but I've been using Raspberry Pi Zero Ws for more projects where I might have used ESP32s, and I've been very happy with the choice. Basically any project I have that isn't battery powered or timing critical, I'd prefer to use a Pi.

Zero Ws have a $10 MSRP (of course, huge shortage at the moment). I think they're pretty cost competitive for DIY IoT.

Buildroot makes it really easy to create a custom Linux OS with your software preinstalled, any kind of custom kernel tweaks you want, and an impressive amount of software packages available. If you strip unneeded functionality from your kernel you can boot a lot faster too.

Here's a list of some stuff I like about a Pi Zero W vs an ESP32

* Ease of programming. Flash an SD card and swap it out, without having to hook the device up to a programmer.

* Extremely solid TCP/IP stack.

* Multitasking with real process isolation.

* Program organization (related to above). I find the OS abstraction very useful for enforcing cleaner designs.

* Access to Linux software packages. I can easily add nginx, apache, or lighttpd to my rootfs. It doesn't involve mangling any of my other software packages

* Interactive access. I can debug the applications by sshing into the Pi and looking at logs. I can scp new files onto the Pi.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#126

Earlier quoted context omitted.

The funny thing about hardware and non-nerds/non-EEs/etc. is that most people don't care if the components are "junk". They care if they can make their project work on it. They care how much time it takes from beginning to end. They care how easy it is to get help when something doesn't make sense. It's small, it's inexpensive, it gets the job done.

It does not get the job done. Last problem I had with Pi: my keyboard did not work for some reason. Guess what, Pi has shitty USB 1.1 implementation (USB 2.0 is different stack), on top of that it does not give enough power to connected devices. With normal computers I had similar problems in 2003!!! For serious use it is like Gentoo. You have to learn about its boot process, how it bootstraps from video memory.... O…

Your arguments are almost identical to the ones greybeard embedded devs have against the Arduino. Yeah, it's expensive, uses an outdated micro (at least the AVR-based Arduinos), but it's effective because of its popularity. Basically a flywheel effect. Doesn't have to be good or optimal, just has to be flexible and have a big community.

I doubt anyone is using an off the shelf Pi with SD card for an actual safety critical deployment and expect to get it certified. There are options like the Revolution Pi which is half PLC and uses the Pi's Broadcom SOC for non-safety calculations. Some even support CODESYS.

I agree that most ARM embedded Linux SOC's can be absolute dumpster fires when it comes to peripheral documentation and poorly maintained device trees (looking at you, Texas Instruments!!!) but that's nothing new in embedded dev. Learning how each manufacturer/platform do hardware peripherals is half the battle.

So I agree that the pi isn't always the best device for an application. Cost and power savings on an ESP32, better processing on your old laptop-turned-server, and so on. But the Pi does have excellent documentation, and was lucky enough to gain enough traction to create an ecosystem that reduces friction to just get something running for beginners, which is literally its original design intention.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#127

Earlier quoted context omitted.

> I know that you didn't ask, but my $0.02 is that yes, RasPi's are unreliable. I've been using RPis and "clones" for internal services for years, and there's hardly any fuzz with them at all. At most a power cycle once a year. They've endured house losing power multiple times, I've yet to swap SD-card on any of them, they just keep chugging. But sure, I wouldn't trust my life to one. I just find it odd that people s…

Happy that yours works well. Many problems don't show up until you hit larger numbers. We deployed over 1k RasPi's for a particular customer. We averaged about five reboots per day. On top of that I had to deal with the RasPi Organization's insistence that they were not an ODM. Though these were the RasPi B's and RasPi2 B+'s. I'm sure the reliability has gotten better over the years. I'm not a big TI fan, but everyth…

Ok 1k is certainly a sizable fleet, and I only got 3B's or newer.

Nobody imports BeagleBone here so have to get it through DigiKey or similar, which means prices are way higher.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#128
I run a Mastodon server. In one of the giant floods of new users, I installed Docker on an RPi that I already had laying around and used it to increase my asynchronous worker capacity. I doubt I would have gone out and bought an RPi for that, but I had one up and running anyway, and it turned out to be perfect for the job.

Note that I could solder my own boards together from bare PCBs and components. I just don't want to have to when someone else has already done the hardware work for me.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#129

I know that you didn't ask, but my $0.02 is that yes, RasPi's are unreliable. If you use one for as an unattended remote server, it will do you well to include a hardware watchdog that power cycles the device after it hangs. But modern NUCs seem to take MINUTES to boot the BIOS. I had been using various BeagleBones and found them more reliable than RasPi's and faster to boot than the NUCs in the office. But depending…

> I know that you didn't ask, but my $0.02 is that yes, RasPi's are unreliable. I've been using RPis and "clones" for internal services for years, and there's hardly any fuzz with them at all. At most a power cycle once a year. They've endured house losing power multiple times, I've yet to swap SD-card on any of them, they just keep chugging. But sure, I wouldn't trust my life to one. I just find it odd that people s…

So what you're saying is except for the times it rebooted, it didn't reboot.

Re: Unpopular Opinion: Don’t Use a Raspberry Pi for That

#130
post #98
post #91

Earlier quoted context omitted.

Many microcontrolers have timers and counters or even state machines (PIOs on RP2040 is a nice example of that) for this reason. They allow you to handle those cases out of the main computing unit. The MSP430s are also full of these magic things. They are harder to get introduced to than just writing Python. But you don't realize how powerful those things are until you step out of how you were handling things on a mu…

And these peripherals can run at hundreds of MHz doing real work in every cycle. I can probably do very low latency audio processing with an interrupt firing at the sample rate. Delay is a few samples instead of at least couple of ms like on a PC with an audio interface.

You probably could, but I’d recommend getting a chip with a dedicated I2S peripheral and use freertos with a high priority dedicated audio task that’s sole task is processing audio. You really don’t want to miss an audio sample. It’s very audible, and depending on what you’re doing makes audio processing essentially a hard real-time constraint.
Post reply on HN