PiFace not working with OH2 with lates Raspian version

I tried to get the PiFace board running with OH2 based on latest Raspbian version (August 2017, Kernel 4.9), i did the following steps:

  • install ohpiface according this HowTo:
    Step 3 is outdated from my point of view, due to a device tree Raspi Kernel. But I checked the correct loaded module by

lsmod | grep spi_bcm2835
spi_bcm2835 7596 0

  • I configured the only necessary entry in piface.cfg:

pifaceid1.host=192.168.178.24

  • I created my items for the PiFace, e.g.:

Switch PifaceSwitch1 “Relay 1” (PiFace) { piface=“pifaceid1:OUT:0” }

  • and in addition, based on a community discussion, I changed the user for the openhab service to root. ps -aux shows me, that the openhab is executed as root now. Output from px -aux:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.4 5452 3912 ? Ss Aug22 0:06 /sbin/init
root 2 0.0 0.0 0 0 ? S Aug22 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S Aug22 0:01 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/0:0H]
root 7 0.0 0.0 0 0 ? S Aug22 0:30 [rcu_sched]
root 8 0.0 0.0 0 0 ? S Aug22 0:00 [rcu_bh]
root 9 0.0 0.0 0 0 ? S Aug22 0:00 [migration/0]
root 10 0.0 0.0 0 0 ? S< Aug22 0:00 [lru-add-drain]
root 11 0.0 0.0 0 0 ? S Aug22 0:00 [cpuhp/0]
root 12 0.0 0.0 0 0 ? S Aug22 0:00 [cpuhp/1]
root 13 0.0 0.0 0 0 ? S Aug22 0:00 [migration/1]
root 14 0.0 0.0 0 0 ? S Aug22 0:00 [ksoftirqd/1]
root 16 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/1:0H]
root 17 0.0 0.0 0 0 ? S Aug22 0:00 [cpuhp/2]
root 18 0.0 0.0 0 0 ? S Aug22 0:00 [migration/2]
root 19 0.0 0.0 0 0 ? S Aug22 0:00 [ksoftirqd/2]
root 21 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/2:0H]
root 22 0.0 0.0 0 0 ? S Aug22 0:00 [cpuhp/3]
root 23 0.0 0.0 0 0 ? S Aug22 0:00 [migration/3]
root 24 0.0 0.0 0 0 ? S Aug22 0:02 [ksoftirqd/3]
root 26 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/3:0H]
root 27 0.0 0.0 0 0 ? S Aug22 0:00 [kdevtmpfs]
root 28 0.0 0.0 0 0 ? S< Aug22 0:00 [netns]
root 29 0.0 0.0 0 0 ? S Aug22 0:00 [khungtaskd]
root 30 0.0 0.0 0 0 ? S Aug22 0:00 [oom_reaper]
root 31 0.0 0.0 0 0 ? S< Aug22 0:00 [writeback]
root 32 0.0 0.0 0 0 ? S Aug22 0:00 [kcompactd0]
root 33 0.0 0.0 0 0 ? S< Aug22 0:00 [crypto]
root 34 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 35 0.0 0.0 0 0 ? S< Aug22 0:00 [kblockd]
root 36 0.0 0.0 0 0 ? S< Aug22 0:00 [watchdogd]
root 38 0.0 0.0 0 0 ? S< Aug22 0:00 [rpciod]
root 39 0.0 0.0 0 0 ? S< Aug22 0:00 [xprtiod]
root 40 0.0 0.0 0 0 ? S Aug22 0:00 [kswapd0]
root 41 0.0 0.0 0 0 ? S< Aug22 0:00 [vmstat]
root 42 0.0 0.0 0 0 ? S< Aug22 0:00 [nfsiod]
root 52 0.0 0.0 0 0 ? S< Aug22 0:00 [kthrotld]
root 53 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 54 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 55 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 56 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 57 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 58 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 59 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 60 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 61 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 62 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 63 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 64 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 65 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 66 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 67 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 68 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 69 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 70 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 71 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 72 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 73 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 74 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 75 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 76 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 77 0.0 0.0 0 0 ? S< Aug22 0:00 [iscsi_eh]
root 78 0.0 0.0 0 0 ? S< Aug22 0:00 [dwc_otg]
root 80 0.0 0.0 0 0 ? S< Aug22 0:00 [DWC Notificatio]
root 81 0.0 0.0 0 0 ? S< Aug22 0:00 [VCHIQ-0]
root 82 0.0 0.0 0 0 ? S< Aug22 0:00 [VCHIQr-0]
root 83 0.0 0.0 0 0 ? S< Aug22 0:00 [VCHIQs-0]
root 84 0.0 0.0 0 0 ? S Aug22 0:00 [VCHIQka-0]
root 85 0.0 0.0 0 0 ? S< Aug22 0:00 [SMIO]
root 87 0.0 0.0 0 0 ? S Aug22 0:00 [kworker/2:1]
root 89 0.0 0.0 0 0 ? S< Aug22 0:00 [bioset]
root 90 0.0 0.0 0 0 ? S Aug22 0:13 [mmcqd/0]
root 92 0.0 0.0 0 0 ? S Aug22 0:07 [jbd2/mmcblk0p2-]
root 93 0.0 0.0 0 0 ? S< Aug22 0:00 [ext4-rsv-conver]
root 94 0.0 0.0 0 0 ? S< Aug22 0:00 [ipv6_addrconf]
root 111 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/1:1H]
root 133 0.0 0.0 0 0 ? S Aug22 0:06 [kworker/2:2]
root 139 0.0 0.3 9928 3656 ? Ss Aug22 0:05 /lib/systemd/systemd-journald
root 142 0.0 0.3 11984 3044 ? Ss Aug22 0:00 /lib/systemd/systemd-udevd
root 194 0.0 0.0 0 0 ? S Aug22 0:00 [spi0]
root 341 0.0 0.0 0 0 ? S< Aug22 0:00 [cfg80211]
avahi 412 0.0 0.2 3996 2588 ? Ss Aug22 0:06 avahi-daemon: running [wassermelderpi.local]
root 413 0.0 0.2 32140 2664 ? Ssl Aug22 0:01 /usr/sbin/rsyslogd -n
root 416 0.0 0.2 5544 2396 ? Ss Aug22 0:00 /usr/sbin/cron -f
message+ 419 0.0 0.3 5488 2892 ? Ss Aug22 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork –
avahi 426 0.0 0.0 3872 244 ? S Aug22 0:00 avahi-daemon: chroot helper
root 458 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/3:1H]
root 459 0.0 0.2 3848 2444 ? Ss Aug22 0:00 /lib/systemd/systemd-logind
nobody 483 0.0 0.1 2288 1448 ? Ss Aug22 0:00 /usr/sbin/thd --daemon --triggers /etc/triggerhappy/triggers
root 512 0.0 0.3 7152 2984 ? Ss Aug22 0:01 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid
root 515 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/2:1H]
root 697 0.0 0.1 2560 1772 ? Ss Aug22 0:06 /sbin/dhcpcd -q -w
root 698 0.0 0.4 7860 4248 ? Ss Aug22 0:00 /usr/sbin/sshd -D
root 701 0.0 0.3 5316 2908 ? Ss Aug22 0:00 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
root 732 0.0 0.1 4524 1756 tty1 Ss+ Aug22 0:00 /sbin/agetty --noclear tty1 linux
root 733 0.0 0.1 4344 1880 ? Ss+ Aug22 0:00 /sbin/agetty --keep-baud 115200 38400 9600 ttyAMA0 vt102
ntp 934 0.0 0.3 5772 3696 ? Ss Aug22 0:12 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /var/lib/ntp/ntp.c
root 994 0.0 0.7 23608 7412 ? Ss Aug22 0:19 /usr/sbin/nmbd -D
root 997 2.3 16.2 431240 153928 ? Sl Aug22 33:39 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.c
root 1020 0.0 1.3 36152 12480 ? Ss Aug22 0:07 /usr/sbin/smbd -D
root 1025 0.0 0.5 36152 5084 ? S Aug22 0:00 /usr/sbin/smbd -D
root 1074 0.0 0.0 0 0 ? S< Aug22 0:00 [kworker/0:1H]
root 1463 0.0 0.0 0 0 ? S Aug22 0:06 [kworker/1:0]
root 1465 0.0 0.0 0 0 ? S Aug22 0:00 [kworker/1:3]
root 19871 0.0 0.0 0 0 ? S 10:15 0:04 [kworker/0:2]
root 28776 0.1 0.0 0 0 ? R 17:21 0:08 [kworker/u8:1]
root 29465 0.0 0.0 0 0 ? S 17:46 0:01 [kworker/3:2]
root 30246 0.1 0.0 0 0 ? S 18:17 0:04 [kworker/u8:0]
root 30511 0.0 0.0 0 0 ? S 18:28 0:00 [kworker/0:1]
root 30652 0.0 0.5 12144 5244 ? Ss 18:34 0:00 sshd: pi [priv]
pi 30659 0.0 0.3 4972 3232 ? Ss 18:35 0:00 /lib/systemd/systemd --user
pi 30662 0.0 0.1 6880 1232 ? S 18:35 0:00 (sd-pam)
pi 30665 0.0 0.3 12144 3524 ? R 18:35 0:00 sshd: pi@pts/0
pi 30667 0.0 0.4 6768 4412 pts/0 Ss 18:35 0:02 -bash
openhab 30709 0.0 1.4 36956 13812 ? S 18:37 0:02 /usr/sbin/smbd -D
root 31548 0.1 0.0 0 0 ? S 19:07 0:01 [kworker/u8:2]
root 31581 0.0 0.0 0 0 ? S 19:08 0:00 [kworker/3:0]
pi 31811 0.0 0.2 5212 2136 pts/0 R+ 19:17 0:00 ps -aux

