Broken Zigbee2mqtt - need help understanding the log

Sorry to add to all the other requests but I’ve been on this all day and totally lost and would appreciate some ideas from those who know.
I’ve read as much as I can, added the required lines to the config file and adapter: zstack etc
From the log it looks like the serial port opens but the configuration is wrong.
I have these settings in the config file (doesn’t mean much to me):

devices:
  - devices.yaml
groups:
  - groups.yaml
homeassistant:
  enabled: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://xxx.xxx.xxx.xxx
  user: mqtt_user
  password: mqtt_password
  version: 5
serial:
  port: /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxxxxxxxxxxxxif00-port0
  adapter: zstack
advanced:
  homeassistant_legacy_entity_attributes: false
  homeassistant_legacy_triggers: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false
  log_level: debug
  pan_id: 54074
  channel: 25
  network_key:
    - 219
    - 142
    - 93
    - 7
    - 236
    - 52
    - 237
    - 214
    - 223
    - 67
    - 241
    - 178
    - 174
    - 181
    - 251
    - 63
  log_syslog:
    app_name: Zigbee2MQTT
    eol: /n
    host: localhost
    localhost: localhost
    path: /dev/log
    pid: process.pid
    port: 123
    protocol: tcp4
    type: '5424'
  last_seen: ISO_8601_local
#device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  enabled: true
  port: 8099
availability:
  enabled: true
ota: {}
version: 4

This is the log after the port is opened:

[2025-01-06 17:06:12] info: 	zh:zstack:znp: Serialport opened
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: Configuration is not consistent with adapter state/backup!
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: - PAN ID: configured=6754, adapter=54074
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: - Extended PAN ID: configured=00124b0024c1492d, adapter=00124b0024c1492d
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: - Network Key: configured=01030507090b0d0f00020406080a0c0d, adapter=db8e5d07ec34edd6df43f1b2aeb5fb3f
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: - Channel List: configured=11, adapter=25
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: Please update configuration to prevent further issues.
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: If you wish to re-commission your network, please remove coordinator backup at /config/zigbee2mqtt/coordinator_backup.json.
[2025-01-06 17:06:12] error: 	zh:adapter:zstack:manager: Re-commissioning your network will require re-pairing of all devices!
[2025-01-06 17:06:12] error: 	z2m: Error while starting zigbee-herdsman
[2025-01-06 17:06:12] error: 	z2m: Failed to start zigbee-herdsman
[2025-01-06 17:06:12] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2025-01-06 17:06:12] error: 	z2m: Exiting...
[2025-01-06 17:06:12] error: 	z2m: Error: startup failed - configuration-adapter mismatch - see logs above for more information
    at ZnpAdapterManager.determineStrategy (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:252:35)
    at ZnpAdapterManager.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:62:26)
    at ZStackAdapter.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:158:16)
    at Controller.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29)
    at Zigbee.start (/app/lib/zigbee.ts:69:27)
    at Controller.start (/app/lib/controller.ts:142:13)
    at start (/app/index.js:161:5)

I’m guessing that you have a Sonoff zigbbee adapter?

There are 2 versions of the stick. One uses zstack for the adapter setting the other uses ember

try the other unless you are sure that it’s a zstack.

further reading : EmberZNet adapters (Silicon Labs) | Zigbee2MQTT

Thanks Kris, I change it to ember but still no joy.
The log is different so I don’t know what to try next.

[2025-01-06 19:07:17] info: 	z2m: Logging to console, file (filename: log.log)
[2025-01-06 19:07:17] info: 	z2m: Starting Zigbee2MQTT version 2.0.0 (commit #unknown)
[2025-01-06 19:07:17] info: 	z2m: Starting zigbee-herdsman (3.2.1)
[2025-01-06 19:07:17] info: 	zh:ember: Using default stack config.
[2025-01-06 19:07:17] info: 	zh:ember: ======== Ember Adapter Starting ========
[2025-01-06 19:07:17] info: 	zh:ember:ezsp: ======== EZSP starting ========
[2025-01-06 19:07:17] info: 	zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-01-06 19:07:17] info: 	zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control.
[2025-01-06 19:07:17] info: 	zh:ember:uart:ash: Serial port opened
[2025-01-06 19:07:17] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2025-01-06 19:07:20] info: 	zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-01-06 19:07:20] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2025-01-06 19:07:22] info: 	zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-01-06 19:07:22] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2025-01-06 19:07:25] info: 	zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-01-06 19:07:25] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2025-01-06 19:07:27] info: 	zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-01-06 19:07:27] info: 	zh:ember:uart:ash: ======== ASH starting ========
[2025-01-06 19:07:30] error: 	z2m: Error while starting zigbee-herdsman
[2025-01-06 19:07:30] error: 	z2m: Failed to start zigbee-herdsman
[2025-01-06 19:07:30] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2025-01-06 19:07:30] error: 	z2m: Exiting...
[2025-01-06 19:07:30] error: 	z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
    at EmberAdapter.initEzsp (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:670:19)
    at EmberAdapter.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1533:24)
    at Controller.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29)
    at Zigbee.start (/app/lib/zigbee.ts:69:27)
    at Controller.start (/app/lib/controller.ts:142:13)
    at start (/app/index.js:161:5)

