SmartHome-yourself / m5-dial-for-esphome

M5 Stack Dial - Custom Component for ESPHome
MIT License
57 stars 8 forks source link

class ArduinoJson::V704PB2::StaticJsonDocument' is deprecated: use JsonDocument instead #37

Open fft1010 opened 3 weeks ago

fft1010 commented 3 weeks ago

Hi, when compiling with ESPHome I get the following errors

Compiling .pioenvs/m5-dial-01/src/esphome/core/scheduler.cpp.o
In file included from src/esphome.h:39,
                 from src/esphome/components/shys_m5_dial/shys_m5_dial.h:2,
                 from src/esphome/components/shys_m5_dial/shys_m5_dial.cpp:2:
src/esphome/components/shys_m5_dial/ha_device.h:19:17: warning: 'template<unsigned int N> class ArduinoJson::V704PB2::StaticJsonDocument' is deprecated: use JsonDocument instead [-Wdeprecated-declarations]
                 StaticJsonDocument<bufferSize> jsonBuffer;
                 ^~~~~~~~~~~~~~~~~~
In file included from .piolibdeps/m5-dial-01/ArduinoJson/src/ArduinoJson.hpp:53,
                 from .piolibdeps/m5-dial-01/ArduinoJson/src/ArduinoJson.h:9,
                 from src/esphome/components/shys_m5_dial/ha_device.h:6,
                 from src/esphome.h:39,
                 from src/esphome/components/shys_m5_dial/shys_m5_dial.h:2,
                 from src/esphome/components/shys_m5_dial/shys_m5_dial.cpp:2:
.piolibdeps/m5-dial-01/ArduinoJson/src/ArduinoJson/compatibility.hpp:63:58: note: declared here
 class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
                                                          ^~~~~~~~~~~~~~~~~~
Compiling .pioenvs/m5-dial-01/src/esphome/core/string_ref.cpp.o
Compiling .pioenvs/m5-dial-01/src/esphome/core/time.cpp.o
Compiling .pioenvs/m5-dial-01/src/esphome/core/util.cpp.o

and

Compiling .pioenvs/m5-dial-01/lib622/EEPROM/EEPROM.cpp.o
In file included from src/esphome.h:39,
                 from src/main.cpp:3:
src/esphome/components/shys_m5_dial/ha_device.h:19:17: warning: 'template<unsigned int N> class ArduinoJson::V704PB2::StaticJsonDocument' is deprecated: use JsonDocument instead [-Wdeprecated-declarations]
                 StaticJsonDocument<bufferSize> jsonBuffer;
                 ^~~~~~~~~~~~~~~~~~
In file included from .piolibdeps/m5-dial-01/ArduinoJson/src/ArduinoJson.hpp:53,
                 from .piolibdeps/m5-dial-01/ArduinoJson/src/ArduinoJson.h:9,
                 from src/esphome/components/shys_m5_dial/ha_device.h:6,
                 from src/esphome.h:39,
                 from src/main.cpp:3:
.piolibdeps/m5-dial-01/ArduinoJson/src/ArduinoJson/compatibility.hpp:63:58: note: declared here
 class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
                                                          ^~~~~~~~~~~~~~~~~~
Compiling .pioenvs/m5-dial-01/libbbe/M5GFX/M5GFX.cpp.o

It stimm get the firmware, and connects to the local wifi, but in HomeAssistant the dial cannot be registered.

Display says "Disconnected"

But at the commandline I see

WARNING m5-dial-01 @ 192.168.90.65: Connection error occurred: m5-dial-01 @ 192.168.90.65: Connection lost
INFO Successfully connected to m5-dial-01 @ 192.168.90.65 in 0.047s
WARNING m5-dial-01 @ 192.168.90.65: Connection error occurred: [Errno 54] Connection reset by peer
INFO Successfully connected to m5-dial-01 @ 192.168.90.65 in 0.004s
WARNING m5-dial-01 @ 192.168.90.65: Connection error occurred: [Errno 54] Connection reset by peer
INFO Successfully connected to m5-dial-01 @ 192.168.90.65 in 0.004s

I can ping the device, but ESPHOme at HomeAssistant is not wanting to register, as it cannot get the API connectedt to.

any ideas? thanks Juergen

fft1010 commented 3 weeks ago

Additional information: When the M5 turns oin, it forst shows "OFFLINE"; than it has a flickering Blue Screen with "DISCONNECTED", than the flickering stops after some seconds.

If I than try to add the M5 to the HomeAssistant in the ESPHome form it imediately show that it cannot a connect.

When flickering blue it takes some seconds and flips between offline/Disconnected.

Any ideas what I can do?

thanks Juergen

fft1010 commented 3 weeks ago

When I click on connect, I see the following over the serial connection:

