Assistance Request - Zigbee2MQTT on Proxmox with Sonoff Zigbee Dongle-P

Hi all.

I’ve spent the last couple of days down in the rabbit holes of these (and other forums) working on getting my Sonoff Zigbee dongle (P) working with Zigbee2MQTT in a Proxmox container, to no avail. Oddly, when I’ve tried to start up, it actually HAS started a couple of times (no errors); but the interface never became accessible and the container seems to become unresponsive, but I can’t find detailed enough logs to dig into further.

My current configuration.yaml is:

frontend: 
  port: 8081
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.x.xxx:1883
  user: **************
  password: *****************
  keepalive: 60
  reject_unauthorized: true
  version: 4
serial:
  port: >-
    /dev/ttyUSB0
  adapter: zstack
  pan_id: GENERATE
  network_key: GENERATE
  channel: 25
  log_level: debug
zigbee_herdsman_debug: true
advanced:
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
device_options:

A few other notes:

When I attempt to start the service, I get the following:

Starting Zigbee2MQTT without watchdog.
[2024-07-13 17:10:35] info:     z2m: Logging to console, file (filename: log.log)
[2024-07-13 17:10:35] info:     z2m: Starting Zigbee2MQTT version 1.39.0 (commit #0326926)
[2024-07-13 17:10:35] info:     z2m: Starting zigbee-herdsman (0.50.1)
[2024-07-13 17:10:35] info:     zh:zstack:znp: Opening SerialPort with {"path":"/dev/ttyUSB0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2024-07-13 17:10:35] error:    z2m: Error while starting zigbee-herdsman
[2024-07-13 17:10:35] error:    z2m: Failed to start zigbee
[2024-07-13 17:10:35] error:    z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-07-13 17:10:35] error:    z2m: Exiting...
[2024-07-13 17:10:35] error:    z2m: Error: Error Resource temporarily unavailable Cannot lock port

I’ve run ls -l /proc/[0-9]/fd/ |grep /dev/ttyUSB0 a bunch of times, and it always returns blank, indicating no other processes using it.

I’m kind of at a loss of what to do next to get this thing back in business on the new system and would deeply appreciate any guidance I can get! TYIA:)

I think it would help others help you to provide a more detailed description of how you are running your Zigbee2MQTT within Proxmox. As far as I know, there is no thing as a :

‘Proxmox container,’

You either go down the LXC route or you go down the VM route under Proxmox.

From my experience, IHMO you will find more folks that can support you if you go down the Linux VM under Proxmox. And then run Zigbee2MQTT using Docker inside the VM.

I find installing either or both of the serial terminal programs : Bootterm and tio , very helpful, links below. Install them both right in Proxmox and then also in your VM and / or LXC. Both programs have command line option that will show you the paths to your serial devices. This will show you what Zigbee serial devices are visible to the root Proxmox and to the VM, if correctly allocated to the VM or LXC.

I never use the /dev/ttyUSB0 type interfaces, too many risks/possibilities that you zigbee controller will end up at different addresses and Zigbee2MQTT or ZHA do not handle this well.

Good hunting!

Had a look at my config, and the pan_id, network_key, channel and log_level are under the advanced: section, not the serial: section.

Try this:

frontend: 
  port: 8081
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.x.xxx:1883
  user: **************
  password: *****************
  keepalive: 60
  reject_unauthorized: true
  version: 4
serial:
  port: /dev/ttyUSB0
  adapter: zstack
zigbee_herdsman_debug: true
advanced:
  pan_id: GENERATE
  network_key: GENERATE
  channel: 25
  log_level: debug
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
device_options:

EDIT: Reboot the VM just in case, and check that your coordinator didn’t change port.

I wanted to share a quick update, thanks to y’all.

This morning, I fixed the advanced options section as recommended by @ShadowFist (thank you), and with that, was able to get really detailed logging properly. Then, the errors (which I missed capturing to paste here) were about mismatches in configuration already existing and current config.

I attempted to make the values of the new config match what the reported configuration was - that didn’t really work (tried manually setting pan_id, ext_pan_id and network_key).

In the log, it noted there was a coordinator_backup.json and that I could remove it to write new config values. So I removed that

rm /opt/zigbee2mqtt/data/coordinator_backup.json

and hit start, and it started up, including being able to access the web interface.

However, I will note that it doesn’t seem to completely start - the console never gets back to a prompt I can work from and seems stuck with

[2024-07-14 08:59:06] debug: z2m: Saving state to file /opt/zigbee2mqtt/data/state.json

Worse, I restarted the LXC container, and run the start command again, and then it failed with the same “resource locked” error again after having worked!!

Thanks for the help so far!