Zigbee raspberry pi serial

Best part now!
I paired two lights successfully. But the switches won’t pair (Ikea and philips) so i decided for today it’s enough tinkering and put the dongle into the old rpi that worked. But - it won’t start.

Somehow the dongle prevents the PI from booting up.

I unplugged the dongle and the PI starts - same with the new PI with nymea on it.
Damn!

I just ordered a ConBee II from reichelt.

Glad the lights worked, that part is quiet stable already using the generic cluster based approach.

The switches work too, but there the automatic group binding part is still under development. So currently I don’t let them show up in nymea, but they are in the network and in the stack.

Switches and all battery driven devices still need to get the report configuration, so they tell nymea when battery changes, and without the group binding, nymea does not get the button pressed commands like dimm, power or swich scene. Everything is prepared, but this initialization needs to be don in nymea in the future.

ConBee II is a good idea, so you can keep blueooth and you have the option for a RTC on your system. Also you get support for that, since ConBee 1 does not get produced / sold any more.

I have no clue what might be the reason for not booting any more…one possibilitiy might be the uart, uboot starts (creating logs on tty), the stick receives them and responds with “invalid command” or something, and interrupts the boots sequence. But this is just a guess.

the gateway dongle is up again - i added vpu_freq=250 to the boot/config.txt

I configured the serial again with bluetooth enabled: https://wiki.fhem.de/wiki/Raspberry_Pi_3:_GPIO-Port_Module_und_Bluetooth

Works!
And now the serial is not miniuart anymore, it is fulluart.

Strange things with the gateway and the lights:

They show the status and are connected but don’t react as they go into timeout.
The Plug successfully switches.

I | Zigbee: Executing action for device “Spielzimmer Decke” “{19d82a60-0009-4cff-966d-3b1c4fe358e1}” ParamList (count:1)
0: Param(Id: “{19d82a60-0009-4cff-966d-3b1c4fe358e1}”, Value:QVariant(bool, false))
W | ZigbeeClusterLibrary: Failed to send request ZigbeeNode(0x47e1, 00:0B:3C:FF:FE:F7:90:9E) ZigbeeNetworkReply::ErrorTimeout Zigbee::ZigbeeApsStatusSuccess
W | ZigbeeNetwork: Received confirmation but could not find any reply. Ignoring the confirmation
I | Zigbee: Executing action for device “Spielzimmer Movielight” “{19d82a60-0009-4cff-966d-3b1c4fe358e1}” ParamList (count:1)
0: Param(Id: “{19d82a60-0009-4cff-966d-3b1c4fe358e1}”, Value:QVariant(bool, false))
W | ZigbeeClusterLibrary: Failed to send request ZigbeeNode(0x1f6f, 08:6B:D7:FF:FE:2A:E2:26) ZigbeeNetworkReply::ErrorTimeout Zigbee::ZigbeeApsStatusSuccess
W | ZigbeeNetwork: Received confirmation but could not find any reply. Ignoring the confirmation
W | Bluetooth: Bluetooth hardware not available. Cannot enable Hardware resource
I | Application: =====================================
I | Application: Shutting down nymea daemon
I | Application: =====================================
W | ZigbeeClusterLibrary: Failed to send request ZigbeeNode(0x47e1, 00:0B:3C:FF:FE:F7:90:9E) ZigbeeNetworkReply::ErrorTimeout Zigbee::ZigbeeApsStatusSuccess
W | ZigbeeClusterLibrary: Failed to send request ZigbeeNode(0x1f6f, 08:6B:D7:FF:FE:2A:E2:26) ZigbeeNetworkReply::ErrorTimeout Zigbee::ZigbeeApsStatusSuccess
W | ZigbeeNetwork: Received confirmation but could not find any reply. Ignoring the confirmation
W | ZigbeeNetwork: Received confirmation but could not find any reply. Ignoring the confirmation
I | Zigbee: Executing action for device “Küche Kaffeemaschine” “{07a50aa7-8388-4a98-a790-47baac092903}” ParamList (count:1)
0: Param(Id: “{07a50aa7-8388-4a98-a790-47baac092903}”, Value:QVariant(bool, true))
I | Zigbee: Thing(“Küche Kaffeemaschine”, id: “{288150ce-41d1-4e5b-8063-61c0a26687b3}”, ThingClassId: “{5cdb8589-0bb4-48e7-8926-eb43da69cf74}”) signal strength changed 50 %
I | Zigbee: Executing action for device “Küche Kaffeemaschine” “{07a50aa7-8388-4a98-a790-47baac092903}” ParamList (count:1)
0: Param(Id: “{07a50aa7-8388-4a98-a790-47baac092903}”, Value:QVariant(bool, false))

Hi,
I installed Ubuntu server 20.04 on a RasPi 3 and inserted a RaspBee II module on the RasPi’s GPIO, then Nymea via APT which seems to work fine. But I can’t get the ZigBee controller to start. I feel like I’m in the same situation from this post, but I don’t understand what I should do.
Thanks in advance for your help.

Hi @mfoucrier

Did you enable the serial port properly? Verify that you have enable_uart=1 in your /boo/config.txt and that /boot/cmdline.txt does not include console=serial0,115200

Hi @mzanetti
Thank you for your answer, but I don’t have these two files in /boot/.
I added /boot/config.txt with this enable_uart=1 in it and rebooted, but it did not change anything.

I don’t know if the serial port is enabled properly, but when I add new ZigBee network, it shows me :

Unknown - /dev/ttyS0
Unknown - /dev/ttyAMA0

Could be that there’s Modemmanager installed on Ubuntu which might lock the serial port. Try to disable that.

I typed this ModemManager help and the answer I got was :
ModemManager[2356]: ModemManager (version 1.12.8) starting in system bus…
ModemManager[2356]: Could not acquire the ‘org.freedesktop.ModemManager1’ service name
ModemManager[2356]: ModemManager is shut down

You can check if it’s running with

sudo systemctl status ModemManager

and if it’s running, stop it with

sudo systemctl stop ModemManager

To prevent it from being restarted on reboot you can disable it with

sudo systemctl disable ModeManager

OK, thanks, I stopped ModemManage but it is not better

Can the logs from yesterday help you?

I | Zigbee: Start creating network for “/dev/ttyAMA0” 38400 nymeaserver::ZigbeeAdapter::ZigbeeBackendTypeDeconz ChannelMask(“0x07fff800”, (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26))
I | Zigbee: Network added ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateUninitialized)
I | Zigbee: Starting ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateUninitialized)
I | Zigbee: Network state changed ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateStarting)
I | Zigbee: Network PAN ID changed for ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateStarting) 13570
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 0)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 1)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 2)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 3)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 4)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 5)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 6)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 7)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 8)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeController: Reply timeout InterfaceReply(“Request controller device state”, 9)
W | ZigbeeController: Request Deconz::CommandDeviceState finished with error Deconz::StatusCodeError
W | ZigbeeNetwork: Failed to read device state after 10 attempts. Giving up
W | ZigbeeNetwork: Hardware controller is not available any more.
W | Zigbee: Network error occured for ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateStarting) ZigbeeNetwork::ErrorHardwareUnavailable
I | Zigbee: Network state changed ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateOffline)
I | Zigbee: Removing ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateOffline)
I | Zigbee: Network state changed ZigbeeNetwork(00:00:00:00:00:00:00:00, {204f7e05-4c49-4897-ae93-bb58512a83b2}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateUninitialized)
I | Zigbee: Network removed successfully

Not sure how ubuntu handles the device tree overlays, but 2 things are required in general: enable gpio UART and disable the serial console for it.

If you have the raspi-config available, you could try:

  • Login shell accessible over serial → No
  • Serial port hardware available → Yes

And then reboot.

Yes, I try this and it is OK.
I added my user on dialout, etc. But nothing!
Many thanks

I think I should have bought the USB version!!! :sob:

If you use the raspbian instead of the ubuntu, it will work for sure. I’m not sure how close the ubuntu image is to the raspbian regarding the low level hardware support and configuration. I’m sure it will also work with ubuntu, since the only thing you need is the correct and free serial port on the GPIO pins.
Theoretically, it is the /dev/ttyS0, but that depends on your kernel and system configuration. You can also make sure no other services are using that serial port with sudo lsof /dev/ttyS0.

I just noticed you are starting the network AMA0, are ther any other serial ports available? I’m quiet sure it is not the AMA0 interface since that would require USB information to load that module!

I use the raspbee module too. It is working fine. The issue we’re fighting here is Ubuntu related as apparently it doesn’t use config.txt (or raspi-config) to configure the serial ports in it’s latest version.

I removed the module for other tests and
sudo lsof /dev/ttyS0 return this :
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
agetty 1774 root 0u CHR 4,64 0t0 606 /dev/ttyS0
agetty 1774 root 1u CHR 4,64 0t0 606 /dev/ttyS0
agetty 1774 root 2u CHR 4,64 0t0 606 /dev/ttyS0

and sudo lsof /dev/ttyAMA0 nothing.

Yes, ubuntu doesn’t use config.txt, but raspi-config it is OK.