Best hardware platform

I’ve been running on a Pi3 for over a year and I’ve never had to replace the SD card or reboot it aside from config changes and to move it so I could include my zwave locks. What I ended up doing is just redirecting /var/log to an NFS share on my PC to save on wearing on the SD card

Nice to know it’s possible. But it would be cool with something a bit more built in and ready to go. :slight_smile:

The number of people running OH who would want to use syslog is a very tiny percent. And since those same people will already have the skills to set up rsyslog will also have the skills to add a new log4j2 appender to the logging config I don’t see how it would be worth the extra effort to make something “built in and ready to go.”

Of course, PRs are welcome if you disagree.

2 Likes

Hi @NCO,
4 months ago you said that you moved to a rpi with ssd. What are your experiences with this setup up to now?

1 Like

Sorry for the delay.
I am absolutely happy with it.
No issues anymore regarding hanging system and such.
I am using this one now:
https://www.element14.com/community/docs/DOC-83477/l/desktop-computer-kit-with-expansion-board-that-can-turn-a-raspberry-pi-into-a-real-desktop-pc

Just yesterday I bought another ssd to make a safe image of the runtime system.
Now I am absolutely convinced that this is the right way (at least for me).

I use a raspberry pi 2 currently and I am trialing this method to deal with SD corruption as it only occurs when you write to the card. I also use a UPS which is key to stopping power outages causing issues. Stop the writes and you stop the corruption, it really is that simple. The green LED on the pi shows you when the sd card is writing.

Is anyone using the XU4 from odriod?

Thanks very much @NCO

Note that reducing the writes only delays the wear out. Since it is impossible to eliminate ALL writes to the SD card this approach will primarily just delay the inevitable.

That being said, reducing the writes enough and given an SD card big enough you could extend the life of the SD card to decades so it can certainly be worth while.

My biggest problem with SD cards though is there is no forewarning when it is worn out. The system will simply start behaving strangely and you will not have a real good way to know how long the SD card has been failing so you know how far back in your backups you need to go.

I’m using a Ockel Sirius B miniature PC running Windows 10. I was one of the backers of the Indiegogo campaign and decided to use it as a dedicated openhab server. It’s really tiny, barely larger than my phone.

I never consider loading Linux on it, despite coming from UNIX and having also spent time with IBM AIX. I’m more comfortable using Windows at home

1 Like

That is not even close to why I reduce and aim to stop writes, I do not care about the flash wearing out as that is such a small aspect of the issue. Flash storage in general works by storing things in BLOCKS and the issue is because when doing a write to a log file, that same storage block can/will contain parts of other files in it. If the power fails in the middle of a write, you will get data corruption and it is not corruption just in the log file, it corrupts other files that you rely on for a stable setup. This is true of all flash types and (sorry I have to laugh when people tell me a usb stick is better) unless the hardware has a way built in to handle it like a SSD does which is why they are larger and cost more. Essentially they have a mini UPS built in that detects a power issue and will dump to the storage and complete any writes before the power completely fails. The only reason using a USB stick helps is because if you move the log files to a USB stick, you then move the writes onto the USB stick where no important files are contained. The storage blocks only contain log files and hence it is less of an issue. If you understand the root of the problem, you can then design around it and you can google and read more on this topic.

Flash wearing out is no where near what people make it out to be, usually it is a fake counterfeit card or is caused by people thinking that pulling the power out is OK because the PI has a usb power input. It is never ok to pull the power when a write is occurring or a file is open. A UPS is important and small cheap ones for a PI exsit as someone linked to a nice case in a post above that has one added.

I worked for years on a development team for an embedded Linux device which used flash storage and I was part of the design meetings of a large team discussing this. I then littlerally pulled the power out hundreds of times each day when doing testing on the device so it does work. It is also known and discussed about in other rasbian projects yet here in Openhab land very few people attempt to stop the mis-information. Stopping all writes completely can be done by mounting as read only, which makes things harder when wanting to do updates and trying to provide support to people with little Linux experience. Doing what I outlined in my post has worked well for me when I reduce the log file generation to keep the logs below 17mb where they rotate. The other downside is it requires a UPS as in the case of brown outs where the power cuts in and out it wrecks havoc to a SD card as my current method does not stop the writes on boot up and shutdown, hence a intermittent power will quickly corrupt things still.

I use two PIs setup ready to go to swap out and use images of the cards as a backup. With so many PI’s around the house and the ability to write the image to a new flash card it is simple to get other people to swap a device out when I am not around.

2 Likes

Anyone tried one of these?
2gb ddr3, gigabit Ethernet, sata and loads more grunt than the pi range.

