-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only one out of three devices is online #241
Comments
It’s likely your device IDs are not set up correctly in the sketch. Can you
share the code without secrets?
…On Tue, 11 Jan 2022 at 6:34 AM nader54 ***@***.***> wrote:
[image: Screen Shot 2022-01-10 at 3 31 38 PM]
<https://user-images.githubusercontent.com/3778135/148855172-c3175a88-3458-40ad-a8d0-a0ef1357243c.png>
—
Reply to this email directly, view it on GitHub
<https://github.com/sinricpro/help-docs/issues/14#issuecomment-1009457529>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZAZZUE6VUWJH5GYG3UTMLUVNUHNANCNFSM5LU4X7RA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@nader54 here's the fixed code. You have to add multiple devices, if you add a single device, only single device is online
|
Thanks so much!
Have a great day!
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Aruna Tennakoon ***@***.***>
Sent: Tuesday, January 11, 2022 3:57:58 AM
To: sinricpro/esp8266-esp32-sdk ***@***.***>
Cc: nader54 ***@***.***>; Author ***@***.***>
Subject: Re: [sinricpro/esp8266-esp32-sdk] Sinricpro dashboard showing only one out of three devices is online. I have deleted and created three device ten times, still only one is online. (Issue #241)
// 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
#ifdef ESP32
#include <WiFi.h>
#endif
#include "SinricPro.h"
#include "SinricProGarageDoor.h"
#define WIFI_SSID ""
#define WIFI_PASS ""
#define APP_KEY ""
#define APP_SECRET ""
#define GARAGEDOOR_ID1 "" // Toyota Garage
#define GARAGEDOOR_ID2 "" // BMW Garage
#define GARAGEDOOR_ID3 "" // Lamborghini Garage
#define BAUD_RATE 9600 // Change baudrate to your need
bool onDoorState(const String& deviceId, bool &doorState) {
Serial.printf("Garagedoor is %s now.\r\n", doorState?"closed":"open");
return true;
}
void setupWiFi() {
Serial.printf("\r\n[Wifi]: Connecting");
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
Serial.printf(".");
delay(250);
}
IPAddress localIP = WiFi.localIP();
Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
}
void setupSinricPro() {
SinricProGarageDoor &myGarageDoor1 = SinricPro[GARAGEDOOR_ID1];
myGarageDoor1.onDoorState(onDoorState);
SinricProGarageDoor &myGarageDoor2 = SinricPro[GARAGEDOOR_ID2];
myGarageDoor2.onDoorState(onDoorState);
SinricProGarageDoor &myGarageDoor3 = SinricPro[GARAGEDOOR_ID3];
myGarageDoor3.onDoorState(onDoorState);
// 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);
}
void setup() {
Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupWiFi();
setupSinricPro();
}
void loop() {
SinricPro.handle();
}
—
Reply to this email directly, view it on GitHub<#241 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA42MV4RLD63C7DFNDCUXS3UVQLMNANCNFSM5LWDT27Q>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi Aruna,
All my three garage doors are online, but only one is working (Toyota Garage), when I click the open or close button on the other garage doors, the dashboard shows(Waiting) sign.[Graphical user interface, application Description automatically generated]
Could you please help me?
Thanks,
Nader Arvanaghi
From: Aruna Tennakoon ***@***.***>
Date: Tuesday, January 11, 2022 at 3:57 AM
To: sinricpro/esp8266-esp32-sdk ***@***.***>
Cc: nader54 ***@***.***>, Author ***@***.***>
Subject: Re: [sinricpro/esp8266-esp32-sdk] Sinricpro dashboard showing only one out of three devices is online. I have deleted and created three device ten times, still only one is online. (Issue #241)
// 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
#ifdef ESP32
#include <WiFi.h>
#endif
#include "SinricPro.h"
#include "SinricProGarageDoor.h"
#define WIFI_SSID ""
#define WIFI_PASS ""
#define APP_KEY ""
#define APP_SECRET ""
#define GARAGEDOOR_ID1 "" // Toyota Garage
#define GARAGEDOOR_ID2 "" // BMW Garage
#define GARAGEDOOR_ID3 "" // Lamborghini Garage
#define BAUD_RATE 9600 // Change baudrate to your need
bool onDoorState(const String& deviceId, bool &doorState) {
Serial.printf("Garagedoor is %s now.\r\n", doorState?"closed":"open");
return true;
}
void setupWiFi() {
Serial.printf("\r\n[Wifi]: Connecting");
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
Serial.printf(".");
delay(250);
}
IPAddress localIP = WiFi.localIP();
Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
}
void setupSinricPro() {
SinricProGarageDoor &myGarageDoor1 = SinricPro[GARAGEDOOR_ID1];
myGarageDoor1.onDoorState(onDoorState);
SinricProGarageDoor &myGarageDoor2 = SinricPro[GARAGEDOOR_ID2];
myGarageDoor2.onDoorState(onDoorState);
SinricProGarageDoor &myGarageDoor3 = SinricPro[GARAGEDOOR_ID3];
myGarageDoor3.onDoorState(onDoorState);
// 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);
}
void setup() {
Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupWiFi();
setupSinricPro();
}
void loop() {
SinricPro.handle();
}
—
Reply to this email directly, view it on GitHub<#241 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA42MV4RLD63C7DFNDCUXS3UVQLMNANCNFSM5LWDT27Q>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi @nader54! It sounds like your devices are assigned to different AppKey / AppSecret pair. Only use different AppKey / AppSecret pairs if your (logical) devices are running on different ESP modules (physical devices). |
Hi,
I have one AppKey , one AppSecret, and three device id, one for each garage. I rebuilt everything fresh, and now every button I press, it opens the same garage door. Even with alexa is doing the same thing.
Please see my code.
Best regards,
Nader Arvanaghi
From: Boris Jäger ***@***.***>
Date: Tuesday, January 11, 2022 at 8:35 PM
To: sinricpro/esp8266-esp32-sdk ***@***.***>
Cc: nader54 ***@***.***>, Mention ***@***.***>
Subject: Re: [sinricpro/esp8266-esp32-sdk] Only one out of three devices is online (Issue #241)
Hi @nader54<https://github.com/nader54>!
It sounds like your devices are assigned to different AppKey / AppSecret pair.
If you're running mulitple devices on the same ESP module all devices must assigned and use the same AppKey / AppSecret.
Please check in devices tab (dashboard) that all your devices (which are running on the same ESP module) assigned to the correct AppKey.
Only use different AppKey / AppSecret pairs if your (logical) devices are running on different ESP modules (physical devices).
—
Reply to this email directly, view it on GitHub<#241 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA42MV2RRILN7JI532PJF6TUVUAINANCNFSM5LWDT27Q>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Your current sketch is missing. The latest code i can see is the one Aruna posted. You have two options
bool onDoorState1(const String& deviceId, bool& state) {
// do whatever when door 1 state changes
return true;
}
bool onDoorState2(const String& deviceId, bool& state) {
// do whatever when door 2 state changes
return true;
}
bool onDoorState3(const String& deviceId, bool& state) {
// do whatever when door 3 state changes
return true;
}
void setupSinricPro() {
...
SinricProGarageDoor &myGarageDoor1 = SinricPro[GARAGEDOOR_ID1];
myGarageDoor1.onDoorState(onDoorState1);
SinricProGarageDoor &myGarageDoor2 = SinricPro[GARAGEDOOR_ID2];
myGarageDoor2.onDoorState(onDoorState2);
SinricProGarageDoor &myGarageDoor3 = SinricPro[GARAGEDOOR_ID3];
myGarageDoor3.onDoorState(onDoorState3);
...
}
bool onDoorState(const String& deviceId, bool& state) {
if (deviceId == GARAGEDOOR_ID1 {
// do whatever when door 1 state changes
return true;
}
if (deviceId == GARAGEDOOR_ID2 {
// do whatever when door 1 state changes
return true;
}
if (deviceId == GARAGEDOOR_ID3 {
// do whatever when door 1 state changes
return true;
}
return false; // none of the deviceId's matched -> error!
}
void setupSinricPro() {
...
SinricProGarageDoor &myGarageDoor1 = SinricPro[GARAGEDOOR_ID1];
myGarageDoor1.onDoorState(onDoorState);
SinricProGarageDoor &myGarageDoor2 = SinricPro[GARAGEDOOR_ID2];
myGarageDoor2.onDoorState(onDoorState);
SinricProGarageDoor &myGarageDoor3 = SinricPro[GARAGEDOOR_ID3];
myGarageDoor3.onDoorState(onDoorState);
...
} Updatet: fixed copy & paste bug in option2 |
Sorry, i had a copy & paste bug in option 2. |
Hi. Alexa_Garage_New_Code:68:6: error: ambiguating new declaration of 'void onDoorState(const String&, bool&)' |
Both options are giving me an error. Alexa_Garage_New_Code:68:6: error: ambiguating new declaration of 'void onDoorState(const String&, bool&)' |
Have a closer look at the numbers behind the functions! There are 3 different functions in option 1: bool onDoorState1(... You cannot have 3 functions with the same name like |
// 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
#ifdef ESP32
#include <WiFi.h>
#endif
#include "SinricPro.h"
#include "SinricProGarageDoor.h"
#define WIFI_SSID ""
#define WIFI_PASS ""
#define APP_KEY ""
#define APP_SECRET ""
#define GARAGEDOOR_ID1 "" // Toyota Garage
#define GARAGEDOOR_ID2 "" // BMW Garage
#define GARAGEDOOR_ID3 "" // Lamborghini Garage
#define BAUD_RATE 9600 // Change baudrate to your need
bool onDoorState1(const String& deviceId, bool& state) {
// do whatever when door 1 state changes
return true;
}
bool onDoorState2(const String& deviceId, bool& state) {
// do whatever when door 2 state changes
return true;
}
bool onDoorState3(const String& deviceId, bool& state) {
// do whatever when door 3 state changes
return true;
}
void setupWiFi() {
Serial.print("[WiFi]: Connecting");
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(250);
}
Serial.println("connected!");
Serial.printf("[WiFi]: IP-Address is %s\r\n", WiFi.localIP().toString().c_str());
}
void setupSinricPro() {
SinricProGarageDoor& myGarageDoor1 = SinricPro[GARAGEDOOR_ID1];
myGarageDoor1.onDoorState(onDoorState1);
SinricProGarageDoor &myGarageDoor2 = SinricPro[GARAGEDOOR_ID2];
myGarageDoor2.onDoorState(onDoorState2);
SinricProGarageDoor &myGarageDoor3 = SinricPro[GARAGEDOOR_ID3];
myGarageDoor3.onDoorState(onDoorState3);
// 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);
}
void setup() {
Serial.begin(BAUD_RATE);
Serial.println();
setupWiFi();
setupSinricPro();
}
void loop() {
SinricPro.handle();
} |
I tested your code this morning and I got these error messages |
The return type of the callback functions must be Here is the correct sketch: // 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
#ifdef ESP32
#include <WiFi.h>
#endif
#include "SinricPro.h"
#include "SinricProGarageDoor.h"
#define WIFI_SSID ""
#define WIFI_PASS ""
#define APP_KEY ""
#define APP_SECRET ""
#define GARAGEDOOR_ID1 "" // Toyota Garage
#define GARAGEDOOR_ID2 "" // BMW Garage
#define GARAGEDOOR_ID3 "" // Lamborghini Garage
#define BAUD_RATE 9600 // Change baudrate to your need
bool onDoorState1(const String& deviceId, bool& state) {
// do whatever when door 1 state changes
return true;
}
bool onDoorState2(const String& deviceId, bool& state) {
// do whatever when door 2 state changes
return true;
}
bool onDoorState3(const String& deviceId, bool& state) {
// do whatever when door 3 state changes
return true;
}
void setupWiFi() {
Serial.print("[WiFi]: Connecting");
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(250);
}
Serial.println("connected!");
Serial.printf("[WiFi]: IP-Address is %s\r\n", WiFi.localIP().toString().c_str());
}
void setupSinricPro() {
SinricProGarageDoor& myGarageDoor1 = SinricPro[GARAGEDOOR_ID1];
myGarageDoor1.onDoorState(onDoorState1);
SinricProGarageDoor &myGarageDoor2 = SinricPro[GARAGEDOOR_ID2];
myGarageDoor2.onDoorState(onDoorState2);
SinricProGarageDoor &myGarageDoor3 = SinricPro[GARAGEDOOR_ID3];
myGarageDoor3.onDoorState(onDoorState3);
// 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);
}
void setup() {
Serial.begin(BAUD_RATE);
Serial.println();
setupWiFi();
setupSinricPro();
}
void loop() {
SinricPro.handle();
} Please not that this sketch has no function. |
it only work for myGarageDoor2, when I press other buttons nothing happens and i get this on my Serial monitor: load 0x4010f000, len 3460, room 16 WiFi: IP-Address is 10.0.1.6 |
I figuer it out!!! |
Sinricpro dashboard showing only one out of three devices is online. I have deleted and created three device ten times, still only one is online Screen Shot 2022-01-10 at 3.31.38 PM.png
The text was updated successfully, but these errors were encountered: