Raspberry Pi: Before I Pull the Trigger?

Hello! Last month, I set up an openHab test system, and am loving it. However my desktop is 10 years old, and so is too clunky and power hunger for it to be of any practical use. I’m about ready pull the trigger on a Raspberry Pi, but I thought I’d get some feedback first. There’s a lot of how-to articles on how to set it up, but not a lot of reviews of whether it’s up to the task. One of the reviews I did find said it’s too slow to respond to commands and status changes. What’s your guy’s experience? Is it up to the task?

Currently I have three switches, with the likelihood of adding another switch, and a thermostat in the near future.

I’ll let others chime in as I run on an old laptop but from reading the forum I would say that a good majority of the users have openHAB running on a Raspberry Pi so it can’t be all bad.

Yea, that’s kind of what I was thinking too. But, it never hurts to ask. Thanks!

I have a very small system (3 devices) running on a Raspberry Pi 2 at the moment. It’s been working relatively fine even with a Hue bridge emulator and MQTT host running on it.

However, I’m upgrading to a full blown home media server to consolidate things around the house onto one machine. I’m sure the Raspberry Pi would handle adding a few more devices, but I just don’t have a large amount of faith in a $35 combo motherboard :stuck_out_tongue:

I use Raspberry Pi 2 Model B’s with openHAB and mosquitto, and one runs off an external USB hard disk and also has a MySQL server for persistence, and I think it all runs fast enough. I run them “headless” which I’m sure frees up a lot of resources. The performance is dramatically better than the previous generation – I found openHAB just a bit too painfully slow on Raspberry Pi 1’s. The Achille’s heel, though, are applications that do frequent disk writes, as the microSD card can wear out quickly as a consequence.

1 Like

[quote=“Steve40, post:1, topic:4781, full:true”]
One of the reviews I did find said it’s too slow to respond to commands and status changes.[/quote]

That was true for RPi Version 1.
RPi Version 2 is running fine with openhab.

I’m running about 40 z-wave sensors/actuators/combo nodes off a Pi 2. Fairly complex rules. Generally stable and responsive.

Seconding @watou , you DO have to get writes onto some media other than the native microSD card.

I concur, oh runs fine on a rpi2. Don’t run it on the first generation as that is rather slow.

Key for running it stable for longer term is to have it running on a disk instead of sd cards as those get corrupted over time

I concur with running on a Raspberry Pi 2B. No responsiveness issues, and I also use a secondary USB drive for storage.

Thanks guys! That’s exactly the info I needed. The Pi and the external drive are on order.

180 items here. 25 easy rules, mosquitto, Hue bridge emulator and a squeeze server.
On a 16 G class 10 SD for about 6 months now

0 to 35 cpu when it gets MQTT msgs from the arduino network

About 10 z-wave devices (sockets and sensors) + weather + network health + LG TV, all on a pi 2, which is also running as OSMC media center. No performance issues what so ever demo.

I also run openhab on a Pi2B without major issues but as state from others use an external hdd for heavy read writes. I learnt my lesson a few days back where my database or motion destroyed my sd card.
If you also want to run motion on it it will suffer a bit of performance but it workes on my setup with one 720p webcam stream quite ok.

Does anyone have a guide they followed or better yet an image for a raspberry Pi2? About to play with this in the next week, if none exists I can put one together. Any tips from those who have done it before?

To Joshua_Gilman:
I would like to encourage you not to ‘put all your eggs in the same basket’ as I have been running a mythtv and kodi media setup for a long time and would never recommend putting multiple things in the same computer. If 1 update for one software package breaks something, then you loose the whole lot. A $35 pi2 or an odroid c1+ is excellent because you can image the SD card and keep a backup image and a second PI2 ready to swap out should something break. I guess it depends on how much you rely on a working openhab setup.
Also my media backend computer uses 30 watts of power when idle, a PI2 uses 2 watts from the wall when idle and using a wired network.
If you like kodi for your media player, then you can use the spare PI2 for kodi that you can grab should the openHAB pi2 go down. Check out ‘OSMC’ project.