http://www.hardkernel.com/main/products/prdt_info.php?g_code=G151505170472

I have one C2 running fine as a Kodi server but not as OH server. Just saw a new thread on this forum about someone doing that, though.
Downside is C2s are not pin compatible w/ Pi hats and you cannot use openHABian images, so it’s always somewhat off-mainstream.

Which is what the UPS is for.

Agreed, USB is no better.

And yet we all seem to experience the problem at some point or other. And often it is ready to tell the difference. For example, a files that revert to the same older version on restart of the OS every time is not caused by the corruption of a single block.

And stopping all upgrades and updates, dealing with the writes to fake hwclock, etc. Agreed, you can run as read only but you have to disable a lot of other important features like OS and OH upgrades. If not, then you have only reduced the amount if writes, not eliminated them. But if you reduce enough of them then it’s no big deal as you have extended the life of the SD card beyond what anyone should need.

And you have a fool proof way to help people I’d such a counterfit?

From a practical perspective on the forum, it is exceptionally difficult if not impossible to help or guide a user through the process of diagnosing the difference between corruption because of power loss. So we have two choices. We can risk waisting time and have them rebuild on the old SD card it were can have them go but a new one and stress the need for backup and restore procedures and a move to a network mount or SSD or HDD.

Sorry, I’m not convinced. Guess I’ll just have to keep spreading my missinformation.

My appolgies that was not directed at you, I got ranting about what people in general write and should not have done so after hitting reply on your post.

It seems like there is a need for hardware targeted specifically for OpenHAB. I have a Wink Hub 2 which has Zigbee, Zwave, BT and Wifi radios and yet it is largely useless when it comes to bindings for my stuff and no way to improve it. If I made a Wink Hub2-like Linux board with all the radios would people be interested? My current thinking:

  • Uses multiple Ember EFR32 chips which can be configured for Zigbee, Zwave or BTLE
  • Uses Octavo OSD335x which is basically a BeagleBone Black in SoC form.
  • Would still have usb, GPIOs, I2C, etc…all the stuff a BeagleBoneBlack has.
  • Would have built-in flash plus sd-card…but configured in a way that the OS doesnt get corrupted. I’ve had this happen on some of my RPi/BBB projects as well.
  • This thing would be small and cute. Probably about the size of a hockey puck would do it.
  • It would not be RPi cheap unfortunately…scale/demand can’t compare to RPi demand and thus economics. The Octavo chip itself is $40, PCB, case, plus 3 Ember radios and a Wifi one I might be able to target $150.

You can’t even get RPi processor chips so RPi-based is a bust unless I just make a Hat. Would people prefer just a Hat with the radios? That would likely be cheaper, but doesnt solve the corruption issue.

I am new to HA in general but this is trully the Inter-mess of Things. The industry is still too fragmented but OpenHAB is the first thing I’ve seen that seems to bridge the divides. I just got some NXP based chips working with custom firmware based on their SDK and going to try out the Ember ones next as their chips can become any mesh-net standard - zigbee, zwave, btle, etc.

Someone already has done this, at least they did it using a RPi compute module as the “computer” part. I can’t find the original postings right now. I’m not sure how much it cost though.

One if the challenges is zwave is proprietary and needs to be licensed by device manufacturers which drives up cost quite a bit.

On the other hand, building something like this is exactly why the core of OH was split out into a separate project under Eclipse so that companies get assurances that the IP had been properly transferred and they face no down stream risk of an IP violations. So what you propose is right in line with where we want to go.

This would be very hard to do in a then key system like you propose without not supporting persistence and not preserving lids across the reboot.

Dealing with corruption caused by power failures will be challenging as well, see Matt’s posting above.

That’s an idea. They to an approach that a lot of people take (e.g. OpenSprinkler) and you can sell it BYOP or with the RPi. Lots of people already have RPis lying around.

One challenge will be managing interference. I do know lots of people have issues trying to enable BT and the Razberry zwave hat at the same time. I’ve had problems running the BT in scanning mode with the wifi on RPi0w and RPi3.

Another form factor that would be even more useful to me and those who don’t run on a SBC would be a stand alone device that I can access over the network with all of those radios. Then I can put it in the ideal location and host my OH in the basement, for example.

Making something like that turn key might be a bit of work but I bet enabling some Discovery over the network and scripts to set up socat would be doable.

Thanks Rich. I found the other thread with the RPi Compute3. I forgot about the RPi compute sticks and they are actually cheaper than the Octavio SoC and more powerful.