So this is probably the issue but I don’t know how to fix it. I have now tried both numbers in the config file and rebooted the host but no joy. In fact, I removed the pan_id line completely but it still gives the same number in the log, don’t know where it gets it from.

Have you tried this?

No, I have a large system and don’t want to have to re-pair everything. But maybe that’s where this number is coming from, a json file. I’ll take a look.

Don’t delete the backup file, rename it or move it to some other folder.

|[2025-01-06 17:06:12] error: |zh:adapter:zstack:manager: - PAN ID: configured=6754, adapter=54074|
|---|---|
|[2025-01-06 17:06:12] error: |zh:adapter:zstack:manager: - Extended PAN ID: configured=00124b0024c1492d, adapter=00124b0024c1492d|
|[2025-01-06 17:06:12] error: |zh:adapter:zstack:manager: - Network Key: configured=01030507090b0d0f00020406080a0c0d, adapter=db8e5d07ec34edd6df43f1b2aeb5fb3f|
|[2025-01-06 17:06:12] error: |zh:adapter:zstack:manager: - Channel List: configured=11, adapter=25|

Please change in your z2mqtt configuration.yaml the values for (extended) PAN-id - network key and channel etc to the values which are displayed behind adapter. Apparently the values in the config file are different from your adapter.

Syntax:

advanced:
    # Optional: ZigBee pan ID (default: shown below)
    # Setting pan_id: GENERATE will make Zigbee2MQTT generate a new panID on next startup
    pan_id: 0x1a63
    # Optional: Zigbee extended pan ID, GENERATE will make Zigbee2MQTT generate a new extended panID on next startup (default: shown below)
    ext_pan_id: [0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD]
    # Optional: Zigbee channel, changing might require re-pairing of some devices (see docs below). (Note: use a ZLL channel: 11, 15, 20, or 25 to avoid problems)
    # (default: 11)
    channel: 11
    # Optional: network encryption key
    # GENERATE will make Zigbee2MQTT generate a new network key on next startup
    # Note: changing requires repairing of all devices (default: shown below)
    network_key: [1, 3, 5, 7, 9, 11, 13, 15, 0, 2, 4, 6, 8, 10, 12, 13]

All values with 0x in front are Hex. please use an online hex to dec and vise versa calculator to get the right values.

Many thanks but I am still confused, am I trying to enter these values into the config file?
PAN ID: 6754 (maybe that should be 0xD33A ??)
Extended PAN ID: 00124b0024c1492d
Network Key: 01030507090b0d0f00020406080a0c0d
Channel: 11

OR THESE VALUES
PAN ID: 54074
Extended PAN ID: 00124b0024c1492d (this is already the same in both cases)
Network Key: db8e5d07ec34edd6df43f1b2aeb5fb3f
Channel: 25

Are these just two ways of writing the same?
network_key:
- 219
- 142
- 93
- 7
- 236
- 52
- 237
- 214
- 223
- 67
- 241
- 178
- 174
- 181
- 251
- 63
AND
Network Key: [0xDB, 0x8E, 0x5D, 0x07, 0xEC, 0x34, 0xED, 0xD6, 0xDF, 0x43, 0xF1, 0xB2, 0xAE, 0xB5, 0xFB, 0x3F]

I’m sorry I don’t really understand all this stuff but once I know what I am supposed to put in the config file, I’ll be OK

S O L V E D,
Thanks to Koen Kanters who spotted an error in my config file.
I had put the PAN ID entry in the wrong section.