Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z2M starts, but no frontend, no module data through MQTT ( only online/offline info) #25622

Open
kalon33 opened this issue Jan 6, 2025 · 16 comments
Labels
problem Something isn't working

Comments

@kalon33
Copy link

kalon33 commented Jan 6, 2025

What happened?

Z2M starts, lists my adapter and outputs all modules names in info log. In info log, Z2M status is also output to MQTT, and I see it though a MQTT explorer. As debug, it also starts to output data from modules, as expected. But frontend doesn't start, and modules output are not sent to MQTT. It happened suddenly, as the first time it happened after a couple of days, and now everytime.

What did you expect to happen?

MQTT data flows correctly, and frontend is started.

How to reproduce it (minimal and precise)

No idea. It happened suddenly after a few days, and I can't restart it properly now.

Zigbee2MQTT version

2.0.0

Adapter firmware version

20240710

Adapter

Sonoff_Zigbee_3.0_USB_Dongle_Plus

Setup

Dockerised, with network_mode: host

Debug log

log.log

@kalon33 kalon33 added the problem Something isn't working label Jan 6, 2025
@m0wlheld
Copy link

m0wlheld commented Jan 6, 2025

Are you talking about Zigbee2MQTT or the Home Assistant Zigbee2MQTT Add-On? For the later, there are similar issues posted, e.g. zigbee2mqtt/hassio-zigbee2mqtt#688 (comment)

@scubieman
Copy link

I had same issue... See this...

#24198
#24364

@kalon33
Copy link
Author

kalon33 commented Jan 6, 2025

Are you talking about Zigbee2MQTT or the Home Assistant Zigbee2MQTT Add-On? For the later, there are similar issues posted, e.g. zigbee2mqtt/hassio-zigbee2mqtt#688 (comment)

Zigbee2MQTT, I have a dockerised HA install, so no add-ons.

@kalon33
Copy link
Author

kalon33 commented Jan 6, 2025

I had same issue... See this...

#24198 #24364

I already have

serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_06d493f96345ed11a792c88f0a86e0b4-if00-port0
  adapter: zstack

In my configuration.yaml and no legacy option.

If you exclude devices and passwords/tokens, I have that:

mqtt:
  server: mqtt://127.0.0.1:1883
  user: jeedom
  password: [redacted]
  base_topic: zigbee2mqtt2
  include_device_information: true
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_06d493f96345ed11a792c88f0a86e0b4-if00-port0
  adapter: zstack
frontend:
  enabled: true
  port: 8080
  host: 192.168.0.2
  auth_token: [redacted]
advanced:
  log_level: debug
  channel: 25
  ext_pan_id:
[redacted]
  pan_id: [redacted]
  transmit_power: 12
devices:
[a lot of devices]
ota:
  zigbee_ota_override_index_location: https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json
availability:
  enabled: true
homeassistant:
  enabled: true
version: 4

@indi81
Copy link

indi81 commented Jan 6, 2025

A new version 2.0.0.2 is released that seems to fix this.

@kalon33
Copy link
Author

kalon33 commented Jan 6, 2025

A new version 2.0.0.2 is released that seems to fix this.

For the HA add-on, but I don't think that is relevant for standalone setup in Docker. There's no new release in github releases nor a new Docker image.

@scubieman
Copy link

I had same issue... See this...
#24198 #24364

I already have

serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_06d493f96345ed11a792c88f0a86e0b4-if00-port0
  adapter: zstack

In my configuration.yaml and no legacy option.

If you exclude devices and passwords/tokens, I have that:

mqtt:
  server: mqtt://127.0.0.1:1883
  user: jeedom
  password: [redacted]
  base_topic: zigbee2mqtt2
  include_device_information: true
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_06d493f96345ed11a792c88f0a86e0b4-if00-port0
  adapter: zstack
frontend:
  enabled: true
  port: 8080
  host: 192.168.0.2
  auth_token: [redacted]
advanced:
  log_level: debug
  channel: 25
  ext_pan_id:
[redacted]
  pan_id: [redacted]
  transmit_power: 12
devices:
[a lot of devices]
ota:
  zigbee_ota_override_index_location: https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json
availability:
  enabled: true
homeassistant:
  enabled: true
version: 4

I am not seeing.... advanced:
homeassistant_legacy_entity_attributes: false
homeassistant_legacy_triggers: false
legacy_api: false
legacy_availability_payload: false

@kalon33
Copy link
Author

kalon33 commented Jan 6, 2025

I had same issue... See this...
#24198 #24364

I already have

serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_06d493f96345ed11a792c88f0a86e0b4-if00-port0
  adapter: zstack

In my configuration.yaml and no legacy option.
If you exclude devices and passwords/tokens, I have that:

mqtt:
  server: mqtt://127.0.0.1:1883
  user: jeedom
  password: [redacted]
  base_topic: zigbee2mqtt2
  include_device_information: true
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_06d493f96345ed11a792c88f0a86e0b4-if00-port0
  adapter: zstack
