am43 icon indicating copy to clipboard operation
am43 copied to clipboard

Updating Mosquitto broker to 6.0.1 stops AM43 from working

Open DaveTiff opened this issue 4 years ago • 34 comments

Hi, updated my Mosquitto broker from 5.1.1 to 6.0.1 stops AM43 from operating.

The Blue Tooth Enable works, but the components on HA dashboard remain Greyed Out. Restoring MQTT back to 5.1.1 cures this problem.

Regards, Dave

DaveTiff avatar May 22 '21 10:05 DaveTiff

Now not sure it is that, as it has now also stopped working with 5.1.1. Restarting Mosquitto broker allows it to work again.

It has been working fine for over a week, Now running HA 2021.5.5

Anyone else having problems.

Regards, Dave

DaveTiff avatar May 22 '21 10:05 DaveTiff

Another person is now having trouble with Mosquitto broker 6.0.1 and AM43.

https://github.com/buxtronix/am43/issues/27#issuecomment-846403962

DaveTiff avatar May 22 '21 13:05 DaveTiff

Also happening here. HomeAssistant 2021.5.5 Mosquitto: 6.0.1

All other MQTT devices (mainly Tasmota) all still working perfectly

CaptInsano avatar May 22 '21 18:05 CaptInsano

Hi, The exact same thing happens with my system too: updated my Mosquitto broker from 5.1.1 to 6.0.1 stops AM43 from operating.

The Blue Tooth Enable works, but the components on HA dashboard remain Greyed Out. Restoring MQTT back to 5.1.1 cures this problem.

Regards, Otto

Kite-Smurf avatar May 23 '21 09:05 Kite-Smurf

added a question in the mosquito thread [https://github.com/home-assistant/addons/issues/2030] support the question

balbulator avatar May 23 '21 15:05 balbulator

I have several curtains at home. half are connected via this integration, half are connected via test version in esphome after updating mqtt those connected via esphome remained working. the rest stopped working like everyone else.

belenkiy-lab avatar May 23 '21 21:05 belenkiy-lab

I have several curtains at home. half are connected via this integration, half are connected via test version in esphome after updating mqtt those connected via esphome remained working. the rest stopped working like everyone else.

tell me, how exactly did you connect the AM43 to ESPhome in the test?

balbulator avatar May 24 '21 07:05 balbulator

It worked for me if I specified "buxtronix: am43" in the Esphome version. After that, everything worked. It was in early March. When I tried to do similar actions in April, I get the same error as yours. therefore, I started new curtains not through esphome, but through native integration from buxtronix. I decided it was easier than trying to figure it out. I'm waiting for this integration to be in the esphome release to use it fully and monotonously at home.

У меня это работало если указать в версии Esphome "buxtronix:am43". После этого все работало. Это было в в начале марта. Когда я пробовал в апреле сделать аналогичные действия, я получаю ошибку, такую же как и у тебя. поэтому новые шторы я завел не через esphome а через родную интеграцию от buxtronix. Решил что это проще, чем разбираться. Жду когда данная интеграция будет в релизе esphome что бы использовать ее полноценно и однообразно у себя.

belenkiy-lab avatar May 24 '21 14:05 belenkiy-lab

none of the options work at the moment

balbulator avatar May 24 '21 17:05 balbulator

Use mqtt version 5.1.1 and this integration

belenkiy-lab avatar May 24 '21 21:05 belenkiy-lab

The problem is that I cannot roll back the mosquitoes

balbulator avatar May 25 '21 16:05 balbulator

what prevents you from installing a clean instalation of mosquito not from HA? on any computer on the network or docker?

belenkiy-lab avatar May 26 '21 21:05 belenkiy-lab

Everything interferes, on the PC not an option, on the docker, too, as on the Home Assistant

balbulator avatar May 27 '21 17:05 balbulator

https://1drv.ms/u/s!AgyPTdNGxaf8iY1lVEbLF46puzGa2A?e=vV0QSs

this is my mqtt snapshot as I understand you can restore 5.1.1 using it. will it help?

belenkiy-lab avatar Jun 03 '21 21:06 belenkiy-lab

https://1drv.ms/u/s!AgyPTdNGxaf8iY1lVEbLF46puzGa2A?e=vV0QSs

this is my mqtt snapshot as I understand you can restore 5.1.1 using it. will it help?

Thanks, I have installed the Mosquitto broker add-on Current version: 5.1.1, but after HA update (core-2021.6.2) the problem reappeared

balbulator avatar Jun 05 '21 10:06 balbulator

I am on core-2021.6.2 and Mosquitto broker 5.1.1 mine is still working ok

Re Dave

DaveTiff avatar Jun 05 '21 13:06 DaveTiff

this is PubSubClient issue, not AM43

danilkorotkov avatar Jun 07 '21 10:06 danilkorotkov

this is PubSubClient issue, not AM43

Thanks for the updated news on this. The question is how to solve it? and how to get AM43 working with the mqtt 6.0 version?

Kite-Smurf avatar Jun 07 '21 12:06 Kite-Smurf

Thanks for the updated news on this. The question is how to solve it? and how to get AM43 working with the mqtt 6.0 version?

you can include arduino-mqtt lib instead of PubSubClient lib and then check all of 22 mqtt methods in your/example sketch) ota update is available PubSubClient has no update since 2020 so it is possible that it is abandoned

