Live data from Hacker News

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

set-inform.com

151–160 of 270 posts

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

#151
post #66

Earlier quoted context omitted.

Not having high-level languages available is a big part of the fun of programming microcontrollers.

I completely agree. It brings you back to more fundamental aspects of problem solving that sometimes you miss with higher level programming. There are a lot of things I can do on a modern web server with a language like Go that are pretty cool, but not particularly interesting because it's kind of trivial. There are so many resources available to the program, things to fall back on for resilience, plenty of common pr…

> Sometimes I'll spend hours trying to figure out how to interface with a single sensor, and while it isn't important or impressive in the scheme of things, I really enjoy it.

I found a fake sensor like that once.... was wondering why my code done by datasheet didn't worked on cheapo breakout board I bought off aliexpress.

Then I read ID register and they used older chip that had some of the stuff set up differently...

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

#152
The article is right, if you need a (very) low power server the rpi is unbeatable. I have tried a lot during the years to make it as robust as possible, however I find that there is only a matter of time until a power failure, regular update or even a simple reboot will render a pi unusable. And you'll be powerless to fix whatever flavor of boot error is occurring half a world away. Never had these kinds of issues with regular servers. Perhaps if there was a way to "boot to ssh" to fix these...

Some recommend the miniPCs from Dell, Fujitsu etc. But they also have custom firmware with their own set of problems and strange design decisions which you won't be able to change if you needed to.

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

#153

I typically see two kinds of raspi hate, and only one of them is reasonable imo. The first is stuff like this article, where you can probably get something better than a raspi these days for about the same price (especially when you consider scalper pricing) or just run a docker image in a server you can make with an old computer. This is very good advice, especially now that getting a raspi at MSRP is borderline imp…

> server you can make with an old computer

Power consumption inefficiencies often make this a very poor choice (for same workload than can be done on low-wattage rpi or similar).

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

#154
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.

>just like our ancestors.

why am I laughing at how much this stings? we're not that old, damnit!

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

#155

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…

Should probably expand on this a bit. In 2014 we were involved in a project with a reasonably well-known power grid operator. They had been deploying expensive equipment to monitor the status of various devices at remote substations. They had soft requirements for uptime, which means they set a budget and got the most reliable equipment they could afford. The monitoring system was expected to work somewhere between 4 and 5 nines, but if it didn't no one was going to get fired. The equipment they had been deploying was more or less expensive overkill, offering 5 9's for about $50k per box. Multiply that by about 1600 and you get the idea for the budget. Someone in the organization hit on the idea of using redundant consumer-grade equipment and initially spec'd out some rack-mount x86 systems with beefy redundant power supplies and SSD storage. But then they heard about RasPi's and wanted to give them a try.

Should you use a Raspberry Pi for that? The best way to answer that question was to try it out. The first 20 units were built out with a beefy, though small UPS and a decent enclosure. They were deployed alongside existing systems to see if they a) worked, b) gave the same data as the expensive system and c) were reliable.

The answer was... some individual units did not hit the 4 9's reliability target. The ones that did, seemed to continue to be reliable up to at least 5 9's. But it was hard to determine which would fail without putting them in the field, waiting six months and seeing which ones hung. But the price was cheap enough that putting two in the same corner of the wiring cabinet and adding a hardware watchdog was quite affordable.

We deployed just over 1000 in this redundant configuration and it worked fine.

By this time we collected enough data to chart a MTBF histogram, essentially a chart of how many machines lasted how many days without needing a reboot. We wound up using a lot of Original RaspberryPi B+'s in 2015, which was after the RasPi 2 came out. (Purchasing at this client took a LONG time.) I often wonder if our supplier sent us boards that had been returned from other customers.

I had good experiences with BeagleBoard's in the late 2000's and this was just as the Black was coming out. We deployed another 600 with BeagleBone Blacks and got MUCH better reliability numbers. Is the BBB an intrinsically better product? I dunno. Did I just get a batch of bad RasPi's from my supplier? I dunno. Should you ever run an embedded system without a hardware watchdog? Probably not, no matter how reliable you think your system is.

But... the real problem with the RasPis was support. How do you return a RasPi? You don't. You throw it away and get a new one. Yeah. That doesn't work for a lot of people. How do you get the firmware for a RasPi in 2015? You don't. Can I get the gerbers so I can turn a few custom boards? No. I talked with RPT several times about this and their response was "we're not an ODM."

And that's PERFECTLY FINE. I never said I though RasPi's were "bad" -- I may have said "there are applications for which RasPis are not a great fit." If you need the firmware, consistent reliability or the ability to turn custom boards, you absolutely don't want to buy a raspberry pi in 2015.

Also... a lot of people are responding with "Except for the several times the system rebooted, I didn't have to reboot my RasPi," which I'm not sure I understand.

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

#156
post #42
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.

Shhhh stop spilling our secret to the software people... The semiconductor shortage is bad enough already... That said though, programming embedded devices like Arduino and ESP32 needs a completely different style of thinking than with high level languages or web stuff. Things like MicroPython reduces the friction just a bit to make it easy enough to get on board.

Honestly, working with all the restrictions of an embedded system like this is something that all programmers should experience at some point. Being forced to actually consider how you're using resources teaches you a lot about how to write efficient code. Or at least if gives you a better understanding of what the machine is actually doing with your code.

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

#157
post #63

Earlier quoted context omitted.

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.

They improved the licensing to MIT. The pre-acquisition license was "GPL" but it had a noncompliant restriction prohibiting comparative benchmarks. There have also been useful improvements to the codebase. Amazon is a net positive in this case.

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

#159

If your alternative to RPis are used NUCs or laptops, than you lost me. I want reliable and quiet. I have RPis running for more than a decade everyday with not a single crash. In what conditions are those used PSU? Who knows. I'm also not a fan of bringing other people's dust and keyboard grease along.

I've got a mix of boxes ranging from Raspberry Pis to NUCs to many-core Xeons. They each have their roles - for example, a NUC acts as a DVR for security cameras, and I want it separate from other stuff. But I agree that RPIs can be very good for basic stuff. I've had one running as a print server for an indestructable old laser printer for 9 years now with no issues whatsoever. It's outlived two older Mac Minis I used before the NUC.

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

#160
I fully agree. We built our app testing parcour with about 10 phones, 10 nfc simulators and a Raspberry to orchestrate the whole thing.

The Raspberrys USB ports sometimes did not work properly and we feared that we could quickly kill the SD card. Additionally the processing power was not that great.

In the end we switched to an Intel N5000 notebook with a broken screen (working HDMI) that we had lying around (used price under 100€,in this condition maybe under 50€). The system now has aN uptime of over 100 days and works much better.

Post reply on HN