frontend:
  enabled: true
  port: 8080
  host: 192.168.0.2
  auth_token: [redacted]
advanced:
  log_level: debug
  channel: 25
  ext_pan_id:
[redacted]
  pan_id: [redacted]
  transmit_power: 12
devices:
[a lot of devices]
ota:
  zigbee_ota_override_index_location: https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json
availability:
  enabled: true
homeassistant:
  enabled: true
version: 4

I am not seeing.... advanced: homeassistant_legacy_entity_attributes: false homeassistant_legacy_triggers: false legacy_api: false legacy_availability_payload: false

Because file has already been migrated by Z2M to version 4 as indicated by the version key. But that doesn't changes anything to add these keys and restart.

@m0wlheld
Copy link

m0wlheld commented Jan 6, 2025

Is the frontend's host IP correct?

@kalon33
Copy link
Author

kalon33 commented Jan 6, 2025

Is the frontend's host IP correct?

yes

@philippemezzadri
Copy link

Just to mention that I am experiencing the exact same issue. I have a bare metal install in a LXC container.
I have the same adapter: Sonoff Zigbee 3.0 USB Dongle Plus.
Never worked in 2.0.0, the problem came up after the upgrade.
Same problem appears on a fresh install in a new container once I copy my data folder.

@mundschenk-at
Copy link
Contributor

What do the logs say?

@philippemezzadri
Copy link

What do the logs say?

They don't say much actually to tell us what's happening.
Here is some logs : log.log
Very similar to the ones from @kalon33.

@giedriuskilcauskas
Copy link

I have exactly same issue with addon. In debug logs it looks like zigbee data coming in, but frontend doesn't start and data doesn't end up in HA.

@mundschenk-at
Copy link
Contributor

@philippemezzadri According to those logs, you are not running Z2M 2.0.0 but 1.42.0 (the previous release).

@philippemezzadri
Copy link

philippemezzadri commented Jan 7, 2025

@mundschenk-at
Sorry, i uploaded the wrong log file, this was the pre-upgrade log.

This is the correct one: log.log
As you can see, line 919 i tried to switch on a light from HA, and then we can see some errors:

[2025-01-07 16:52:30] debug: 	z2m:mqtt: Received MQTT message on 'zigbee2mqtt/Entrée/set' with data '{"state":"ON"}'
[2025-01-07 16:52:34] debug: 	zh:zstack: sendZclFrameToEndpointInternal 0xb4e3f9fffedf2b0a:43263/1 (0,3,1)
[2025-01-07 16:52:34] debug: 	zh:zstack:znp: --> SREQ: AF - dataRequest - {"dstaddr":43263,"destendpoint":1,"srcendpoint":1,"clusterid":513,"transid":27,"options":0,"radius":30,"len":5,"data":{"type":"Buffer","data":[24,87,11,10,0]}}
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:writer: --> frame [254,15,36,1,255,168,1,1,1,2,27,0,30,5,24,87,11,10,0,48]
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: <-- [254,1,100,1,0,100]
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: --- parseNext [254,1,100,1,0,100]
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: --> parsed 1 - 3 - 4 - 1 - [0] - 100
[2025-01-07 16:52:34] debug: 	zh:zstack:znp: <-- SRSP: AF - dataRequest - {"status":0}
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: <-- [254,3,68,128,233,1,27,52]
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,68,128,233,1,27,52]
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 4 - 128 - [233,1,27] - 52
[2025-01-07 16:52:34] debug: 	zh:zstack:znp: <-- AREQ: AF - dataConfirm - {"status":233,"endpoint":1,"transid":27}
[2025-01-07 16:52:34] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-07 16:52:34] debug: 	zh:zstack: Data confirm error (0xb4e3f9fffedf2b0a:43263,233,3)
[2025-01-07 16:52:34] debug: 	zh:zstack: Wait 2000ms
[2025-01-07 16:52:37] error: 	z2m: Failed to call 'Frontend' 'stop' (TypeError: Cannot read properties of undefined (reading 'close')
    at /opt/zigbee2mqtt/lib/extension/frontend.ts:132:52
    at new Promise (<anonymous>)
    at Frontend.stop (/opt/zigbee2mqtt/lib/extension/frontend.ts:132:15)
    at Controller.callExtensions (/opt/zigbee2mqtt/lib/controller.ts:368:17)
    at Controller.stop (/opt/zigbee2mqtt/lib/controller.ts:233:9)
    at stop (/opt/zigbee2mqtt/index.js:172:5)
    at process.handleQuit (/opt/zigbee2mqtt/index.js:180:13))
[2025-01-07 16:52:37] debug: 	z2m: Saving state to file /opt/zigbee2mqtt/data/state.json
[2025-01-07 16:52:37] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
[2025-01-07 16:52:37] info: 	z2m: Disconnecting from MQTT server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants