Here is my code:
#include <WebSocketsServer.h>
#include <WebSocketsClient.h>
#include <WebSockets.h>
#include <ArduinoJson.h>
/*
* Simple example for how to use multiple SinricPro Switch device:
* - setup 4 switch devices
* - handle request using multiple callbacks
*
* If you encounter any issues:
* - check the readme.md at https://github.com/sinricpro/esp8266-es ... /README.md
* - ensure all dependent libraries are installed
* - see https://github.com/sinricpro/esp8266-es ... arduinoide
* - see https://github.com/sinricpro/esp8266-es ... pendencies
* - open serial monitor and check whats happening
* - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
*/
// Uncomment the following line to enable serial debug output
#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
#define DEBUG_ESP_PORT Serial
#define NODEBUG_WEBSOCKETS
#define NDEBUG
#endif
#include <Arduino.h>
#ifdef ESP8266
#include <ESP8266WiFi.h>
#endif
#include <WiFi.h>
#include "SinricPro.h"
#include "SinricProSwitch.h"
#define WIFI_SSID "Fios-76N3L"
#define WIFI_PASS "add7387kick2466nor"
#define APP_KEY "9d089287-6021-4397-9837-e748a6b2f632" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
#define APP_SECRET "594c537e-4966-424e-9c05-672aa8b8d1d3-fa605572-4cfe-41ef-8c97-961db9da51db" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
#define light1 "5ed118eb76b86a477f5e44ec" // Should look like "5dc1564130xxxxxxxxxxxxxx"
#define BAUD_RATE 57600// Change baudrate to your need
bool onPowerState1(const String &deviceId, bool &state) {
Serial.printf("Device 1 turned %s\r\n", state?"on":"off");
return true; // request handled properly
}
// setup function for WiFi connection
void setupWiFi() {
Serial.printf("\r\n[Wifi]: Connecting");
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
Serial.printf(".");
delay(250);
}
Serial.printf("connected!\r\n[WiFi]: IP-Address is %s\r\n", WiFi.localIP().toString().c_str());
}
// setup function for SinricPro
// setup SinricPro
SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
SinricPro.begin(APP_KEY, APP_SECRET);
}
// main setup function
void setup() {
Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupWiFi();
//setupSinricPro();
}
void loop() {
SinricPro.handle();
}
and here are the errors I keep getting:
'SinricPro' does not name a type
and
Error compiling for board WeMos D1 R2 & mini.
I could really use help thanks!