I am new to OH, but I’ve had a Pi 2 based irrigation controller for many years. For those who have experienced issues with the SD card becoming corrupt from time to time, I found that using a low power UPS to power the Pi (one that actively regulates voltage output) solves that problem completely. The Pi is simply very sensitive to voltage.
I’m in the process of setting up a HP Mini 210 netbook with Ubuntu Server 18.04 as a dedicated platform for serving OH. The netbook has an Intel Atom dual core CPU in it - we’ll see how it goes.
This statement isn’t right and dangerous.
It is true that power losses during writes may crash a card so a UPS is a good idea, but there’s also SD corruption due to frequent writes which has nothing to do with the power supply.
SD card corruption caused by an inferior quality part is a different problem.
If you’re trying to achieve long term durability of your SD card it would behoove you to purchase a good quality one. I don’t think I have anything fancier than a 32GB Sandisk part and it’s been running for 5 years continuously with no corruption. It uses the OpenSprinkler Pi project which datalogs to it everyday. I have a 0.5 acre property with multiple zones including citrus, palm, and vegetables - I’ve achieved a level of reliability with the system that allows me to go weeks, if not months, unattended.
Also, the issue with SD card corruption as it relates to the power supply to the Pi is mainly caused by brown-outs - not complete power loss. While I can’t say that I’ve not seen SD card corruption due to a bad power loss situation, it’s the low voltage level that may precede the event that’s usually the culprit.
A typical OH install with persistence enabled makes orders of magnitude more writes per hour than OpenSprinkler makes in a whole day. The two platforms are simply not comparable from that perspective. As with everything YMMV. But let’s do a back of the envelope calculation based on my considerable experience helping users on this forum.
Let’s say we have 500 Items.
250 of those have restoreOnStartup
20 of those are charted
Now let’s say we have an average change/command rate of once per 10 minutes per Item. Some will be far greater, some will be much less.
OK, now let’s look at logs. If you finely tune your openhab.log file we can assume a pretty low rate, let’s say one write per 10 minutes.
events.log writes all events on Items except updates. So this means that every change and every command to any Item generates a write. In addition, updates and events from Things also generate a write to events.log.
So if we put it all together we have:
500 events.log + 1 openhab.log + 250 restoreOnStartup + 20 charts = 771 writes per 10 minutes = 111,024 writes per day
And I low balled these estimates for number of writes. I suspect the average user sees a lot more than this.
And this doesn’t include logs and writes from other services like Mosquitto or Grafana which can be significant in their own right.
At these rates, even a good quality SD card can start to show the signs of wearing out after a year or so, depending on the size of the card, how it does wear leveling, supported number of writes, etc. A 32 GB Sandisk running something that writes as little as OpenSprinkler I would expect to last almost forever. But for something that writes as much as a typical OH install, only a couple of years on a card like this wouldn’t be unexpected.
I will agree that most of the time when we help people on this forum with SD card corruption problems, it most likely is caused by power problems. But we can’t know that so we usually have to recommend replacement of the SD card. But that doesn’t mean it doesn’t happen and I agree with Markus, saying that just using a battery backup power will fix all SD card corruption problems is a dangerous recommendation because it isn’t true. More than once I’ve seen reports of SD cards that have gone corrupt even with battery backup and it always turns out the SD card is small (8-16 GB) and/or their system has a pretty large number of writes per day.
Well, of course… if you’re thrashing your SD card it’s simply going to wear out eventually. Same with SSD. It might make more sense to run the old school mechanical platter drive instead if you’re writing a lot. There’s a reason why file servers still use mechanical platters!
In my experience, an inordinate number of corruptions have been associated with brownouts, but as long as the battery backup solution is capable of supplying a steady output voltage regardless of the behavior of the input voltage (active power regulation) things seem well.
Your brownout or blackout statement may be right or not (note I support getting a UPS, too) but you’re still missing the point.
OH by no means can be compared to OpenSprinkler or similar lightweight SD write loads as @rlkoshak showed.
Point is you wrote this in an openHAB forum where a lot of people use Raspis running on SD, and it is highly dangerous to make them believe that all they need is a UPS.
But they also need to take complementary measures to protect them from having their OH servers crash every few months, see this standard post.
Can you post what NUC exactly you have chosen? I am also looking for a somewhat “low energy”-platform, I even thought about using my synology, but it consumes 30 Watt…
Regarding the general discussion, I agree that Openhab does not have to take care about backing up the underlying OS. OpenHAB is an application, and it even has it’s own backup-scripts which do fine as long as the underlying OS has no modifications.
And even with these scripts, it is far ahead of any Windows-Program, which usually has no backup at all. Even Windows itself has no really good backup, if you want good backup for Windows, you have to stick with 3rd-party software.
So perhaps one should think about which HW to use with Openhab when it comes to backup. If it is Raspberry, one have to deal with Linux (which is not a bad thing, by the way), and if one does not want that, he can still opt to Windows.
From its specs and the price, the NUC7PJYH is a very powerfull. The J5005 is a rather good and fast CPU.
The next reason is, it hardly use any energy. About 10-14 Watt. Thats very low for such a powerfull computer.
In my opinion, a smart home system should be powerfull and use a very limited amount of energy. Unfortunatly these two options often dont go hand in hand.
The price, here in Denmark, is just about 180 Euro. With 8GB RAM it´s 258 Euro, (I already got a spare SSD). It may seem alot comparing to an Rpi or something simular. But a server like this will handle whatever you need it to regarding openhab use and hardly use any energy. Two things which in my opinion is very important.
As openHAB2 is working almost well on a raspberry3, it’s more a question of the other software, such as “a few databases”
Think about 2GByte for openHAB2 plus another 2GByte for a MySQL database (should suffice for private usage)
So 8GByte RAM is more than sufficient. As of processors, anything will fit (given that it’s a current 64bit processor) and the main thing is to find a power-saving model, because the computer will run 24/7.
I agree with you @Kim_Andersen , I was just thinking about the one you mentioned vs the cheapest nuc, f.eks NUC6CAYH which starts from 130e locally (without ram and ssd).
That is Intel NUC Celeron J3455 on 1.5 GHz, and as @Udo_Hartmann says, compared to pi which works just fine, I am sure this cheapest nuc will do all it is being asked to. Or would it?
(I will order one cheapest soon, so please let me know if some upgraded version is more suitable (power consumption is not priority) )
That is a good point, especially buying ddr3 in 2019.
However, considering the 100e price difference, I can purchase 4tb storage for my other nas server
Then the choice goes from “the best” to “good enough”
I run openHAB in NUC as well. What I can recommend is to run openHAB on Proxmox VE.
Proxmox VE is open-source server virtualization environment (debian distro + KVM hypervisor + nice web GUI). Basically everything can be done via GUI, so for new users it should be rather easy to use as well.
What is great in Proxmox, is that is also support scheduled snapshot (live) backups out of the box without need to shutdown the VM.
Even Proxmox is very lightweight and most probably run well also on cheapes NUC, I recommend to buy little bit better than just cheapest one.
My NUC7i3BNH is overkill for openHAB only, but I run some other VMs as well. My NUC support both M.2 and 2.5" drives and I have installed proxmox on M.2 SSD and all VMs to other.
There is a guide in this forum how to install Proxmox VE and openHAB
Virtualisation is a really nice and cheap technique to improve usage and workload of hardware.
Proxmox is free of charge if you don’t want support. if the system is growing, it’s possible to build a datacenter by using 3 or more real computers. A datacenter is able to run virtual machines (without real hardware) on every node, failover is built in
Indeed a big adventure park, but openHAB is just one fraction of services to run at such a datacenter…
@Kim_Andersen not sure why in norway price difference is 80e between the two (ram is almost the same, few euros there as well). I will sleep on it
P.S. you should try Virtualisation if you never did, just spin some vagrant machine on your desktop and see how you like it, ability to take snapshots and rebuilt machine in 60s when testing is priceless for me (probably because I do not know what I am doing with linux, so most of the time I am just guessing)