Openhab on FreeBSD, "check_lock_status: device is locked by another application"

  • Platform information:

    • Hardware: HP microserver with Celeron G1610T, ITEAD SONOFF Zigbee 3.0 USB Dongle Plus V2
    • OS: FreeBSD 14.4-RELEASE-p7
    • Java Runtime Environment: openjdk17 Java Development Kit 17
    • openHAB version: 4.3.11
  • Issue of the topic: I am trying to connect Zigbee Dongle. OS sees it, and it becomes visible a serial port /dev/cuaU0. When trying to set up, I get messages “check_lock_status: device is locked by another application”, and the Thing is in disabled state. When I try to enable it, it says “Initializing” and then says “communications error” and becomes “offline”. I assume it is trying to create a lock file after reading old comments about people using openhab on FreeBSD. However, /var/spool/lock has no files in it. openhab user is in both dialer and uucp groups, so it does not look like permissions problem. OS shows the dongle as “ugen0.4: <SONOFF Zigbee 3.0 USB Dongle Plus V2 QinHeng Electronics> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (132mA)”.

  • Please post configurations (if applicable):

    • Items configuration related to the issue: I have not done anything else but install openhab, added the zigbee dongle as Ember coordinator. In addition, openhab detected my printer, which I also attached. Nothing else, this is new install for a new user with no openhab experience. I have used home assistant in the past with same Dongle, trying to install openhab as I want to run home automation on top of normal operating system without any dockers or whatnot.
    • Sitemap configuration related to the issue: I have not gotten that far yet, no devices linked other than printer autodetected.
    • Rules code related to the issue: None. I have not gotten that far yet.
    • Services configuration related to the issue: None. I have not gotten that far yet.
  • If logs where generated please post these here using code fences: Log viewer repeats this when trying to enable it.:

    21:50:41.665 INFO org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler ZigBee dongle inactivity timer. Reinitializing ZigBee
    21:50:41.706 INFO org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler ZigBee dongle inactivity timer. Waiting for reconnect lock
    21:50:41.708 INFO org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler ZigBee dongle inactivity timer. Reconnect lock passed
    21:50:43.132 ERROR org.openhab.binding.zigbee.serial.ZigBeeSerialPort Serial Error: Port [/dev/cuaU0] does not exist.
    21:50:43.133 ERROR com.zsmartsystems.zigbee.dongle.ember.ZigBeeDongleEzsp EZSP Dongle: Unable to open serial port
    21:50:43.135 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘zigbee:coordinator_ember:e57f64c64e’ changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE: Failed to open communications port
    21:50:43.136 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘zigbee:coordinator_ember:e57f64c64e’ changed from OFFLINE: Failed to open communications port to OFFLINE (COMMUNICATION_ERROR)
    21:50:48.135 INFO org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler ZigBee dongle inactivity timer. Reinitializing ZigBee
    21:50:48.136 INFO org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler ZigBee dongle inactivity timer. Waiting for reconnect lock
    21:50:48.137 INFO org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler ZigBee dongle inactivity timer. Reconnect lock passed
    21:50:49.569 ERROR org.openhab.binding.zigbee.serial.ZigBeeSerialPort Serial Error: Port [/dev/cuaU0] does not exist.
    21:50:49.569 ERROR com.zsmartsystems.zigbee.dongle.ember.ZigBeeDongleEzsp EZSP Dongle: Unable to open serial port

However. cuaU0 does exist:

crw-rw---- 1 uucp dialer 0xad 26 hein�kuuta 02:21 /dev/cuaU0

I can’t do much more than welcome you to OH.

I don’t have zigbee, but with Zwave the folder for the lock on bare metal is run/lock. Maybe that is the same?

My unsolicited advice (feel free to ignore). I’d start with a more recent OH version. 5.2 was just released (needs Java 21 and 64 bit). That tends to get more forum responses. Also, this time of day is a little quiet with most of the main developers in Europe

In FreeBSD it is /var/spool/lock, but working around with symlinking /var/run/lock to /var/spool/lock did not help.

There is /dev/cuaU0.lock which is lockig device, but it is not used by anything else, and /dev/cuaU0 can be opened normally.

I think the log error message is pretty confusing, it should not say /dev/cuaU0 does not exist if the error is something else.

Have you tried using zigbee2mqtt instead of the zigbee binding? I’ve used zigbee2mqtt for a long time. It works very well.

On the openhab side you could either use the homeassistant binding because z2m supports homeassistant standard, or as I prefer, set them up manually using the generic mqtt binding.