Hardware Choice Pi or PC?

Juat over a year ago I transitioned from a Vera system to openHab on a Raspberry Pi. I recently decided to move openHab over to a PC based Linux server. When I was about to pull the ZStick and looking at the Pi it occurred to me that the Pi is powered by a UPS and would remain up for a while if the power went out, the modem and router are attached as well so it would hopefully stay online and alert me if I was not at home. The PC based server pulls significantly more power and is not on a UPS. So now I’m in a bit of a dilemma, keep openHab on a Pi for contingency purposes or put it on the server for simplicity.

Just curious what others are doing for hardware, and what people had set up for power outages?

Almost everybody is using Pis, for sure. Some use a smartphone power bank as their UPS, most don’t care about power outages. Some few might use other single-board computers, some other few might still use their PC because it’s what they started with or because they have their private full-scale data center in 24x7 operation, but for sure that’s the vast minority of people.
And I haven’t seen anybody yet to migrate from Pi to PC. I also don’t see any reason for doing so.
EDIT:
What’s your issue ?
As @watou noted, performance should not be an issue if you use a RPi2 or newer, and if it’s about SD card corruption - there’s ways of coping with that. Search this forum or ask me for a pointer if that’s what you’re worried about.

I’m very happy with the performance of Pi2 or more recent single-board computers running openHAB. The only general weakness (not shared by all) is wearing out flash memory with disk writes, so an external USB2.0 disk is advised (mechanical or SSD).

Like the Vera, having a separate, low-power, always-on, mainly dedicated SBC processor is generally more convenient. If the Raspberry Pi you transitioned off Vera a year ago is a B+ or older, then you will notice a dramatic improvement in recent models.

1 Like

I have experince from other projects that uses the PI that the SD card is a weak point. And that will affect stability of openhab.

Interestingly, i’m thinking about doing just this. I have a rule which runs a curl script and no amount of re-writing or compartmentalising the rule in OH2 has it return anything other than Null when run on my Pi3. However on my windows machine I can run the exact same code and the script runs perfectly.

shrug

I admit sometimes it can be frustrating to get external web page processing to run properly on Linux because you have to apply the right character escaping and stuff like that, and the more time you’ve already spent, the more attractive it becomes to avoid the problem rather than to solve it.
But to speak frankly, that’s no good motivation for a migration (because it would buy you a bunch of other disadvantages).
Post your problem/script here (new thread), maybe someone on the forum can help.

1 Like

Wow. This is cool. I’m assuming that the power bank stays plugged in all the time and RPi is attached to the output? Is there a recommended power bank for the RPi3? Do they all supply the right amount of power for the power hungry RPi3?

Yes, the power bank stays looped in. No, as far as I know there are no special or recommended banks. RPis aren’t power hungry (unless you attach something hungry to USB), so most if not all should do.
Mine is a promotional gift. Just try using any of yours. Note you need to find one that does charge WHILE powering the Pi. Unfortunately that’s a trial-and-error thing.

After many years of home automation, I have used several combinations of platform so would like to share a few thoughts on their abilities:

  • Old desktop PC
    Pro: Cheap, readily available, able to run Windows, Linux, etc.
    Con: expensive to run 7x24, noisy, serial and digital I/O interfaces are getting harder (no serial ports, PIO cards expensive, hacks via printer ports gone). USB interfaces are getting easier - multi-port serial, 1-Wire, but for digital I/O you probably need to add an Arduino as an expander.

  • Old server PC
    Pro: Better reliability than a PC, remote console and power management help, faster disks helps add file server and backup tasks.
    Con: VERY expensive to power, LOTS of fan noise, parts can be expensive (e.g. SCSI/ SAS disks, memory to allow multiple VM’s)

  • Compromise x86 - e.g. HP microserver, mini-ITX
    Pro: Smaller, cheaper, quieter but still flexible with x86 OS options, disk speed, file and print server. Purchase cost less than a year’s electricity cost for a desktop PC!
    Con: Still a bit large and power hungry, less able to hardware hack without USB or serial linked to Arduino, ESP8266, etc.

  • Embedded ARM - e.g. RPi, Pine 64
    Pro: Very cheap, small, battery options (check Adafruit for LiPo interfaces, many USB batteries EITHER charge OR discharge so are useless as UPS), lots of hackable I/O, lots of community support for hardware projects and code to re-use. Linux works well for me. Basically disposable, so cold standby very effective. Sideways scalable - at this price, use one per task! Easy to rebuild or clone via dd’ing an image to a new SD card.
    Con: Higher learning curve with Linux. Slower disk interfaces so less useful for file/ print, older uSD cards were unreliable (fixed with modern Class 10 cards).