I was hoping to keep the IP/proprietary stuff in the Ember chips so there are no violations. Really I would like to just make the Embers like “wired in usb devices” without usb. I.e. the dongles seem to be Ember+FTDI device so I can just skip the FTDI device. I’m not certain of this yet. Also, perhaps being integrated means it then violates Zwave licensing, I dont know yet. How mature is the Ember coordinator? I hear it works great with zwave but lots of issues with zigbee.

I believe there is a way to prevent corruption if the OS was prepared for this hardware. Perhaps partitioned into a read-only root/OS, config and data parts. Config part can be configured for immediate sync/flush and the once in a blue-moon writes would rarely coincide with power loss, etc. The data part would be the only risk, mostly logs and state data. This could corrupt but should be easily recoverable or just wipe if you dont care about history. The config part could be backed up to cloud. It also helps to pair down the Linux OS to minimal services. I’ve had these same issues on my RPi converted treadmill which I cant wait to control via HAB+Alexa “Alexa, double time!” haha

I was thinking this puck would be stand alone like you see. I would still have built-in Ethernet too but I tend to favor Wifi for most things.

I am now thinking Hat or Compute board is the ticket. Maybe I will just wait for Sergio to come out with his board though I am not seeing mesh radios on there.

I think this thread seems to concentrate all to much on hardware failure (specially regarding SD/writing to disc). And maybe this is correct. What worries me is, this is a rather general matter on all platforms and all kinds of storage systems. And there is really only one solution - Backup.
You can not have a 100% fail-save system, and specially not a system like OpenHab running on an Rpi from a SD card. So while it might be a good idea to use an external HD for your system, you still need to backup the system.

Now… I doubt many disagree with that. Well, what really makes me wonder - Where is the backup option in OpenHab? Heck, we´re building automating systems here, and yet, for backup, there doesn´t seem to be any good and easy automatic solution…(easy - It has to be easy for people to use it).

Why ??

I have notices in openhabian-config there is something called Amanda backup. To be honest. If thats what it takes to do a backup. I´ll rather take the chances, make some manual copying from a SSH client once in a while, or otherweise start all over… This is NOT a motivating backup solution for anyone else, than people who already knows everything about liunx. I´m not one of those! Untill I started of with Openhab several months ago, I knew nothing about Linux. Today i know some, but thinking about it. First thing to know should have been a easy backup solution for “dummies” likes me!

I wonder why there isnt an option inside PaperUi to configure and run somekind of backup system. A simple scipt which add all important files into a zip file to download. Maybe even an advance option to do it automaticly and save to a network share path, cloud, whatever. And a super advance option, running in a crone job.
My bet is, this would motivate users to do more backups.

But backing up Openhab may only be half the need thing to do. Reading about the Amanda backup it also mentioned someting like z-wave networking. I admit, I never thought about this untill I read it. But one actually have to make a backup of the z-wave network as well in case the controller fails. Well, now things gets a bit complicated. And then I wonder again - I have the z-wave binding installed. Why isn´t there an option to backup the z-wave network from the binding as well? This leave me to search and install some 3.part utility to do this backup… But why? Is it a limit in the Rpi where my z-wave controller is connected to? I doubt that, to be honest. My windows PC can do it. But my controller is connected to my Rpi. So it makes not sense to remove the controller from the Rpi, place it in my PC to do backup, and then put it back to my Rpi. It does not make the over-all backup procedure an easy to remember thing. And it most probably ends up with not beeing done.

My guess is, if developers of systems (software in general) first thoughts was, “What to do when things goes wrong” (again note, it´s not an “if” question). Things like bad SD cards, hardware failures etc would be short term discussions in general. (And I would have saved myself lots of time writing this :slight_smile:)

Well just some thoughts I have been doing lately.

1 Like

I’m no expert nor an a lawyer, but my understanding is that if you sell a hardware device that claims to be zwave compatible, it has to be certified (i.e. go through testing) and you have to pay a license. It is the terms required to use the zwave trademark and name. I don’t think using the Ember chips will get you past that hurdle unless Ember has already paid the dues and done the testing for you, in which case that cost is already included in the cost of the Embers.

I’ve never heard of it so I can’t say.

See Matt’s posting above. If they are on the same SD card then a write to the data partition can corrupt the read only partition on a power failure because of the way the SD technology works. Using a separate partition won’t avoid this. Only using a separate physical SD card will.

And honestly, if it were me I’d more concerned about corruption on the data partition than the OH partition. I can rebuild the OS but if I lose my database that data is gone for good. And if you are looking for a turn key system, you must find a way to prevent corruption of the database. You can’t just throw it out on every reboot.

Have a look at the Docker Images.