danilkorotkov avatar Jun 07 '21 13:06 danilkorotkov

Maybe it's time to make changes to the repository? It feels like this project is abandoned

balbulator avatar Jun 08 '21 20:06 balbulator

I've not got the bad mosquitto version so can't reproduce. Feel free to send a PR and I'll merge a fix that helps.

buxtronix avatar Jun 08 '21 21:06 buxtronix

Thanks for the updated news on this. The question is how to solve it? and how to get AM43 working with the mqtt 6.0 version?

you can include arduino-mqtt lib instead of PubSubClient lib and then check all of 22 mqtt methods in your/example sketch) ota update is available PubSubClient has no update since 2020 so it is possible that it is abandoned

Do you mind sharing your sketch? I tried and just go tonnes of errors compiling

MrBigleg avatar Jun 20 '21 04:06 MrBigleg

Has anyone got a solution for this issue when mosquitto is already at v6.0.1?

I unfortunately have no mosquitto snapshot at earlier version, all other MQTT integrations are still working great but no action from AM43 integration on my system.

Has anyone successfully ported the code to a different MQTT client?

CaptInsano avatar Jul 03 '21 15:07 CaptInsano

Same issue here. It would help if the serial output had any info or debugging lines about MQTT, as I have no idea whats going on.

I can see it finding position and battery but nothing is sent to MQTT other than am43/enabled = ON

timdonovanuk avatar Jul 05 '21 20:07 timdonovanuk

Same issue here. It would help if the serial output had any info or debugging lines about MQTT, as I have no idea whats going on.

I can see it finding position and battery but nothing is sent to MQTT other than am43/enabled = ON

exactly the same with me

balbulator avatar Jul 06 '21 09:07 balbulator

https://github.com/buxtronix/am43/issues/21#issuecomment-880215140 Everything can be cured with ESPHome

balbulator avatar Jul 14 '21 21:07 balbulator

#21 (comment) Everything can be cured with ESPHome

Could you please share some instructions on how to set this up in ESPHome? I never used that before. Thanks for help.

Kite-Smurf avatar Jul 15 '21 05:07 Kite-Smurf

#21 (comment) Everything can be cured with ESPHome

Could you please share some instructions on how to set this up in ESPHome? I never used that before. Thanks for help.

Also important in -> Supervisor -> ESPHome -> Configuration -> esphome_version - buxtronix:am43 certfile - fullchain.pem keyfile - privkey.pem

esphome:
  name: cover
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "any password"

wifi:
  ssid: "Sergio"
  password: "Password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Cover Fallback Hotspot"
    password: "StW7wyE8nD6N"

captive_portal:

esp32_ble_tracker:

ble_client:
  - mac_address: 01:02:03:AA:BB:CC
    id: blinds

cover:
  - platform: am43
    name: "Blinds in bedroom"
    id: cover_bedroom
    ble_client_id: blinds

sensor:
  - platform: am43
    ble_client_id: blinds
    battery_level:
      name: "Blinds battery"
    illuminance:
      name: "Blinds light"
    update_interval: 120s
  - platform: uptime
    name: Uptime Sensor


switch:
  - platform: restart
    name: "Device Restart"
  - platform: ble_client
    name: "Blinds  On"
    ble_client_id: cover
    id: right_on

balbulator avatar Jul 15 '21 20:07 balbulator

#21 (comment) Everything can be cured with ESPHome

Could you please share some instructions on how to set this up in ESPHome? I never used that before. Thanks for help.

Also important in -> Supervisor -> ESPHome -> Configuration -> esphome_version - buxtronix:am43 certfile - fullchain.pem keyfile - privkey.pem

esphome:
  name: cover
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "any password"

wifi:
  ssid: "Sergio"
  password: "Password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Cover Fallback Hotspot"
    password: "StW7wyE8nD6N"

captive_portal:

esp32_ble_tracker:

ble_client:
  - mac_address: 01:02:03:AA:BB:CC
    id: blinds

cover:
  - platform: am43
    name: "Blinds in bedroom"
    id: cover_bedroom
    ble_client_id: blinds

sensor:
  - platform: am43
    ble_client_id: blinds
    battery_level:
      name: "Blinds battery"
    illuminance:
      name: "Blinds light"
    update_interval: 120s
  - platform: uptime
    name: Uptime Sensor


switch:
  - platform: restart
    name: "Device Restart"
  - platform: ble_client
    name: "Blinds  On"
    ble_client_id: cover
    id: right_on

This helped me, thanks!

don86nl avatar Aug 06 '21 19:08 don86nl

Hi..first time with ESPHome. Followed all the above instructions and installed the add-on. Set the following configurations.

esphome_version: buxtronix:am43 certfile: fullchain.pem keyfile: privkey.pem

My .yaml file is as below and validates. But, throwing bunch of errors during install. Can somebody please suggest whats wrong here?

esphome: name: cover platform: ESP32 board: esp32dev

Enable logging

logger:

Enable Home Assistant API

api:

ota: password: "anypassword"

wifi: ssid: "xxxxxxx" password: "yyyyyyy"

Enable fallback hotspot (captive portal) in case wifi connection fails

ap: ssid: "ssssssss" password: "zzzzzzzz"

external_components:

  • source: github://buxtronix/esphome-am43

captive_portal:

esp32_ble_tracker:

ble_client:

  • mac_address: 02:05:fc:30:41:e3 id: guest_am43

cover:

  • platform: am43 name: "Guest Blinds" id: guest_cover ble_client_id: guest_am43

sensor:

  • platform: am43 ble_client_id: guest_am43 battery_level: name: "Guest Blinds battery" illuminance: name: "Guest Blinds light" update_interval: 120s

switch:

  • platform: ble_client name: "Guest window" ble_client_id: guest_am43

Compilation Errors.....

INFO Reading configuration /config/esphome/blind-engine1.yaml... INFO Generating C++ source... INFO Compiling app... Processing cover (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.3.2)

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf Dependency Graph |-- <AsyncTCP-esphome> 1.2.2 |-- <WiFi> 1.0 |-- <FS> 1.0 |-- <Update> 1.0 |-- <ESPAsyncWebServer-esphome> 2.1.0 | |-- <AsyncTCP-esphome> 1.2.2 |-- <DNSServer> 1.1.0 |-- <ESPmDNS> 1.0 Compiling /data/cover/.pioenvs/cover/src/esphome/components/am43/am43.cpp.o Compiling /data/cover/.pioenvs/cover/src/esphome/components/am43/cover/am43_cover.cpp.o src/esphome/components/am43/cover/am43_cover.cpp: In member function 'virtual void esphome::am43::Am43Component::loop()': src/esphome/components/am43/cover/am43_cover.cpp:26:27: error: 'Established' is not a member of 'esphome::esp32_ble_tracker::ClientState' if (this->node_state == espbt::ClientState::Established && !this->logged_in_) { ^ src/esphome/components/am43/cover/am43_cover.cpp: In member function 'virtual void esphome::am43::Am43Component::control(const esphome::cover::CoverCall&)': src/esphome/components/am43/cover/am43_cover.cpp:48:27: error: 'Established' is not a member of 'esphome::esp32_ble_tracker::ClientState' if (this->node_state != espbt::ClientState::Established) { ^ src/esphome/components/am43/cover/am43_cover.cpp: In member function 'virtual void esphome::am43::Am43Component::gattc_event_handler(esp_gattc_cb_event_t, esp_gatt_if_t, esp_ble_gattc_cb_param_t*)': src/esphome/components/am43/cover/am43_cover.cpp:97:26: error: 'Established' is not a member of 'esphome::esp32_ble_tracker::ClientState' this->node_state = espbt::ClientState::Established; ^ src/esphome/components/am43/am43.cpp: In member function 'virtual void esphome::am43::Am43::gattc_event_handler(esp_gattc_cb_event_t, esp_gatt_if_t, esp_ble_gattc_cb_param_t*)': src/esphome/components/am43/am43.cpp:33:26: error: 'Idle' is not a member of 'esphome::esp32_ble_tracker::ClientState' this->node_state = espbt::ClientState::Idle; ^ src/esphome/components/am43/am43.cpp:56:26: error: 'Established' is not a member of 'esphome::esp32_ble_tracker::ClientState' this->node_state = espbt::ClientState::Established; ^ src/esphome/components/am43/am43.cpp:66:18: error: 'millis' was not declared in this scope millis() - this->last_battery_update_ > 10000) { ^ src/esphome/components/am43/am43.cpp: In member function 'virtual void esphome::am43::Am43::update()': src/esphome/components/am43/am43.cpp:95:27: error: 'Established' is not a member of 'esphome::esp32_ble_tracker::ClientState' if (this->node_state != espbt::ClientState::Established) { ^ *** [/data/cover/.pioenvs/cover/src/esphome/components/am43/cover/am43_cover.cpp.o] Error 1 *** [/data/cover/.pioenvs/cover/src/esphome/components/am43/am43.cpp.o] Error 1 ========================= [FAILED] Took 14.69 seconds =========================

sambeetm avatar Feb 02 '22 04:02 sambeetm

Do not use the external_components:

source: github://buxtronix/esphome-am43

the AM43 is already a built in option in ESP home

Kite-Smurf avatar Feb 02 '22 06:02 Kite-Smurf

Thank you. Deleted those 2 lines. Its got compiled successfully and installed. Working as expected. !!

sambeetm avatar Feb 02 '22 15:02 sambeetm

I put a temp fix for current version using PubSubClient, this is not the best solution, I made this changes just for test purposes. Now it is able to subscribe and publish topics to mosquitto

I also tried to replace PubSubClient by MQTT 2.5. Both versions are on examples on my fork and in "working condition", if you want to try and share your comments about it.

https://github.com/panoriega/am43

Home Assistant 2022.4.0 Mosquitto broker addon 6.0.1

Thanks, Antonio

panoriega avatar Apr 07 '22 23:04 panoriega