Currently, I’m moving HA from a HP Microserver running Linux and MrHouse to RPi 2 servers for the hardware convenience. RPi 3’s are faster with Wi-Fi, but the added Bluetooth breaks the serial console port needed for the RaZberry interface. I have RPi3’s with a touch screen which might end up as front-end GUI controllers. For OH2, I’d say a fast uSD card makes more impact than moving from RPi2 to RPi3.

The Microserver continues with file/ print/ NAS/ mail/ web server duties using RAID disks, but HA control has moved to the Pi. The key is to play to the strengths of the platforms.

As an example, my text to speech runs from OH2 to a hack shell script on the Pi which calls Festival on the Microserver. This is little more than one line of script using netcat, although curl might also have worked. The server can be used as a desktop, with speakers and also play announcements.

Both are on a UPS, so power fail alerts go from the RPi2 to the Microserver mail server and out to the Internet. I prefer to separate home automation from Internet-facing server duties to allow security hardening and patching without breaking my core control platform.

After moving from SD to Class 10 and faster uSD cards, wear flash memory levelling seems to be a whole lot better, and a lot of the disk issues early Pi users suffered have gone. Just in case, the Pi runs a regular backup script and copies the key files across to the Microserver RAID disks automatically (cron, tar and scp).
Armed with an image of the uSD card, a bare metal restore would take less than half an hour!

@pahansen - There are a few posts showing issues using executeCommandLine and curl, which suggests you are not alone and this is tricky to get right.
I add lots of logging (LogInfo() in OH2 / printf in the shell script), and break things down into testable blocks so you can see parts work step-by-step. Most of my integration issues so far have been on the OH2 side with string / type conversions failing in impenetrable ways and escaping control characters.
I guess another point to check is the version of curl - a Wintel port may be different from the Pi, or have different parameters (–foo verses -foo, bash shell eating delimiter characters that works with CMD,EXE?).

2 Likes

Personally running on my VM host - home built server with Xeon E3, 20gb ECC ram, 4tb zfs storage.

I ran for a while on my old RPi 1 that used to run XBMC. Once started, things ran OK, but when first getting started with OH, the frequent reboots were unbearable.

I’ve definitely gone back and forth in my mind between the two. The Pi certainly has some positives, even if you already have a computer running 24x7 like myself. Low power, cheap, easily replaceable.
The server is on a battery backup that should keep it running for 10-15 minutes. I finally decided that if the power is off, it doesn’t really matter if my HA system is on or not because none of the devices it controls will be on anyway. :wink:

And with as many services as the server is running, I can’t even say that the HA system would be top priority in the even of hardware failure.

Thank you for all for the input. OpenHab on the Pi 2 has been basically bullet proof except for the one issue that I created. While setting it up I logged WAY TOO MUCH stuff and with poor retention rules, after a while it blew out the SD card with so many logs it wouldn’t boot.
The ‘server’ that I have is basically a media/NAS linux box. Mini-ITX with a Intel Core I3 and 6TB of zfs storage.

My initial thought was to consolidate devices to reduce ‘overhead’ on my part, but that may just be some lean mindset spilling over from work. Losing inputs on the Pi isn’t an issue I have never even tried using any of them. Most of the hardware I have done so far has been on ESP8266 with MQTT. One of the ‘Pros’ I had was freeing up with Pi to try some new stuff.