However, be careful pairing down too far. One of the more powerful workarounds for integrating a lot of technologies that do not have a binding is through the Exec binding or executeCommandLine. If you pair down the OS too far you render both of these useless. This is actually a pretty big problem with the Docker containers and is a reason why I have a small python service running that I can send an MQTT command to to execute command line stuff for me (I run in Docker). The commands I need don’t exist in the container. Heck, the Network binding is neutered in Docker because there is no ping or arping command available. Heaven help you if you want to use some Python script you found that implements the protocol for your alarm system or something like that.

I’m intrigued. Bet it would make a great write-up.

You will see Markus and I push this very strongly all over the forum. If you have a good backup AND tested restore procedure then it doesn’t really matter when/if you have an SD card failure. And if you have a good backup and restore procedure, then that really is the solution and you don’t really need to spend any time on reducing writes and the like.

However, when an SD card wears out, you still have the problem that it does so silently. There is no SMART for SD cards to tell you when it is about to fail. Weird stuff just starts to happen. And once you finally notice it you don’t know how long it has been wearing out and you don’t really know the extent of the corruption. Consequently, you don’t know how far you have to go back to get to a good backup.

openHABian has Amanda backup and recovery built in. Since OH 2.2 OH ships with backup and restore scripts in the bin directory. A lot of us use software configuration management tools like git to backup and restore our configurations. Even more people take images of their SD cards using WinDiskImager or Etcher or whatever.

The JSONDB where all the configurations done through PaperUI or the REST API gets backed up automatically.

The disk image approach is by far the simplest for non-technical users. Just shutdown the RPi, pull the SD card, make the image on your Windows machine, plug it back in and reboot.

The problem is backup to what? How? Everyone’s system is different. They all have different

Because OH runs on just about everything and the nature and method of the backup would be different for each and every OS that OH can run on. That isn’t to say that it is impossible but it isn’t easy and no one has taken it upon themselves to implement something. The fact that Benjy has implement the backup and restore scripts that ship with OH to make them work across all OSs is honestly pretty awesome already.

And then you have to problem of what to backup. A simple script like you mention and what Benjy wrote pretty much already does that. However, what about your Mosquitto configuration? What about the contents of your InfluxDB where all that data you have been saving for the past year resides? There is no way that stuff can be backed up from PaperUI because all of that stuff is third party and it may or may not even be there. That is why openHABian uses Amanda as that backups up the whole system.

This is another thorny problem. Not everyone uses zwave and not every zwave controller supports being backed up and restored.

Because it hasn’t been implemented. OH is an opensource project. People donate their time to work on those things they want to work on. There is no way to force anyone to work on anything in particular.

Usually that 3rd party tool comes from the manufacturer. I can’t say for certain but I wouldn’t be surprised if the method and API calls necessary to do a backup and restore of the SD card controller varries from vender to vender and even potentially from model to model. I don’t think there is a standard way to do it. I know for sure the Aeontech Gen 2 doesn’t even support it. That’s one of the reasons I recently switched off of it.

So this is just one binding. Multiply that by 300+ bindings and it really starts to become an untenable problem. Perhaps someday it will be addressed but to do so will take extensive addtions to the core of Eclipse Smarthome.

So your best bet is to backup the whole damn system which means:

  • cloning the SD card like described above
  • running a tool like Amanda

If all you care about is OH, then you just need to grab /etc/openhab2 and /var/lib/openhab2, which is what Benjy’s scripts that ship with OH does.

It spounds so simple. But how simple does it sound to produce a backup and restore system that:

  • works on Windows, openHABian, other Linux, QNAP, Synology, and Docker
  • backups up not just OH stuff but backups up the configuration of the data stored on external hardware (e.g. the zwave controller)
  • backups up the configuration and data stored by third party service including one or more of five separate database servers not counting the near infinite number of database servers that support JPA or JDBC (JPA and JDBC are standard interfaces impemented by databases so OH doesn’t even know what the database in if using these)?
  • backups up other externalities like that one Python script you found on Github that lets you talk to your alarm system using the Exec binding
  • backs up the operating system itself
  • Oh, and that hardware or those external services that you are trying to back up may not even be running on the same machine as OH

It’s a pretty challenging problem.

1 Like

I have been testing the Telegea Smart Hub for some time now and while it was a bit of a learning curve to get OpenHABian loaded onto the RPi compute once I did it’s been pretty solid.

It’s funny though because I’m now comfortable with imaging the SD card in my main raspberry pi regularly as a backup and now I’m nervous as to how I’d backup the compute board. I’m sure there is a way though.

But the smart Hub does have plenty of functionality so do take a look at it! I was lucky enough to get a review unit to test out so not sure of the final cost though.