[quote=“matt1, post:14, topic:4781, full:true”]
Does anyone have a guide they followed or better yet an image for a raspberry Pi2? About to play with this in the next week, if none exists I can put one together. Any tips from those who have done it before?[/quote]

  1. Image
  2. Formatting SD-Card
  3. Writing image from 1) to SD Card
  4. Installing OH via apt-get, follow also this link and follow it all exactly
  5. only issue: after installing via 4) make sure every file and folder has user:group openhab:openhab.

Assuming you are on a Windows machine, slightly different when on Linux or Mac.
Works like a charm, done in about an hour.

Good luck.

Edit to 5): folders are:

service configuration /etc/default/openhab
site configuration /etc/openhab
log files /var/log/openhab
userdata like rrd4j databases /var/lib/openhab
openHAB engine, addons and /webapps folder /usr/share/openhab

Great info, everyone! Are there any recommendations on which OS is must suitable, or the pros and cons of your OS?

I have a huge openHAB environment running on a Raspi PI 2 as well. No performance issue here at all.
There is just one thing that should be considered when it comes to devices with limit memory (1GB in case of the Pi2) and the usage of a Java application like openHAB… Garbage collection.

It seems the Java runtime normally gives each running java process a limit of maximum memory used and a much lower threshold on how small it can/should become in the memory. This means every information allocated in the memory will sooner or later be removed (to freeup space for new information).
In our use case, openHAB is the only Java process running and the most information allocated in memory should not been dropped because it will be reused sooner or later.

I ended up with the following two parameters in the start.sh to set both, the minimum and the maximum memory limit to 650MB…
-Xms650m
-Xmx650m

This is making a real difference. i have a quit complex voice rule to control nearly everything by natural spoken commands. Without those parameters, the first command could take up to 20 seconds until it was processed (far from any acceptable delay). The second command was very fast. Often less than a second.
But after some time (a hour or something) it took 20 second once again… I guess because the garbage collector did get rid of some stuff.

After adding the two parameters. It is all the time fast, except the very first time after starting openHAB (what just happens every few weeks when I do some maintenance) .

Regard
Lars

2 Likes

There have been some people who have reported problems upgrading their RasPis from wheezy to jessie. But if you are starting from scratch I would think that going with jessie from the start shouldn’t be a problem. Just realize that one of the changes in jessie is a move to systemd which means how one configures and controls startup services will be different from the majority of the tutorials you will find out there.

[quote=“rlkoshak, post:18, topic:4781, full:true”]
There have been some people who have reported problems upgrading their RasPis from wheezy to jessie.[/quote]

I can confirm that. Caused a bunch of problems in my case …

[quote=“rlkoshak, post:18, topic:4781, full:true”]
But if you are starting from scratch I would think that going with jessie from the start shouldn’t be a problem.[/quote]

I can confirm that too. No problems when starting from scratch, Jessie and OH 1.7.1 are running stable.

I have a quiet big setup as well:

Some info

  • around 220 items
  • KM200 heater logger as python script
  • weather station connected through serial reader
  • Harmony binding
  • fritzbox script for door bell -> DECT phone ringing
  • some simple voice commands
  • PC alive checks
  • some rather complex scripts (but optimized) based on jsr223 jython
  • local InfluxDB + grafana setup as my persistence database
  • raspberry pi is further used as:
    • wireless switch unit transmitter (433MHZ based)
    • IR transmitter for AV receiver

##System image:

  • very old microsd with 2GB space as “bootloader” sd card
  • runs from 16GB USB-stick
  • debian stretch armhf straight from debian.org (no raspbian):
  • kernel from archive.raspberrypi.org
  • BTRFS root with weekly snapshots
# free -m
              total        used        free      shared  buff/cache   available
Mem:            925         291         100          57         533         554
Swap:             0           0           0

# uptime
 18:55:40 up 50 days, 22:01,  2 users,  load average: 0,01, 0,11, 0,14

So the raspberry pi is not really busy with this setup, it is actually quiet bored :wink:

Side note

One Micro-SD card wear out lately, which resulted in a read only microsd - data could be read but nothing written on it. This was replaced by the MicroSD + USB-stick setup. The MicroSD card was formatted with ext4.