But nothing works :frowning:

Here the openhab.log:

2017-08-23 19:16:13.515 [ERROR] [inding.piface.internal.PifaceBinding] - Failed to send command (3) to 192.168.178.24:15432 (attempt 2)
java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)[:1.8.0_121]
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)[:1.8.0_121]
at java.net.DatagramSocket.receive(DatagramSocket.java:812)[:1.8.0_121]
at org.openhab.binding.piface.internal.PifaceBinding.sendCommand(PifaceBinding.java:305)[181:org.openhab.binding.piface:1.10.0]
at org.openhab.binding.piface.internal.PifaceBinding.sendCommand(PifaceBinding.java:274)[181:org.openhab.binding.piface:1.10.0]
at org.openhab.binding.piface.internal.PifaceBinding.sendReadOutputPins(PifaceBinding.java:256)[181:org.openhab.binding.piface:1.10.0]
at org.openhab.binding.piface.internal.PifaceBinding.access$6(PifaceBinding.java:255)[181:org.openhab.binding.piface:1.10.0]
at org.openhab.binding.piface.internal.PifaceBinding$PifaceInitialiser.initialiseBindingConfigs(PifaceBinding.java:597)[181:org.openhab.binding.piface:1.10.0]
at org.openhab.binding.piface.internal.PifaceBinding$PifaceInitialiser.run(PifaceBinding.java:562)[181:org.openhab.binding.piface:1.10.0]

Strange… From my point of view, the ohpiface UDB server is not working / running. I could not find it in ps -aux and I’m not sure, if the HowTo is working on a systemd based kernel. Does anybody has the same problems and can help me here?

Thanks!

Is there’s nobody how can help me on that topic? Anybody who has a working Piface currently?

Thanks for the support!

I solved the problem by my own -> proud :smile:

Short update for other users with the similar problems:
the install scrips are made for the usage with Linux user “pi”, if you use Openhabian, you the standard user is “openhabian” and based on that have to

Perhaps it makes sense to update the scripts for the new Openhabian. I usefull, I can help…

Ask me, if you need help in setup piface for Openhab :slight_smile:

Hi Alexander,

thanks for this post. It helped me (almost) to fix my errors.

One final test that helped me was that I exectued

sudo /etc/init.d/ohpiface start

from command line. There I’ve seen the real error why things are failing. In my case it was a spelling error in my config files.