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

Updating Mosquitto broker to 6.0.1 stops AM43 from working #28

Open
DaveTiff opened this issue May 22, 2021 · 34 comments
Open

Updating Mosquitto broker to 6.0.1 stops AM43 from working #28

DaveTiff opened this issue May 22, 2021 · 34 comments

Comments

@DaveTiff
Copy link

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
Copy link
Author

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
Copy link
Author

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

#27 (comment)

@CaptInsano
Copy link

Also happening here.
HomeAssistant 2021.5.5
Mosquitto: 6.0.1

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

@Kite-Smurf
Copy link

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

@balbulator
Copy link

balbulator commented May 23, 2021

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

@belenkiy-lab
Copy link

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.

@balbulator
Copy link

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?

@belenkiy-lab
Copy link

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 что бы использовать ее полноценно и однообразно у себя.

@balbulator
Copy link

none of the options work at the moment

@belenkiy-lab
Copy link

Use mqtt version 5.1.1 and this integration

@balbulator
Copy link

The problem is that I cannot roll back the mosquitoes

@belenkiy-lab
Copy link

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

@balbulator
Copy link

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

@belenkiy-lab
Copy link

belenkiy-lab commented Jun 3, 2021

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?

@balbulator
Copy link

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

@DaveTiff
Copy link
Author

DaveTiff commented Jun 5, 2021

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

Re Dave

@danilkorotkov
Copy link

this is PubSubClient issue, not AM43

@Kite-Smurf
Copy link

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?

@danilkorotkov
Copy link

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

@balbulator
Copy link

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

@buxtronix
Copy link
Owner

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.

@MrBigleg
Copy link

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

@CaptInsano
Copy link

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?

@timdonovanuk
Copy link

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

@balbulator
Copy link

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
Copy link

#21 (comment)
Everything can be cured with ESPHome

@Kite-Smurf
Copy link

#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.

@balbulator
Copy link

#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

@don86nl
Copy link

don86nl commented Aug 6, 2021

#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!

@sambeetm
Copy link

sambeetm commented Feb 2, 2022

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
|-- 1.2.2
|-- 1.0
|-- 1.0
|-- 1.0
|-- 2.1.0
| |-- 1.2.2
|-- 1.1.0
|-- 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 =========================

@Kite-Smurf
Copy link

Do not use the external_components:

source: github://buxtronix/esphome-am43

the AM43 is already a built in option in ESP home

@sambeetm
Copy link

sambeetm commented Feb 2, 2022

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

@panoriega
Copy link

panoriega commented Apr 7, 2022

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

@danilkorotkov
Copy link

6.2.0 works perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests