MQTT error: connect ECONNREFUSED 127.0.0.1:1883

Hi,

I’m a beginner on HAOS system.
Yesterday i installed Zigbee2MQTT + Mosquitto broker with help of youtube videos

But whatever i try Zigbee2MQTT doesnt work.
I checked google and different forums for the answer. I tried many “solutions”.
It doesnt work.

Could you help me?

This is my log:

[10:59:08] INFO: Preparing to start...
[10:59:08] INFO: Socat not enabled
[10:59:10] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-04-03 10:59:15: Logging to console and directory: '/config/zigbee2mqtt/log/2023-04-03.10-59-15' filename: log.txt
Zigbee2MQTT:info  2023-04-03 10:59:15: Starting Zigbee2MQTT version 1.30.3 (commit #unknown)
Zigbee2MQTT:info  2023-04-03 10:59:15: Starting zigbee-herdsman (0.14.103)
Zigbee2MQTT:info  2023-04-03 10:59:16: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2023-04-03 10:59:16: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210708,"transportrev":2},"type":"zStack3x0"}'
Zigbee2MQTT:info  2023-04-03 10:59:16: Currently 0 devices are joined:
Zigbee2MQTT:info  2023-04-03 10:59:16: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2023-04-03 10:59:16: Connecting to MQTT server at mqtt:/MYHAOSIP:1883
Zigbee2MQTT:error 2023-04-03 10:59:16: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:16: MQTT failed to connect, exiting...
Zigbee2MQTT:info  2023-04-03 10:59:16: Stopping zigbee-herdsman...
Zigbee2MQTT:error 2023-04-03 10:59:18: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:19: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:20: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:21: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:22: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:23: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:24: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:25: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:26: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:27: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:28: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:29: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:30: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:31: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:32: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:33: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:34: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:35: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:36: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:37: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:38: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2023-04-03 10:59:39: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
TypeError: Cannot read properties of undefined (reading 'payload')
    at AdapterNvMemory.readExtendedTableEntry (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/adapter-nv-memory.ts:166:39)
    at AdapterNvMemory.readTable (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/adapter-nv-memory.ts:279:28)
    at AdapterBackup.createBackup (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/adapter-backup.ts:98:37)
    at Controller.backup (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:328:28)
    at Controller.stop (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:308:9)
    at Zigbee.stop (/app/lib/zigbee.ts:200:9)
    at Controller.start (/app/lib/controller.ts:148:13)
    at start (/app/index.js:107:5)"

i tried

localhost./coremosquitto/broker on ip settings.
I changed port to : /dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
still no succes

this looks like Zigbee2MQTT cannot connect to Mosquitto MQTT.
the user and password are the same user and password as you put in the Mosquitto addon?

Here are the settings I use (zigbee2mqtt) - Although redacted, the user and the password are the same
image

Mosquitto:

Thanks for your reply.

Login section on mosquitto add-on was empty.
I added the username and password same as the mqtt
and made a restart of haos
I get still the same errors on log.

Hi i changed ip to core-mosquitto:1883 again but when i did i realised that i had just one “/” after the “:”
so i added “/”
now it is mqtt://core-mosquitto:1883 instead of mqtt:/core-mosquitto:1883

Now it works :D.

Small details but great impact

4 Likes

I tried to connect device to mqtt but i got error message " SRSP - AF - dataRequest after 6000ms"
I replugged te usb and restarted the HAOS
Now it doesnt work anymore:
I assume there is someting wrong with usb hub or device

This is my log now:

