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 122 forks source link

"OK" response but nothing works #230

Closed matteoferl closed 2 years ago

matteoferl commented 2 years ago

Hi, I've recently buyed an ESP8266-12F and i've tried to use this library but it doesn't work anymore. Previously i've made an IOT device whithout any problems (ESP-01), but now after create a device and flashed code by Arduino IDE when i try to set switch on or off Sinric Pro responds me OK with red background and nothing happens. I've tried with my new ESP8266-12F and my old ESP-01 (i'm sure that it works).

Anyone can help me?

kakopappa commented 2 years ago
  1. Have you enabled the logs in the sdk and observed the commands coming in and responses ? https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/examples/Switch/Switch/Switch.ino#L18

  2. Try opening the portal in a incognito mode

  3. Have you seen any errors in the activity log?

sivar2311 commented 2 years ago

The color red means there is some kind of error. Unfortunately, there is too little information for an error analysis. Which sketch do you use? Does the error occur with one of the examples? Are the credentials correct?

matteoferl commented 2 years ago

@sivar2311 I use the example sketch of Switch, the credentials are all ok. An additional information is that when i press on the "physical" button data are sends to sinric (eg. "Switch is now on/off"). only the reverse comunication is broken. I don't if any libraries are in conflicts. i'm unistalling and reinstall ide and libraries right now

sivar2311 commented 2 years ago

Ok. After your reinstall, enable and check serial logs please

matteoferl commented 2 years ago

Ok, i've reinstalled and re flashed the code enabling debug. that's the result `platform:ESP8266 version:2.9.10

Connected to SinricPro SinricPro:Websocket: receiving data [SinricPro.handleReceiveQueue()]: 1 message(s) in receiveQueue [SinricPro.handleReceiveQueue()]: Signature is valid. Processing message... [SinricPro:extractTimestamp(): Got Timestamp 1637685760 `

Same problem on click On or Off and nothing printed on console

sivar2311 commented 2 years ago

pleasy verify app key (does it match with the app key selected in portal?)

matteoferl commented 2 years ago

@sivar2311 I've not readed the first 3 lines, it says Device "xxxxxxxxxx" does not exists. creating new device. but the device exists, i've copyed all keys from the portal

sivar2311 commented 2 years ago

"...does not exist" on the ESP's side. So the device will be created. - That's ok

Do you have multiple app key/secret pairs? If yes, check if the correct pair is assigned to the device in portal.

kakopappa commented 2 years ago

I did a quick test. Used switch sketch

image

When turning on/off from the portal it reacts correctly.

on-off

Make sure your browser cache is cleared. Portal version is (v2.20.1).

matteoferl commented 2 years ago

No, in the credentials section I've only one row that contains the only one pairs of app/secret keys

kakopappa commented 2 years ago

Make sure your onPowerState function returns true

bool onPowerState(const String &deviceId, bool &state) {
  return true; // <---
}

https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/examples/Switch/Switch/Switch.ino#L67

matteoferl commented 2 years ago

@kakopappa i've checked that the portal version is right and the returns true is there. nothing to do

matteoferl commented 2 years ago

@kakopappa @sivar2311 I've solved creating a new application (new app key and new secret) and creating new device on that application. Now works fine but i don't know why.

sivar2311 commented 2 years ago

Glad that it works now. Then my guess with the access data was (almost) correct. Unfortunately, I can not determine the cause.

matteoferl commented 2 years ago

@sivar2311 @kakopappa Thanks a lot anyway