Skip to content

SinricPro does not report lost connection in a timely manner #348

@lilbuzz

Description

@lilbuzz

Using WEMO MINI Esp32. Connected to SinricPro server using cell phone hotspot. I disable the hotspot, but calls to SinricPro.isConnected() continue to return true. This is true for more than 10 minutes. I am calling SinricPro.handle() in my loop, and then polling SinricPro.isConnected().

Here is some sample debug output:

2023-11-12 16:52:29 --> ets Jul 29 2019 12:21:46
2023-11-12 16:52:29 -->
2023-11-12 16:52:29 --> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOO
2023-11-12 16:52:29 --> T)
2023-11-12 16:52:29 --> configsip: 0, SPIWP:0xee
2023-11-12 16:52:29 --> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
2023-11-12 16:52:29 --> mode:DIO, clock div:1
2023-11-12 16:52:29 --> load:0x3fff0030,len:1184
2023-11-12 16:52:29 --> load:0x40078000,len:13260
2023-11-12 16:52:29 --> load:0x40080400,len:3028
2023-11-12 16:52:29 --> entry 0x400805e4
2023-11-12 16:52:31 -->
2023-11-12 16:52:31 --> BOOT
2023-11-12 16:52:31 -->
2023-11-12 16:52:31 -->
2023-11-12 16:52:31 --> WiFi status before connect attempt: 6, WL_DISCONNECTED
2023-11-12 16:52:31 --> Disconnecting WiFi... Attempts: 0
2023-11-12 16:52:31 --> WiFi status after disconnect: 6, WL_DISCONNECTED
2023-11-12 16:52:31 --> Calling WiFi reconnect
2023-11-12 16:52:31 --> Setting Cert for Telegram app
2023-11-12 16:52:31 --> Connecting to WiFi...
2023-11-12 16:52:32 --> .
2023-11-12 16:52:32 --> .
2023-11-12 16:52:32 --> .
2023-11-12 16:52:32 --> . Attempts: 5
2023-11-12 16:52:32 --> Connected to the WiFi network.
2023-11-12 16:52:32 --> WiFi status: 3,
2023-11-12 16:52:33 --> WL_CONNECTED
2023-11-12 16:52:33 --> [SinricPro]: Device "xxxx" does not exist. Creating new device
2023-11-12 16:52:33 --> [SinricPro:add()]: Adding device with id "xxxx".
2023-11-12 16:52:33 --> 2023-11-12T17:52:22Z
2023-11-12 16:52:33 --> In central standard time.
2023-11-12 16:52:33 --> Finished setup.
2023-11-12 16:52:33 --> [SinricPro:Websocket]: Connecting to WebSocket Server using SSL (ws.sinric.pro)
2023-11-12 16:52:33 --> [SinricPro:Websocket]: headers:
2023-11-12 16:52:33 --> appkey:xxxx
2023-11-12 16:52:33 --> deviceids:xxxx
2023-11-12 16:52:33 --> restoredevicestates:false
2023-11-12 16:52:33 -->
2023-11-12 16:52:33 --> ip:192.168.57.246
2023-11-12 16:52:33 --> mac:C8:F0:9E:F1:4F:60
2023-11-12 16:52:33 --> platform:ESP32
2023-11-12 16:52:33 --> SDKVersion:3.0.0
2023-11-12 16:52:36 --> [SinricPro:Websocket]: connected
2023-11-12 16:52:36 --> Connected to SinricPro
2023-11-12 16:52:36 --> Freezer door contact sensor state is closed now.
2023-11-12 16:52:36 --> [SinricPro:sendMessage()]: pushing message into sendQueue
2023-11-12 16:52:36 --> SinricPro is connected.
2023-11-12 16:52:36 --> [SinricPro:Websocket]: receiving data
2023-11-12 16:52:36 --> [SinricPro.handleReceiveQueue()]: 1 message(s) in receiveQueue
2023-11-12 16:52:36 --> [SinricPro.handleReceiveQueue()]: Signature is valid. Processing message...
2023-11-12 16:52:36 --> [SinricPro:extractTimestamp(): Got Timestamp 1699829545
2023-11-12 16:52:36 --> [SinricPro:handleSendQueue()]: 1 message(s) in sendQueue
2023-11-12 16:52:36 --> [SinricPro:handleSendQueue()]: Sending message...
2023-11-12 16:52:36 --> {
2023-11-12 16:52:36 --> "header": {
2023-11-12 16:52:36 --> "payloadVersion": 2,
2023-11-12 16:52:36 --> "signatureVersion": 1
2023-11-12 16:52:36 --> },
2023-11-12 16:52:36 --> "payload": {
2023-11-12 16:52:36 --> "action": "setContactState",
2023-11-12 16:52:36 --> "cause": {
2023-11-12 16:52:36 --> "type": "PHYSICAL_INTERACTION"
2023-11-12 16:52:36 --> },
2023-11-12 16:52:36 --> "createdAt": 1699829545,
2023-11-12 16:52:36 --> "deviceId": "xxxx",
2023-11-12 16:52:36 --> "replyToken": "xxxx",
2023-11-12 16:52:36 --> "type": "event",
2023-11-12 16:52:36 --> "value": {
2023-11-12 16:52:36 --> "state": "closed"
2023-11-12 16:52:36 --> }
2023-11-12 16:52:36 --> },
2023-11-12 16:52:36 --> "signature": {
2023-11-12 16:52:36 --> "HMAC": "xxxx"
2023-11-12 16:52:36 --> }
2023-11-12 16:52:36 --> }
2023-11-12 16:52:36 --> [SinricPro:handleSendQueue]: Sending to websocket
2023-11-12 16:52:36 --> [SinricPro:handleSendQueue()]: message sent.
2023-11-12 16:52:59 --> [SinricPro:Websocket]: disconnected
2023-11-12 16:52:59 --> Disconnected from SinricPro
2023-11-12 16:52:59 --> SinricPro is disconnected.
2023-11-12 16:53:02 --> [SinricPro:Websocket]: connected
2023-11-12 16:53:02 --> Connected to SinricPro
2023-11-12 16:53:02 --> SinricPro is connected.
2023-11-12 16:53:02 --> [SinricPro:Websocket]: receiving data
2023-11-12 16:53:02 --> [SinricPro.handleReceiveQueue()]: 1 message(s) in receiveQueue
2023-11-12 16:53:02 --> [SinricPro.handleReceiveQueue()]: Signature is valid. Processing message...
2023-11-12 16:53:02 --> [SinricPro:extractTimestamp(): Got Timestamp 1699829571

2023-11-12 16:56:47 --> [SinricPro:Websocket]: disconnected
2023-11-12 16:56:47 --> Disconnected from SinricPro
2023-11-12 16:56:47 --> SinricPro is disconnected.
2023-11-12 16:56:49 --> [SinricPro:Websocket]: connected
2023-11-12 16:56:49 --> Connected to SinricPro
2023-11-12 16:56:49 --> SinricPro is connected.
2023-11-12 16:56:49 --> [SinricPro:Websocket]: receiving data
2023-11-12 16:56:49 --> [SinricPro.handleReceiveQueue()]: 1 message(s) in receiveQueue
2023-11-12 16:56:49 --> [SinricPro.handleReceiveQueue()]: Signature is valid. Processing message...
2023-11-12 16:56:49 --> [SinricPro:extractTimestamp(): Got Timestamp 1699829798

I have tested this with delays over 10 minutes, but the call to isConnected still returns true until the hotspot is re-enabled.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixedBug has been fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions