EnOceanPi module not being initiated on OH4.2.2

Hi everyone!

I am running openHAB on a Raspberry 4 for quite a while now with only very few Things (basically just some rollershutters and that’s it). Now, I wanted to increase my overall setup. This was the trigger for me to look into updating OpenHAB to a reasonable version, before adding new binding, things, etc.
Before, I ran on OH3.0.0. Since updating from there seemed very painful to me and my setup is really small, I decided for a complete fresh install, to not mess things up. I am using openhabian before an after.

So my current goal is just to recreate the working state I was having on OH3.0.0 now on OH4.2.2.

I only use the EnOcean binding. All used hardware is unchanged.

To communicate with my EnOcean Devices, my RaspberryPi 4 is equipped with an EnOceanPi module on the GPIO pins.
To use it, I ran openhabian-config to deactivate the serial console and move BT to mini UART. Then, the EnOceanPi module gets available on /dev/ttyAMA0.
I tested this by calling hexdump /dev/ttyAMA0. I can see incoming messages once I press an EnOcean Push Button, telling me that the module itself is working (as it has on OH3).

However, when creating the EnOcean Gateway as the first necessary thing, it fails to fully initialize itself, getting stuck on the message “trying to get bridge base id…”

The logs aren’t very helpful to me, either:

==> /var/log/openhab/openhab.log <==
2024-10-14 22:46:20.396 [INFO ] [ernal.transceiver.EnOceanTransceiver] - EnOceanSerialTransceiver initialized
2024-10-14 22:46:20.401 [INFO ] [ernal.transceiver.EnOceanTransceiver] - EnOceanSerialTransceiver RX thread started
2024-10-14 22:46:20.407 [INFO ] [nternal.handler.EnOceanBridgeHandler] - EnOceanSerialTransceiver RX thread up and running
==> /var/log/openhab/events.log <==
2024-10-14 22:46:20.393 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): trying to get bridge base id… to OFFLINE (CONFIGURATION_PENDING): opening serial port…
2024-10-14 22:46:20.403 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): opening serial port… to OFFLINE (CONFIGURATION_PENDING): starting rx thread…
2024-10-14 22:46:20.416 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): starting rx thread… to OFFLINE (CONFIGURATION_PENDING): trying to get bridge base id…

Searching myself, I found this topic with the same observation, which is claimed to be fixed in 4.0.1., but since I am on 4.2.2, I would assume this is covered by now…

Edit: After some time, for reasons not clear to me, the interface to the EnOceanPi module gets stuck as well. This can be observed to ways: Trying to access ttyAMA0 via hexdump results in a “Permission denied”, while changes its error message to “port could not be found”. Logs:

==> /var/log/openhab/openhab.log <==
2024-10-14 23:08:25.887 [INFO ] [ernal.transceiver.EnOceanTransceiver] - EnOceanSerialTransceiver initialized
2024-10-14 23:08:25.898 [INFO ] [ernal.transceiver.EnOceanTransceiver] - EnOceanSerialTransceiver RX thread started
2024-10-14 23:08:25.902 [INFO ] [nternal.handler.EnOceanBridgeHandler] - EnOceanSerialTransceiver RX thread up and running
==> /var/log/openhab/events.log <==
2024-10-14 23:08:25.791 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from UNINITIALIZED (NOT_YET_READY) to INITIALIZING
2024-10-14 23:08:25.801 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING): trying to connect to gateway…
2024-10-14 23:08:25.820 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): trying to connect to gateway… to OFFLINE (CONFIGURATION_PENDING): opening serial port…
2024-10-14 23:08:25.900 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): opening serial port… to OFFLINE (CONFIGURATION_PENDING): starting rx thread…
2024-10-14 23:08:25.910 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): starting rx thread… to OFFLINE (CONFIGURATION_PENDING): trying to get bridge base id…
==> /var/log/openhab/openhab.log <==
2024-10-14 23:09:25.947 [INFO ] [ernal.transceiver.EnOceanTransceiver] - Transceiver shutdown
==> /var/log/openhab/events.log <==
2024-10-14 23:09:25.954 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): trying to get bridge base id… to OFFLINE (CONFIGURATION_PENDING): opening serial port…
2024-10-14 23:09:25.988 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): opening serial port… to OFFLINE (CONFIGURATION_ERROR): Port could not be found
==> /var/log/openhab/openhab.log <==
2024-10-14 23:10:25.986 [INFO ] [ernal.transceiver.EnOceanTransceiver] - Transceiver shutdown
==> /var/log/openhab/events.log <==
2024-10-14 23:10:26.000 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_ERROR): Port could not be found to OFFLINE (CONFIGURATION_PENDING): opening serial port…
2024-10-14 23:10:26.009 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): opening serial port… to OFFLINE (CONFIGURATION_ERROR): Port could not be found
==> /var/log/openhab/openhab.log <==
2024-10-14 23:11:26.005 [INFO ] [ernal.transceiver.EnOceanTransceiver] - Transceiver shutdown
==> /var/log/openhab/events.log <==
2024-10-14 23:11:26.014 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_ERROR): Port could not be found to OFFLINE (CONFIGURATION_PENDING): opening serial port…
2024-10-14 23:11:26.028 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘enocean:bridge:EnOceanGateway’ changed from OFFLINE (CONFIGURATION_PENDING): opening serial port… to OFFLINE (CONFIGURATION_ERROR): Port could not be found

Anyone having the same issue with some ideas to solve them? I would hate to revert to OH3, to be honest…

Thanks for any kind of help!
Markus

After I updated my system to the latest version, my bridge stuck at the same state.
I use an USB300 stick, no enoceanPi.

I was able to get the bridge online within seconds after I run these 2 commands within the openhab-cli console

feature:install openhab-transport-coap
feature:install openhab-transport-upnp

Maybe this will work for you too.

Thanks a lot for the idea! Unfortunately, that did not solve the issue :-/

openhab-core-io-transport-coap │ 4.2.2 │ │ Started │ distro-4.2.2 │
openhab-core-io-transport-http │ 4.2.2 │ │ Uninstalled │ distro-4.2.2 │
openhab-core-io-transport-mdns │ 4.2.2 │ │ Started │ distro-4.2.2 │
openhab-core-io-transport-modbus │ 4.2.2 │ │ Uninstalled │ distro-4.2.2 │
openhab-core-io-transport-mqtt │ 4.2.2 │ │ Uninstalled │ distro-4.2.2 │
openhab-core-io-transport-serial-javacomm │ 4.2.2 │ x │ Started │ distro-4.2.2 │
openhab-core-io-transport-upnp │ 4.2.2 │ │ Started │ distro-4.2.2 │
openhab-transport-coap │ 4.2.2 │ │ Started │ distro-4.2.2 │ CoAP Transport
openhab-transport-http │ 4.2.2 │ │ Started │ distro-4.2.2 │ HTTP Transport
openhab-transport-mdns │ 4.2.2 │ │ Started │ distro-4.2.2 │ mDNS Transport
openhab-transport-modbus │ 4.2.2 │ │ Uninstalled │ distro-4.2.2 │ Modbus Transport
openhab-transport-mqtt │ 4.2.2 │ │ Uninstalled │ distro-4.2.2 │ MQTT Transport
openhab-transport-serial │ 4.2.2 │ │ Started │ distro-4.2.2 │ Serial Transport
openhab-transport-upnp │ 4.2.2 │ x │ Started │ distro-4.2.2 │ UPnP Transport

Some more tests: I redid the whole thing with OH3.4.5. On first start, it worked right away, me being happy. However, at some point, things tended to get stuck again. At first, the serial port seemed get stuck, ending with some “permission denied” messages, the gateway telling “port not found”. I restarted the Raspberry several times, tried to re-do it, and now, I am stuck in the same situation with “trying to get bridge base id” :frowning:
I wonder whether something with the hardware got broken or about other reasons that the setup seems to degenerate over time…
Next try tomorrow…

My first setup was done wirh an enoceanPi. But it wasn’t really reliable.
So I changed to an USB300 stick. This is working so much better and even the setup is much more easy. It get’s auto detected.

I will try that as well, since my frustration is increasing.
When having a look at hexdump the communication seems very stable. However, processing within the binding seems to have its issues…
I am hating myself for not doing a proper backup of the old working image. Though being heavily outdated, it worked very stable for several years by now, so I cannot complain about reliability until now.

Staying at an old version was never an option for me because of bug fixes which I needed :laughing:

The USB 300 was delivered today. Attached it to the Pi, auto-detected by openHAB, running like a charm (so far). So, I do have a solution, though I feel it is a little less elegant compared to the EnOceanPi module, which sits neatly within the box of the Pi.
Thanks for the support!

Same issue on my side by moving from OH4.2.1 to OH4.2.2. I have too many EnOcean device to pair again if I move to USB 300. Hopping the issue will be fixed very soon.

You don’t need to pair anything again. Just change the Base ID from your new USB300 stick to the old ID you got on your EnoceanPi. Select the new Bridge at your things and after the change all things will be online and working again.
But be aware of the limited number of Base ID changes (10 times max.)!

Thank you, dirk!
I found the solution!

  1. Disable the getty service that uses the ttyAMA0 port
    systemctl disable serial-getty@ttyAMA0.service
    systemctl stop serial-getty@ttyAMA0.service
    systemctl mask serial-getty@ttyAMA0.service
  2. Reboot
    The EnOceanPI brigde is getting again accessible and all the nodes operational.
    Issue solved!