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
234 stars 124 forks source link

2.9.15 #249

Closed sim404 closed 2 years ago

sim404 commented 2 years ago

Hi, I just loaded release2.9.15 using Arduino and re-compiled some existing doorbell code and got the errors in the attached .txt file. I'm using latest json and made only a minor change to the existing doorbell code. Reverted to 2.9.14 and it compiles no errors. Your comments please sinricP_err_message310122.txt .

sivar2311 commented 2 years ago

Sorry for the inconvenience. Can you provide your sketch for analysis?

sim404 commented 2 years ago

Sure, will do. Give me an hour or so please.

sivar2311 commented 2 years ago

Sure, thank you for your assistance.

Meanwhile i tested the Doorbell example. It compiles without issues for me.

sivar2311 commented 2 years ago

Ok, i think i identified two reasons.

  1. The complained missing references points out to SinricProSignature.cpp. This is the only .cpp file in the library to avoid some incompatibilities with other libraries. That's why it got its own translation unit (.cpp file). It seems there are some leftovers on your PC from a previous compilation (something like a caching issue). The solution would be to clean the build directory. If you enable verbose mode when compiling, you’ll see the build directory being used. Delete that directory, and build again.
  2. You have another issue with your setup which should / must be solved:
    Multiple libraries were found for "WiFi.h"
    Used: C:\Users\wallis\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
    Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
sim404 commented 2 years ago

Well I'm sure you are right re the left overs! When I fired up the desktop to send you the code, even though I'd tried to compile 2/3 times before flagging the issue to you, I tried the whole thing again. Guess what, no errors not even the wifi.h multiple. The other thing I realised afterward, I didn't reboot Arduino after upgrading to 2.9.15. So I'm thoroughly embarrassed now, butt have at least learnt something from it. I'm attaching the code for completeness and who knows, the crudity of it might give people a laugh. Regards, Steve sinricPro_doorbell_vs20github.txt

sivar2311 commented 2 years ago

I am glad that the problem has been solved.

Thank you for providing your code - which actually does not compile for me, because of some missing declarations: sendUdpTelegram(), waitHere100ms and ssidToTelegram

In the comment block at the beginning i saw this:

/*
  FYI re websockets tmo issue:
  sinricProConfig.h contains the following:
     // WebSocket Configuration
      #define WEBSOCKET_PING_INTERVAL 300000
      #define WEBSOCKET_PING_TIMEOUT 10000
      #define WEBSOCKET_RETRY_COUNT 2
/*

Please do not modify the internal settings. I am nosey about the reason for this (even it is commented out).

sim404 commented 2 years ago

Actually those three declarations are there but below the references to them. Bad practice that I suppose and a reminder that I should move to platformio. The websocket defines are entirely historic and from when I first started using Sinric I had an issue getting sinric to stay connected. I’d forgotten they were still there and will delete. Actually there’s an old GitHub issue I raised on it. It turned out to be a rogue version of nodemcu board. I never normally mess with the *.h files for the reason you’re thinking… Many thanks for you time on the above.

sivar2311 commented 2 years ago

Thank you for the feedback :)

Just one, two notes: I saw you're setting flag in myConnected() and myDisconnected() callback. This is not necessary. You can make a call to SinricPro.isConnected() to check the connection state. It returns true if connected and false if not connected. You can still use the callback's for lighting an LED, or Serial output etc.

I also saw multiple calls to SinricPro.handle() in the main loop. This shouldn't be necessary (but it doesn't hurt ;)

sim404 commented 2 years ago

Sivar, thanks for the flag tip. I’ll make that change. Point taken re the belt&brace multiple handle calls.