I run openHAB for several months now on a Banana Pi (1st generation). The advantage compared to a Raspberry is the SATA port external storage. I have a Samsung SSD attached to it. With SATA, you also have TRIM support, which improves SSD operation.
I started with a Raspberry Pi but found out that besides of the more powerful processor of the Banana Pi also the SD-Card survived the high IO-rate of the MySQL database for only a few months. So I strongly recommend to use a real SSD or harddisk for openHAB, because the IO will kill most of the SD cards after a short time. Maybe there are SD cards out there that have powerful wear leveling algorithms and therefore will survive the IO frequency of openHAB persistence, but I did not yet read of any.

I currently plan switching to an Odroid XU4 with a USB3-attached SSD, but did not yet do this. I also found out that this platform currently has no TRIM support for SSDs, so I am not yet sure whether to really use it. So for the moment my best recommendation is Banana PI because of the SATA port.

Yours

Wolfgang

3 Likes

I have had a lot of experience with OH and OH2 on RPi and PC with Ubuntu, Mint, Arch and Windows on. I have tried old PC’s Servers, Laptops - just about all of them. I am currently running a Nuc and is great. Low power usage, quiet, small. Now as far as OS…
By far, the best, most reliable, easiest to use, setup, maintain, modify is easily Windows.

I know this won’t be popular however I simply don’t understand why so many of OH users go with Linux. It is a pain to work with, add software to, setup and maintain. I realize that Windows is not free but it is a small price to pay in the grand scheme of things for ease of use and setup.

Cameron

Another happy Windows user here!

I have no former linux experience… I initially tried to use it on RPi but frankly spent too much time trying to understand how use linux, rather than learn openHAB.

2 Likes

I was just about to ask this very question. I’ve currently got an HP Microserver which acts as a file/print/web server, Plex Server and Netcam Studio Server.

Because I had the Pi Zero laying around without a project I decided to use that to host OH, even though I’m more comfortable on Windows environments. My OH implementation is fairly basic - Some AV control and MQTT Temp/Humidity logging.

I really like the sound of @FloatingBoater’s implementation and is making me think that throwing OH onto the server isn’t the best option. That said, like @cameronaps, I feel much more comfortable on Windows and the server is on 24/7 anyway.

Because we don’t want to have to reboot it every day. :wink: But on a serious note, I support Windows at work every day and I regularly find myself more than a little annoyed with it.

Resources is also another factor. In my case, where I virtualize everything, I generally spin up a VM per “service.” That way if I break one thing it doesn’t take down everything. My starting point for an Ubuntu server VM is 512MB of ram and a 6GB drive. Running Windows on less than 2GB and a 15-20GB drive is starting to ask for headaches.

I had been running OH2 on a PI for a while. I was also running a PI for my Ubiquiti UniFi WIFI controller. I was running a UniFi NVR on my desktop computer. This required it to be on 24x7. I just recently migrated to a PC. I went with a Zotac BI323. It has a 6W Celeron quad core. It has 8gb of RAM and a 750g spindle drive for recording the streams from my camera. The PC is running a headless Ubuntu OS. The setup works very well and doesn’t use much more power than a PI.

Well, you might just as well change the order of Linux/Windows and you’ll see our point… :wink:
I stopped using windows at home since about fifteen years, and since about 10 years at work. I since them live a better, less frustrated, life. Sure, there are times that I get in contact with Windows, but those times I remember the bad old times - it is far from the simple and comfortable environment of linux.

Currently I run OH2 on my mail/webserver, and I suppose I will continue doing so, since it works so well. It is also UPS:ed. I do use RPI’s for random stuff, since it is so simple to test things on them, and I guess it would work just fine, perhaps a little bit slower
.
I have about 240 items at the moment.

Surely it must be using “lots” more power than a Raspberry PI, or? According to the specifications, the power supply that comes with the package seems to be rated at 65W. Am I missing something?

Also, it is equipped with a fan for cooling. Any noticeable noise from this?

The system is silent. I am only seeing around 5% CPU utilization. The CPU is rated for a max of 6W but at 5% it is using much less. The SATA drive is probably pulling around 6W. I wish I had a way to measure how much it is really pulling.