[12:03:12] INFO: Preparing to start...
[12:03:13] INFO: Socat not enabled
[12:03:15] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-04-03 12:03:20: Logging to console and directory: '/config/zigbee2mqtt/log/2023-04-03.12-03-20' filename: log.txt
Zigbee2MQTT:info  2023-04-03 12:03:20: Starting Zigbee2MQTT version 1.30.3 (commit #unknown)
Zigbee2MQTT:info  2023-04-03 12:03:20: Starting zigbee-herdsman (0.14.103)
Zigbee2MQTT:error 2023-04-03 12:03:21: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-04-03 12:03:21: Failed to start zigbee
Zigbee2MQTT:error 2023-04-03 12:03:21: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2023-04-03 12:03:21: Exiting...
Zigbee2MQTT:error 2023-04-03 12:03:21: Error: Error while opening serialport 'Error: Error: Resource busy, cannot open /dev/ttyUSB0'
    at SerialPort.<anonymous> (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28)
    at SerialPort._error (/app/node_modules/@serialport/stream/dist/index.js:76:22)
    at /app/node_modules/@serialport/stream/dist/index.js:112:18

I have this at times too. the ports seem somewhat wide for the antennas and depending on how you put it in, it doesn´t connect well. I recommend extracting it, putting it back into the right port properly and even a restart of all HA would help.
You can see under hardware if the USB device is visible.

It works sometimes. Now it works.
I want to pair. I get this error : SRSP - ZDO - mgmtPermitJoinReq after 6000ms
If i restart sometimes it gets in pairing mode. If i click again it gets error.

I changed the usb hub and made a restart still no succes.
SRSP - ZDO - mgmtPermitJoinReq after 6000ms on google many says i need to do a firmware update.
Home assistant is not simple to work with.

Updating firmware unfortunately doesn´t have anything to do with Home assistant. If you´re adding a custom antenna, then yes, firmware updates can be not as straight forward. As alternative you can choose commercial hubs and you integrate with those.

Not sure what stick you have but in Zigbee2Mqtt there is documentation on firmware updates and how to do that: Supported Adapters | Zigbee2MQTT

Hope this helps! once you have it working, it´ll be worth it and if you dig a bit you´ll learn useful stuff. We´ve all been there! Hang in there!

Hi René
Thanks for your support. I updated the firmwire to newest one.
Sadly it freeze for a moment with “Starting zigbee-herdsman (0.14.103)”
Then i get this error:

[11:34:37] INFO: Socat not enabled
[11:34:39] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-04-09 11:34:44: Logging to console and directory: '/config/zigbee2mqtt/log/2023-04-09.11-34-44' filename: log.txt
Zigbee2MQTT:info  2023-04-09 11:34:44: Starting Zigbee2MQTT version 1.30.3 (commit #unknown)
Zigbee2MQTT:info  2023-04-09 11:34:44: Starting zigbee-herdsman (0.14.103)
Zigbee2MQTT:error 2023-04-09 11:35:04: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-04-09 11:35:04: Failed to start zigbee
Zigbee2MQTT:error 2023-04-09 11:35:04: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2023-04-09 11:35:04: Exiting...
Zigbee2MQTT:error 2023-04-09 11:35:04: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:103:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/app/lib/zigbee.ts:58:27)
    at Controller.start (/app/lib/controller.ts:101:27)
    at start (/app/index.js:107:5)

Reflashed. I used “CC1352P2_CC2652P_launchpad_coordinator_20221226.hex”
i reinstalled everything.
Pushed reset button. I switched usb port.
Search for hours on internet for solution.

Ok. Need a bit more info. This error could be related to not having the right firmware.

What stick do you have? Can you share some details?
You have to ensure you choose the right firmware and ensure you choose the coordinator one, not router.

Link to product:
SONOFF ZigBee 3.0 USB Dongle Plus, TI CC2652P Coördinator, Universele USB ZigBee Hub, ZigBee Gateway voor Home Assistant

https://www.amazon.nl/dp/B09KXTCMSC?psc=1&ref=ppx_yo2ov_dt_b_product_details

Pictures of the dongle:




Firmware i used:
“CC1352P2_CC2652P_launchpad_coordinator_20221226.hex” Coordinator
I used program: Flash Programmer 2
First i made sure it got in bootloader.

So indeed it looks all ok.

Coordinator according the instructions indeed is https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20221226.zip

Did it verify ok when flashing? Maybe try flashing again and follow the instructions here:
https://sonoff.tech/wp-content/uploads/2021/09/Zigbee-3.0-USB-dongle-plus-firmware-flashing-1-1.docx

I don’t have that stick but I’m sure you should be able to get it working!

Settings flashing:

Result flashing:

Looks all good. Still the same issue?

You could try to change usb port (update settings too in that case).

1 Like

René it works now!! And without problem, I added the device I wanted to.
It seems after all firmware update did solved the problem with adding device but in between I added plugin deCONZ for alternative way of connecting device.
But I didn’t switched off. So after firmware update it didn’t start because of deConz.
I switched off deConz and immediately it worked!! I also added device without problem :DD:DDDDDD
I appreciate your help en support!

1 Like

Fantastic!!! Glad you got it working! I´m sure in the process you learned new things, so next time you can help others :slight_smile:

Hi Rene and @ibrahim-the-second I am in a similar position but without some of the skills that @ibrahim-the-second has.

I can not remember if I have flashed my dongle or not. I started with this install HAOS on an micro PC for work a year ago - got stuck and stopped. Now I am trying to get going again.

image

Log files

[13:01:23] INFO: Preparing to start…
[13:01:24] INFO: Socat not enabled
[13:01:24] INFO: Starting Zigbee2MQTT…
Zigbee2MQTT:info 2024-03-18 13:01:25: Logging to console and directory: ‘/config/zigbee2mqtt/log/2024-03-18.13-01-25’ filename: log.txt
Zigbee2MQTT:info 2024-03-18 13:01:25: Starting Zigbee2MQTT version 1.36.0 (commit #unknown)
Zigbee2MQTT:info 2024-03-18 13:01:25: Starting zigbee-herdsman (0.35.1)
Zigbee2MQTT:info 2024-03-18 13:01:26: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2024-03-18 13:01:26: Coordinator firmware version: ‘{“meta”:{“maintrel”:1,“majorrel”:2,“minorrel”:7,“product”:1,“revision”:20210708,“transportrev”:2},“type”:“zStack3x0”}’
Zigbee2MQTT:info 2024-03-18 13:01:26: Currently 0 devices are joined:
Zigbee2MQTT:info 2024-03-18 13:01:26: Zigbee: disabling joining new devices.
Zigbee2MQTT:info 2024-03-18 13:01:26: Connecting to MQTT server at mqtt://192.168.1.102:1883
Zigbee2MQTT:error 2024-03-18 13:01:29: MQTT error: connect EHOSTUNREACH 192.168.1.102:1883
Zigbee2MQTT:error 2024-03-18 13:01:29: MQTT failed to connect, exiting…
Zigbee2MQTT:info 2024-03-18 13:01:29: Stopping zigbee-herdsman…
Zigbee2MQTT:error 2024-03-18 13:01:32: MQTT error: connect EHOSTUNREACH 192.168.1.102:1883
Zigbee2MQTT:error 2024-03-18 13:01:35: MQTT error: connect EHOSTUNREACH 192.168.1.102:1883
Zigbee2MQTT:info 2024-03-18 13:01:36: Stopped zigbee-herdsman

I am using the same Sonoff ZB Dongle-P Plus 3.0

I have also tried to stop ZHA starting
image

Any guidance would be gratefully received :slight_smile: Fergus.

Zigbee2MQTT can’t reach the broker at 192.168.1.102:1883. Do you use the mosquitto add-on, or a separate one ?

Thank you Francis

Think it might be installed. There a green dot in the top right

However the log file does not look good
image

screenshot of configuration

Thanks Fergus