Open bckslyr2003 opened 3 years ago
This ip is not blocked. Are you using Sinric.com or Sinric.pro?
Sinric pro website .so I guess I need to change url?
This sketch doesn't work on pro.
You have to use the Sinric Pro SDK in Sinric Pro to connect your ESP devices https://github.com/sinricpro/esp8266-esp32-sdk
Use an example and modify the sample code https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples
On Tue, Dec 8, 2020 at 12:17 PM bckslyr2003 notifications@github.com wrote:
Sinric pro website .so I guess I need to change url?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kakopappa/sinric/issues/459#issuecomment-740381757, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZAZZRVJI3KL4QVRVHGWADSTWZHPANCNFSM4URF5M7A .
with the new examples this is all i get from my board lol ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d vac02aff5 ~ld
@bckslyr2003 try updating the ESP Core version
that worked thankyou
hello i keep getting this error can you check if my public i.p is blocked ? says its offline at sinric pro 23.105.163.103 Waiting for commands from sinric.com ... [WSc] Webservice disconnected from sinric.com! [WSc] Service connected to sinric.com at url: / Waiting for commands from sinric.com ...
/ Version 0.1 - Feb 10 2018 /
include
include
include
include // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries
include // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries
ESP8266WiFiMulti WiFiMulti; WebSocketsClient webSocket; WiFiClient client;
define MyApiKey "3e73aa72---****-21a4c4fa40ee" // TODO: Change to your sinric API Key. Your API Key is displayed on sinric.com dashboard
define MySSID "**" // TODO: Change to your Wifi network SSID
define MyWifiPassword "*****" // TODO: Change to your Wifi network password
define API_ENDPOINT "http://sinric.com"
define HEARTBEAT_INTERVAL 300000 // 5 Minutes
uint64_t heartbeatTimestamp = 0; bool isConnected = false;
void turnOn(String deviceId) { if (deviceId == "5axxxxxxxxxxxxxxxxxxx") // Device ID of first device {
Serial.print("Turn on device id: "); Serial.println(deviceId);
} else if (deviceId == "5axxxxxxxxxxxxxxxxxxx") // Device ID of second device { Serial.print("Turn on device id: "); Serial.println(deviceId); } else { Serial.print("Turn on for unknown device id: "); Serial.println(deviceId);
}
}
void turnOff(String deviceId) { if (deviceId == "5axxxxxxxxxxxxxxxxxxx") // Device ID of first device {
Serial.print("Turn off Device ID: "); Serial.println(deviceId);
} else if (deviceId == "5axxxxxxxxxxxxxxxxxxx") // Device ID of second device { Serial.print("Turn off Device ID: "); Serial.println(deviceId); } else { Serial.print("Turn off for unknown device id: "); Serial.println(deviceId);
} }
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { switch(type) { case WStype_DISCONNECTED: isConnected = false;
Serial.printf("[WSc] Webservice disconnected from sinric.com!\n"); break; case WStype_CONNECTED: { isConnected = true; Serial.printf("[WSc] Service connected to sinric.com at url: %s\n", payload); Serial.printf("Waiting for commands from sinric.com ...\n");
} break; case WStype_TEXT: { Serial.printf("[WSc] get text: %s\n", payload); // Example payloads
if ARDUINOJSON_VERSION_MAJOR == 5
endif
if ARDUINOJSON_VERSION_MAJOR == 6
endif
} }
void setup() { Serial.begin(115200);
WiFiMulti.addAP(MySSID, MyWifiPassword); Serial.println(); Serial.print("Connecting to Wifi: "); Serial.println(MySSID);
// Waiting for Wifi connect while(WiFiMulti.run() != WL_CONNECTED) { delay(500); Serial.print("."); } if(WiFiMulti.run() == WL_CONNECTED) { Serial.println(""); Serial.print("WiFi connected. "); Serial.print("IP address: "); Serial.println(WiFi.localIP()); }
// server address, port and URL webSocket.begin("iot.sinric.com", 80, "/");
// event handler webSocket.onEvent(webSocketEvent); webSocket.setAuthorization("apikey", MyApiKey);
// try again every 5000ms if connection has failed webSocket.setReconnectInterval(5000); // If you see 'class WebSocketsClient' has no member named 'setReconnectInterval' error update arduinoWebSockets }
void loop() { webSocket.loop();
if(isConnected) { uint64_t now = millis();
}
}