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
228 stars 121 forks source link

Incompatibility between the library ESP8266HTTPClient.h and SinricPro.h #269

Closed LinkIT3 closed 2 years ago

LinkIT3 commented 2 years ago

I'm trying to use the library ESP8266HTTPClient.h to send information to a web page but SinricPro cannot connect to the server. When I remove the ESP8266HTTPClient.h library SinricPro works again.

sivar2311 commented 2 years ago

Hi @LinkIT3!

Do you use a http connection (WiFiClient) or https connection (WiFiClientSecure) ?

LinkIT3 commented 2 years ago

I use an https connection with WiFiClientSecure

sivar2311 commented 2 years ago

Then the reason is found:

The ESP can unfortunately only handle one SSL/TLS encrypted connection at a time. SinricPro uses a persistent connection (by default SSL/TLS is enabled).

One possibility is to insert the line #define SINRICPRO_NOSSL before #include <SinricPro.h>. Then only a normal (not encrypted) connection is used.

May I ask the reason or the service you use?

LinkIT3 commented 2 years ago

I am using an ESP8266 to detect the temperature and humidity of a room and then send them to a database. Now I'm trying to get the measurements via google assistant.

sivar2311 commented 2 years ago

Okay, so the device is not to be controlled at all. Then there is another solution (But this requires more programming effort):

  1. measure temperature

  2. connect to SinricPro
  3. send temperature to SinricPro
  4. disconnect from SinricPro

  5. HTTPs connect to the database and send temperature
LinkIT3 commented 2 years ago

Using #define SINRICPRO_NOSSL works. Now I have another question, If I ask the google assistant about the temperature, he replies by saying "The air conditioning is set to one degree and the temperature is x degrees"; Is there a way to make me tell only the temperature? The device is registered as a temperature sensor.

sivar2311 commented 2 years ago

Unfortunately, Google Home does not natively support a temperature sensor, only a thermostat. If you create a SinricPro temperature sensor, a thermostat will be created on Google Home.

LinkIT3 commented 2 years ago

Ok, thanks for your help.