[App][Pro] MQTT Broker for Homey

1 Like

Mine is working this morning and I can see 10.3.2 is installed.

Earlier this morning I did a soft restart of Homey. But no response. Pull The Plug (on Homey) did work. Thanks for this simple and easy solution robertklep

Attention & Important:

After three days of trying to isolate the problem why my app aborts with the error ā€œECONNREFUSEDā€ when connecting to the MQTT Broker without any code changes on my part.

image

I finally came to the conclusion that one of the most commonly used MQTT[.js] libraries (>v5.5) is no longer compatible with the Aedes library (v0.48.1) you are using.

Could you please upgrade this to the current (v50.1) version, so that not only my apps but also other apps will no longer have problems with version incompatibility in the future.

THX Chris

Would it be possible to use OTA updates via an MQTT Broker?

https://homey.app/en-nl/app/nl.scanno.mqttbroker/MQTT-Broker/test/

Updated to aedes 0.51.2. Perhaps you can test as I do not have a recent homey (running the 2016 kickstarter version)

It depends if someone gets Zigbee2MQTT running on homey.

How to start an OTA update for a z2m-handled device is explained here: OTA updates | Zigbee2MQTT

Sure, no problem !:wink:!

Hi Menno,

The broker crashed during the installation, you may see something in the Developer Tools > Crashes

image

In the meantime, I have uninstalled and reinstalled the MQTT Broker. Now I have the problem that when I press the ā€œSave Settingsā€ button in the settings, the broker also crashes

image

image


GM @scanno

I have bad and good news. After some testing, I noticed the following:

The current version (3.0.2) doesnā€™t work either. Even after uninstalling the broker app and restarting the HP2023, I still get the timeline error message:

image

And now the good one:

After some trial and error with the settings I came up with the following workaround:

  1. install MQTT Broker App.

  2. set all broker settings to enable & Save Settings
    image

  3. set username/password
    image

  4. disable unused settings & Save Settings
    image

Hooray now itā€™s running and I can start testing !:partying_face:!

image

All I can see in the dev console is that port 1883 is already in useā€¦

All I can assume is that after you save the settings and start the broker, the broker crashes because something already uses port 1883ā€¦

I have not found a way to catch that error and send a notification or something similar.

The EONOENT error is thrown because there is no config file available. As soon as the settings are saved, this is no longer shown and the error is not a fatal one.

But then the port would have to be released again after a Homey restart without the app.

BDW: What about the workaround, now everything works fine again and the broker receives data?

Iā€™m also seeing a similar issue with HomeKitty, where it often crashes because thereā€™s already a process listening on the (fixed) port that the app uses. My guess is that itā€™s possible for apps to run multiple times, or that older instances donā€™t get cleaned up properly.

I give @robertklep right. Are you using the onUninit() hook to terminate the broker ?

Beware that onUninit() has been broken for a long time.

But he is still in the doc !!

Thatā€™s because itā€™s an issue that Athom doesnā€™t understand :man_shrugging:t3:

I have looked in my code. Try App#onUnload(), it is not documented, but it is calledšŸ¤¦ā€ā™‚ļø

I canā€™t reproduce that (also canā€™t find any reference to onUnload anywhere).