Raspberry Pi: Before I Pull the Trigger?

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.

Any instructions for this kind of setup somewhat?

1 Like

Here is one:

1 Like

Consider the fact that the Apollo 11 guidance computer has 64Kb of RAM and a clock speed of 0.043Mhz…I think the Pi 2 can monitor a few sensors without too much trouble. :wink:

http://www.computerweekly.com/feature/Apollo-11-The-computers-that-put-man-on-the-moon

I run OpenHAB on a Pi 2 and have been VERY happy. Worked great on my original Pi as well. Pull the trigger!

If you are looking for:

# cat /etc/apt/sources.list
deb http://httpredir.debian.org/debian stretch main contrib non-free
deb http://archive.raspberrypi.org/debian jessie main

# cat /etc/apt/preferences.d/raspberrypi 
Package: *
Pin: origin archive.raspberrypi.org
Pin-Priority: 1

Package: raspberrypi-bootloader
Pin: origin archive.raspberrypi.org
Pin-Priority: 1000

Package: libraspberrypi0
Pin: origin archive.raspberrypi.org
Pin-Priority: 1000

Package: libraspberrypi-bin
Pin: origin archive.raspberrypi.org
Pin-Priority: 1000

you will need from archive.raspberrypi.org the following packages:

libraspberrypi-bin
libraspberrypi0
raspberrypi-bootloader
  • BTRFS (and/or USB-Stick):

instead of formatting the SD-card/USB-stick with ext4 you use btrfs and add a subvolume @ as root subvolume

# cat /boot/cmdline.txt 
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/sda1 rootflags=subvol=@,commit=300 rootfstype=btrfs elevator=deadline rootwait

# cat /etc/fstab 
/dev/mmcblk0p1 /boot vfat noatime 0 2
/dev/sda1 / btrfs defaults,noatime,nodiratime,discard,commit=300,subvol=@ 0 1


Give ODROID C1 a chance.

Its much faster than RPI2, e.g. due to Gigabit LAN. Works like a charm here: Stable, reliable, faster than RPI2. Using traditional UBUNTU gives you more choices on software and long term support.

I kicked all my RPIs and did not regret it.

Regards
Gerry

In step 4 the second link HW FAQ

It says “setting RAMTMP=yes in /etc/default/tmpfs these I/O operations will be RAM access rather than slow SD card I/O”

But with the Jessie Raspbian image (non-lite) from step 1 no matter what setting I use in /etc/defaults/tmpfs I appear to see the same file system.

It is shipped with

I also tried RAMTMP=yes and RAMTMP=no
(Yes uncommented)

What is the best setting?

Tom

I made the same experience and since then I use
tmpfs /tmp tmpfs defaults,noatime,nosuid,mode=0755,size=50m 0 0
in my /etc/fstab, works fine.

2 Likes

Yes it does! Thanks

Hi Lars! Where are you from? By your name im guessing Scandinavia? :slight_smile: Im asking because of the voice control you are mentioning - is it in English? Or If its in Norwegian for example, willing to share the ruleset? :slight_smile:

I am using an Raspberry PI 2 and are very satisfied. I will now go for an external disk. Should I go for an external SSD or standard?

/mike

Probably what ever is cheapest. OH does not appear to be IO bound and I don’t think you would see a difference over USB 2 between the two anyway.