Raspbee (zigbee) GIPO serial port

Hi there,

I bough a raspbee (zigbee) trans-receiver which can convert my pi into a zigbee gateway for controlling philips hue, ikea tradfri, osram etc smart lights.

This device connects to the first GPIO ports trough serial interface.
The problem is that the software which comes with it is not able to communicate with the device.
I found a german article which explains that some configuration is needed for the pi bootloader in the /boot/cmdline.txt:
https://raspberry.tips/hausautomatisierung/raspberry-pi-lichsteuerung

normal config in rasbian is:

cmdline.txt ist:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

and should be modified to:

cmdline.txt soll:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

The problem is that in OSMC this is not the same:

osmc@osmc:~$ cat /boot/cmdline.txt
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp2

I changed it to:

osmc@osmc:~$ cat /boot/cmdline.txt
root=/dev/mmcblk0p2 rootfstype=ext4 console=tty1 rootwait quiet osmcdev=rbp2

basically I only added console=tty1, but this seams to have no effect.

I’m quite new to this kind of topic, sorry for my bad explanation.
But someone with more knowledge here on the community maybe can clear this up for me :slight_smile:

Hi,

I maybe wrong but I think you need to add dwc_otg.lpm_enable=0 as well.

Thanks Tom.

Hi,

You say you only added console-tty1 but the Raspbian cmdline.txt also contains console=ttyAMA0,115200 and dwc_otg.lpm_enable=0

I just added them to my Pi 3 running OSMC and it rebooted without any problems. See if adding the extra parameters helps.

(I see Tom beat me to it but he forgot about console=ttyAMA0,115200. :slight_smile: )

Hi,

It read to me like console=ttyAMA0,115200 needed to be removed on raspbian.

So it shouldn’t need adding on osmc

Thanks Tom.

1 Like

You’re right! I’ll go and hide in the corner for an hour. :frowning:

3 Likes

I’ve looked at the installation instructions for deCONZ and, though you might eventually get it to work after some effort, the instructions are aimed at the Raspbian operating system, As a result, I think you will have a greater chance of success if you try installing deCONZ on Raspbian.

Yes, you are right, switching to rasbian will solve the problem… it is just that I have so many things installed on my OSMC at the moment that would make this task quite hard …

btw: running the utility to update the firmware for raspbee device I figure out that some modules are not loaded:

osmc@osmc:~$ sudo GCFFlasher -l
rmmod: ERROR: Module ftdi_sio is not currently loaded
rmmod: ERROR: Module usbserial is not currently loaded
GCFFlasher V2_10 (c) dresden elektronik ingenieurtechnik gmbh 2016/09/26
RaspBee: /dev/ttyAMA0 (default)

no FTDI devices found

rmmod suggests they’re actually being attempted to be removed by the tool.

If I could read German, I could probably help you get it running.
cough @fzinken

1 Like

@luci84tm so reading the article indicates that the change of the console line only is needed to avoid raspbian blocking the UART (ttyAMA0). Assuming that OSMC doesn’t have that configured (@sam_nazarko to confirm) I believe you can leave the cmdline.txt in its original Form.
To be honest to ensure your hardware and cabling is fine I suggest to install raspbian on a second SD card to ensure everything is fine. Than in the second step you can switch back to the OSMC card and get it running there.

Also check output of lsmod when working in Raspbian vs OSMC

Understood. I wasn’t aware that this was the case.

The installation instructions in the article talk about things like:

Run raspi-config and select
“Desktop Log in as user “pi” at the graphical desktop”

and

mkdir ~/.config/autostart
sudo nano ~/.config/autostart/deCONZ.desktop

so I have a feeling that getting it to work on OSMC, which has no graphical desktop, might not be such a straightforward task.

1 Like

Yes, I agree now after this discussion here…

but, there is a deCONZ beta which can run unattended via systemd, that one I wanted to have running:slight_smile:

If you can give us a link to it, I’ll have a look.

here is the link on github:

I used this instruction to install the beta on my pi.

I think based on the instructions the only thing you need to figure out what raspi-config does with this

$ sudo raspi-config

() Interfacting Options > Serial

* Would you like a login shell accessible over serial?
  > No
* Would you like the serial port hardware to be enabled?
  > Yes

Alternatively try to add this two lines to /boot/config.txt
enable_uart=1
dtoverlay=pi3-disable-bt

I’m out of time until this evening, but I can see that the beta still needs a bit of work for OSMC. Two things I’ve quickly found:

User=pi  (in /etc/systemd/system/deconz.service)

which is not a surprise.

And in /usr/bin/deCONZ-run.sh there’s some code

# workaround for distributions linking to libudev.so.1
# check if libudev.so.0 exist and if not patch the elf file to use newer version
if [ ! -f /usr/lib/libudev.so.0 -a -f /usr/lib/libudev.so.1 ]

On OSMC (and also on my Raspbian Pi 1) it looks like libudev.so.X is in /lib/arm-linux-gnueabihf, not in /usr/lib, so this test will fail. OSMC has libudev.so.1 so it should run the patch - but won’t.

Short update: on raspbian it works!

It might be time to invest in a new Pi that’s dedicated to Zigbee - or at least dedicated to applications that need Raspbian. :slight_smile:

Out of interest, on your version of Raspbian does running

ls -l /usr/lib/libudev.so.*

produce anything, other than a “cannot access” error?

Hi there,

Sorry for the delay, but I didn’t find the time to check this till now…

pi@raspberrypi:~ $ ls -l /usr/lib/libudev.so.*
ls: cannot access '/usr/lib/libudev.so.*': No such file or directory

similar outcome I would say …

Well, it’s what I expected to hear, meaning that your Raspbian is the same as my Raspbian.

It also means that the script I referred to, /usr/bin/deCONZ-run.sh, actually doesn’t work correctly but you get away with it on Raspbian because (at least on the version I have) it comes with both libudev.so.0 and libudev.so.1. OSMC only has libudev.so.1, so the code should run the patch, but won’t, I assume causing the binary executable to fail.

The bottom line is that it looks like you’re going to have to put in (at least) a bit of spadework in order to get deCONZ running on OSMC. I appreciate that not all people want to do this, so the sensible alternative is, as I already mentioned, to have a separate Pi dedicated to Zigbee and any other applications that need Raspbian.