sinricpro / esp8266-esp32-sdk

Library for https://sinric.pro - simple way to connect your device to Alexa, Google Home, SmartThings and cloud
https://sinric.pro
Other
231 stars 124 forks source link

problems upgrading to sdk 2.9.1 #155

Closed sgrizzi closed 3 years ago

sgrizzi commented 3 years ago

Hi, I am having problems when upgrading my code from sdk 2.7.6 to 2.9.1. Please also relate to issue #149 . My code was running fine with sdk 2.7.6, which I had to continue using since the Autoconnect library -also embedded in my project- is not supporting SSL. So I removed Autoconnect completely. Code compiles and works fine with 2.7.6. Then I removed 2.7.6 and upgraded to 2.9.1. I am using Platformio as the development environment.

This is the dependency graph: Dependency Graph |-- 6.11.5 |-- 2.3.5 | |-- 1.0 | |-- 1.0 | |-- 1.0 | | |-- 1.0 |-- 1.0.1 |-- 0.1.0 |-- 0.4.2 |-- 2.9.1 | |-- 6.11.5 | |-- 1.0 | |-- 2.3.5 | | |-- 1.0 | | |-- 1.0 | | |-- 1.0 | | | |-- 1.0 |-- 1.0 |-- 1.2 | |-- 1.0 | |-- 1.0 | | |-- 1.0

and this is a subset of the error listing I am getting: In file included from .pio/libdeps/ESP32/SinricPro/src/SinricProDeviceInterface.h:5:0, from .pio/libdeps/ESP32/SinricPro/src/SinricPro.h:12, from src/PLH_Alexa_doorbell.cpp:12: .pio/libdeps/ESP32/SinricPro/src/SinricProRequest.h:14:38: error: 'function' in namespace 'std' does not name a template type using SinricProRequestHandler = std::function<bool(SinricProRequest&)>; ^ In file included from .pio/libdeps/ESP32/SinricPro/src/SinricProTemperaturesensor.h:11:0, from src/PLH_Alexa_doorbell.cpp:14: .pio/libdeps/ESP32/SinricPro/src/SinricProDevice.h:42:15: error: 'SinricProRequestHandler' was not declared in this scope std::vector requestHandlers; ^ .pio/libdeps/ESP32/SinricPro/src/SinricProDevice.h:42:38: error: template argument 1 is invalid std::vector requestHandlers; ^ .pio/libdeps/ESP32/SinricPro/src/SinricProDevice.h:42:38: error: template argument 2 is invalid In file included from .pio/libdeps/ESP32/SinricPro/src/SinricProTemperaturesensor.h:11:0, from src/PLH_Alexa_doorbell.cpp:14: .pio/libdeps/ESP32/SinricPro/src/SinricProDevice.h: In member function 'virtual bool SinricProDevice::handleRequest(SinricProRequest&)': .pio/libdeps/ESP32/SinricPro/src/SinricProDevice.h:113:31: error: 'begin' was not declared in this scope

The platformio.ini file is identical to the one that was working fine previosusly, with the reference to the new library.

Any suggestions? Best regards, Gabriele

sivar2311 commented 3 years ago

Hi Gabriele!

Bug have been fixed in https://github.com/sinricpro/esp8266-esp32-sdk/commit/58ad9f286199baa1c2cafc02f2a1cb16a077be7d

sgrizzi commented 3 years ago

Hi Boris, maybe a naive question.....but how do I use the fix? shall I re-download the library (it is still 2.9.1 at the moment...)? or shall I correct the file manually locally? Rgds, Gabriele

sgrizzi commented 3 years ago

If I correct this "locally" it does compile fine !!!! ..but I do not know if this the most correct action to do. Please let me know. Rgds, Gabriele

sivar2311 commented 3 years ago

Hi Gabriele!

This is not a naive but a completely ligitimate question :)

At the moment the fix is only in the Github repository. I need to create a new release first to make it available through the library managers.

So at the moment there are the options

Edit: I see, you choosed option no. 2 ;)

sgrizzi commented 3 years ago

Hi Boris, well, now the code compiles correctly... but it does not run... I get a strange sequence of messages... Note that I did not modify my source code, and the code was running correctly - I guess that SSL is affecting the behaviour of the code. This is ESP32 serial output:

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5828 entry 0x400806ac

WiFi: IP-Address is 192.168.1.77 Timer set to 10 seconds (timerDelay variable), it will take 10 seconds before publishing the first airco reading. Scanning BLE... hopefully scanning in the background... [E][WiFiClientSecure.cpp:132] connect(): start_ssl_client: -1 [E][WiFiClientSecure.cpp:132] connect(): start_ssl_client: -1 [E][WiFiClientSecure.cpp:132] connect(): start_ssl_client: -1 [E][WiFiClientSecure.cpp:132] connect(): start_ssl_client: -1 abort() was called at PC 0x401b89cf on core 0

Backtrace: 0x40091f60:0x3ffe62a0 0x40092191:0x3ffe62c0 0x401b89cf:0x3ffe62e0 0x401b8a16:0x3ffe6300 0x401b8ac3:0x3ffe6320 0x401b8b46:0x3ffe6340 0x400dd882:0x3ffe6360 0x400dcbfe:0x3ffe6450 0x4014a88d:0x3ffe64a0 0x401459fe:0x3ffe64c0 0x4008e6a9:0x3ffe64f0

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5828 entry 0x400806ac

WiFi: IP-Address is 192.168.1.77 Timer set to 10 seconds (timerDelay variable), it will take 10 seconds before publishing the first airco reading. Scanning BLE... hopefully scanning in the background... [E][WiFiClientSecure.cpp:132] connect(): start_ssl_client: -1 .... and then it will abort and restart again...

I need your support again! Rgds, GAbriele

sivar2311 commented 3 years ago

Hm, this problem is not about the latest fix. This is about SSL / connecting issues : ESP does not connect (and crashing)

Please open new github issue for better tracking (i will close this issue now).

Meanwhile please try if this happens with #define SINRICPRO_NOSSL too

Ah... and you need the latest WebSockets library from github