[16:29:21][D][api:102]: Accepted 192.168.90.6
[16:29:21][W][component:170]: Component api cleared Warning flag
[16:29:21]ESP-ROM:esp32s3-20210327
[16:29:21]Build:Mar 27 2021
[16:29:21]rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
[16:29:21]Saved PC:0x4204341f
WARNING Decoded 0x4204341f: event_callback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/lwip/lwip/src/api/sockets.c:2618
[16:29:21]SPIWP:0xee
[16:29:21]mode:DIO, clock div:1
[16:29:21]load:0x3fce3808,len:0x43c
[16:29:21]load:0x403c9700,len:0xbec
[16:29:21]load:0x403cc700,len:0x2a3c
[16:29:21]entry 0x403c98d8
[16:29:21][I][logger:156]: Log initialized
[16:29:21][C][ota:483]: There have been 6 suspected unsuccessful boot attempts.
[16:29:21][D][esp32.preferences:114]: Saving 1 preferences to flash...
[16:29:21][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[16:29:21][I][DEVICE:139]: setScreenOffTime 45000
[16:29:21][I][DEVICE:145]: setLongPressDuration 1200
[16:29:21][I][DEVICE:151]: setApiSendDelay 1200
[16:29:21][I][DEVICE:156]: setApiSendLock 3000
[16:29:21][I][DEVICE:161]: setRotaryStepWidth 5
[16:29:21][I][DEVICE:166]: setFontName \x94/\xce?
[16:29:21][I][DEVICE:171]: setFontFactor 1
[16:29:21][W][DEVICE:051]: Modes JSON: {"rgb_mode": {"enable": false}, "dimm_mode": {"enable": false}, "white_mode": {"enable": false, "min_kelvin": 2000, "max_kelvin": 6500}}
[16:29:21][D][DEVICE:115]: New Device: Keller Deckenlicht
[16:29:21][D][HA_DEVICE:023]: Init Light: switch.shelly1_f41cf7_deckenlicht
[16:29:21][D][DEVICE:126]: Device added
[16:29:21][I][app:029]: Running through setup()...
[16:29:21][I][DEVICE:243]: Initialisierung...
[16:29:21][I][DEVICE:248]: Register Callbacks...
[16:29:21][D][DEVICE:027]: register on_rotary_left Callback
[16:29:21][D][DEVICE:022]: register on_rotary_right Callback
[16:29:21][D][DEVICE:032]: register on_short_button_press Callback
[16:29:21][D][DEVICE:037]: register on_long_button_press Callback
[16:29:21][D][DEVICE:030]: register on_touch Callback
[16:29:21][D][DEVICE:034]: register on_swipe Callback
[16:29:21][I][log:018]: M5 is initialized
[16:29:21][C][wifi:038]: Setting up WiFi...
[16:29:21][C][wifi:051]: Starting WiFi...
[16:29:21][C][wifi:052]:   Local MAC: 34:B7:DA:54:F3:98
[16:29:22][D][wifi:462]: Starting scan...
[16:29:22][W][component:157]: Component wifi set Warning flag: unspecified
[16:29:22][D][wifi:292]: Network is not connected
[16:29:27][D][wifi:477]: Found networks:
[16:29:27][I][wifi:521]: - 'DSI5_IoT' (76:83:C2:AB:45:AE) ▂▄▆█
[16:29:27][D][wifi:522]:     Channel: 11
[16:29:27][D][wifi:523]:     RSSI: -39 dB
[16:29:27][I][wifi:521]: - 'DSI5_IoT' (BA:FB:E4:4A:E1:54) ▂▄▆█
[16:29:27][D][wifi:522]:     Channel: 3
[16:29:27][D][wifi:523]:     RSSI: -66 dB
[16:29:27][I][wifi:521]: - 'DSI5_IoT' (BA:FB:E4:4A:DF:57) ▂▄▆█
[16:29:27][D][wifi:522]:     Channel: 6
[16:29:27][D][wifi:523]:     RSSI: -81 dB
[16:29:27][D][wifi:526]: - '' (76:83:C2:BB:45:AE) ▂▄▆█
[16:29:27][D][wifi:526]: - 'mRNA-bntx-tsmcm4-38628666-5G' (76:83:C2:DB:45:AE) ▂▄▆█
[16:29:27][D][wifi:526]: - 'DSI2' (74:83:C2:DB:45:AE) ▂▄▆█
[16:29:27][D][wifi:526]: - '' (76:83:C2:CB:45:AE) ▂▄▆█
[16:29:27][D][wifi:526]: - '' (C6:FB:E4:4A:E1:54) ▂▄▆█
[16:29:27][D][wifi:526]: - 'DSI2' (B4:FB:E4:4A:E1:54) ▂▄▆█
[16:29:27][D][wifi:526]: - 'mRNA-bntx-tsmcm4-38628666-5G' (BE:FB:E4:4A:E1:54) ▂▄
16:29:27][D][wifi:526]: - '' (C2:FB:E4:4A:E1:54) ▂▄▆█
[16:29:27][D][wifi:526]: - '' (C2:FB:E4:4A:DF:57) ▂▄▆█[D][wifi:526]: - 'DSI2' (B4:FB:E4:4A:DF:57) ▂▄▆█
[16:29:27][D][wifi:526]: - 'mRNA-bntx-tsmcm4-38628666-5G' (C6:FB:E4:4A:DF:57) [D][wifi:526]: - '' (BE:FB:E4:4A:DF:57) [I][wifi:303]: WiFi Connecting to 'DSI5_IoT'...
[16:29:28][I][wifi:597]: WiFi Connected!
[16:29:28][C][wifi:408]:   Local MAC: 34:B7:DA:54:F3:98
[16:29:28][C][wifi:413]:   SSID: 'DSI5_IoT'
[16:29:28][C][wifi:416]:   IP Address: 192.168.90.65
[16:29:28][C][wifi:420]:   BSSID: 76:83:C2:AB:45:AE
[16:29:28][C][wifi:421]:   Hostname: 'm5-dial-01'
[16:29:28][C][wifi:423]:   Signal strength: -40 dB ▂▄▆█
[16:29:28][C][wifi:427]:   Channel: 11
[16:29:28][C][wifi:428]:   Subnet: 255.255.255.0
[16:29:28][C][wifi:429]:   Gateway: 192.168.90.1
[16:29:28][C][wifi:430]:   DNS1: 192.168.90.1
[16:29:28][C][wifi:431]:   DNS2: 0.0.0.0
[16:29:28][D][wifi:606]: Disabling AP...
[16:29:28][D][HA_API:284]: API is not connected
[16:29:28][C][ota:096]: Over-The-Air Updates:
[16:29:28][C][ota:097]:   Address: m5-dial-01.local:3232
[16:29:28][C][ota:103]:   OTA version: 2.
[16:29:28][W][ota:107]: Last Boot was an unhandled reset, will proceed to safe mode in 4 restarts
[16:29:28][C][api:025]: Setting up Home Assistant API server...
[16:29:28][I][app:062]: setup() finished successfully!
[16:29:28][W][component:170]: Component wifi cleared Warning flag
[16:29:28][W][component:157]: Component api set Warning flag: unspecified
[16:29:28][I][app:100]: ESPHome version 2024.5.5 compiled on Jun 10 2024, 16:26:10
[16:29:28][I][app:102]: Project smarthomeyourself.m5_dial version 1.0
[16:29:28][C][wifi:580]: WiFi:
[16:29:28][C][wifi:408]:   Local MAC: 34:B7:DA:54:F3:98
[16:29:28][C][wifi:413]:   SSID: 'DSI5_IoT'
[16:29:28][C][wifi:416]:   IP Address: 192.168.90.65
[16:29:28][C][wifi:420]:   BSSID: 76:83:C2:AB:45:AE
[16:29:28][C][wifi:421]:   Hostname: 'm5-dial-01'
[16:29:28][C][wifi:423]:   Signal strength: -40 dB ▂▄▆█
[16:29:28][C][wifi:427]:   Channel: 11
[16:29:28][C][wifi:428]:   Subnet: 255.255.255.0
[16:29:28][C][wifi:429]:   Gateway: 192.168.90.1
[16:29:28][C][wifi:430]:   DNS1: 192.168.90.1
[16:29:28][C][wifi:431]:   DNS2: 0.0.0.0
[16:29:28][C][logger:185]: Logger:
[16:29:28][C][logger:186]:   Level: DEBUG
[16:29:28][C][logger:188]:   Log Baud Rate: 115200
[16:29:28][C][logger:189]:   Hardware UART: USB_CDC
[16:29:28][C][shys_m5_dial:042]: -----------------------------------
[16:29:28][C][shys_m5_dial:043]: Shys M5 Dial
[16:29:28][C][shys_m5_dial:044]: -----------------------------------
[16:29:28][C][captive_portal:088]: Captive Portal:
[16:29:28][C][mdns:115]: mDNS:
[16:29:28][C][mdns:116]:   Hostname: m5-dial-01
[16:29:29][C][ota:096]: Over-The-Air Updates:
[16:29:29][C][ota:097]:   Address: m5-dial-01.local:3232
[16:29:29][C][ota:103]:   OTA version: 2.
[16:29:29][W][ota:107]: Last Boot was an unhandled reset, will proceed to safe mode in 4 restarts
[16:29:29][C][api:139]: API Server:
[16:29:29][C][api:140]:   Address: m5-dial-01.local:6053
[16:29:29][C][api:144]:   Using noise encryption: NO
[16:29:29][C][improv_serial:032]: Improv Serial:

API is not connect is written somewhere, but I do not know why it is not connected.

thanks Juergen