Comments (26)
Your problem is
master\src/SinricProWebsocket.h💯13: error: 'class WebSocketsClient' has no member named 'enableHeartbeat'
you should upgrade to latest version of arduinoWebSockets
https://github.com/Links2004/arduinoWebSockets
from esp8266-esp32-sdk.
Using library WebSockets at version 2.1.1 in folder: C:\Users\admin\Documents\Arduino\libraries\WebSockets
You're using wrong websocket library version.
You have to use at least WebSocketsClient 2.20
Please check Dependencies Section
from esp8266-esp32-sdk.
Thank you so much. I knew it was my system but it was so outdated I have not used it for this in over a year. I think Tommorow I will start clean and also switch to platform io. Thanks again.
from esp8266-esp32-sdk.
Starting Clean Worked Thank you. my IO and IDE where so out of date.
from esp8266-esp32-sdk.
Using library WebSockets at version 2.1.1 in folder: C:\Users\admin\Documents\Arduino\libraries\WebSockets
You're using wrong websocket library version.
You have to use at least WebSocketsClient 2.20
Please check Dependencies Section
Now that i am able to upload again. What i am looking for is a door unlock and lock without any reed switch or stops as i will be right there when it opens unlike the GarageDoor code you have there. I need it to open an hidden door / safe i have an Solenoid Electric Door Lock just need to dumb down the code for GarageDoor i guess but I have tried and get lots off errors. is there anyway you can put up an example code for such a thing. I really like to use pro and pay for it. I can even pay a little bit for the example code. thanks Craig C
from esp8266-esp32-sdk.
What you are looking for is a simple Lock.
Please have a look at our Lock example (it is in the dev branch but will merged into master with the next version).
You only have to change the onLockState callback to your need (controlling your lock device).
Meaning of the lockState
parameter in onLockState
:
lockState == false
unlock the door / door is unlocked
lockState == true
lock the door / door is locked
What kind of errors did you get?
from esp8266-esp32-sdk.
from esp8266-esp32-sdk.
Let's to this the other way around. What have you built right now and how is it connected to your ESP. And what ESP module do you use?
from esp8266-esp32-sdk.
Let's to this the other way around. What have you built right now and how is it connected to your ESP. And what ESP module do you use?
https://www.amazon.com/gp/product/B07HF44GBT/ref=ox_sc_saved_title_1?smid=A2K4DGCC72N9AG&psc=1
https://www.amazon.com/uxcell-Electromagnetic-Solenoid-Assembly-Electirc/dp/B07V7W3ZHB
I also have some wemo relays and also wemos d1 mini it don't matter all the same I know how to hook them up they all work fine with your SWITCH code and Sinric pro.
I like to set it up with the BLUE LED and pin d0 are used for the relay on the lock. Just like how your code for Switch is setup with the blue led. I would like the LED to turn BLUE when unlocked and OFF when locked. My setup is working fine but not with LOCK code I have it working with your Switch code but that is no good as i want Alexa to unlock my lock with pass code.
Hope this info helps.
Thanks So much!
from esp8266-esp32-sdk.
Ok, this is easy.
Just use D4
to control your relay / Solenoid (i am not sure about this because i never had one).
D4
is also connected to LED_BUILTIN
(that's the blue LED directly on the ESP chip.
This is defined in following sketch as LOCK_PIN
You may also use D0
which is connected to a secondary blue LED located on the NodeMCU board (known as LED_BUILTIN_AUX
)
So, just change LOCK_PIN
to the pin you want to use, put in your credentials and upload.
Should work right out of the box, with the behavior you want to have.
If not, please contact me via e-mail so we can get in touch using a direct messenger like "Telegram"
/*
* Example for how to use Lock device as garage door opener
*
* If you encounter any issues:
* - check the readme.md at https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md
* - ensure all dependent libraries are installed
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
* - 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
#ifdef ESP32
#include <WiFi.h>
#endif
#include "SinricPro.h"
#include "SinricProLock.h"
#define WIFI_SSID "YOUR_WIFI_SSID"
#define WIFI_PASS "YOUR_WIFI_PASSWORD"
#define APP_KEY "YOUR_APP_KEY_HERE" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
#define APP_SECRET "YOUR_APP_SECRET_HERE" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
#define LOCK_ID "YOUR_DEVICE_ID_HERE" // Should look like "5dc1564130xxxxxxxxxxxxxx"
#define BAUD_RATE 9600 // Change baudrate to your need
#define LOCK_PIN D4 // PIN which is used for lock / relay / whatever (D4 is also connected to LED_BUILTIN on NodeMCU)
bool onLockState(String deviceId, bool &lockState) {
Serial.printf("Device %s is %s\r\n", deviceId.c_str(), lockState?"locked":"unlocked");
digitalWrite(LOCK_PIN, lockState);
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() {
SinricProLock &myLock = SinricPro[LOCK_ID];
myLock.onLockState(onLockState);
// 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 setupPINs() {
pinMode(LOCK_PIN, OUTPUT);
}
void setup() {
Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupPINs();
setupWiFi();
setupSinricPro();
}
void loop() {
SinricPro.handle();
}
from esp8266-esp32-sdk.
Getting there Have an error I do not think it will be a good if I touch it. does this help
"
bool onLockState(String deviceId, bool &lockState) {
Serial.printf("Device %s is %s\r\n", deviceId.c_str(), lockState?"locked":"unlocked");
digitalWrite(LOCK_PIN, state);
return true;
}
"
C:\Users\admin\Documents\Arduino\NEW_NEW_LOCK\NEW_NEW_LOCK.ino: In function 'bool onLockState(String, bool&)':
NEW_NEW_LOCK:34:26: error: 'state' was not declared in this scope
digitalWrite(LOCK_PIN, state);
^
Multiple libraries were found for "ESP8266WiFi.h"
Used: C:\Users\admin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi
Multiple libraries were found for "SinricPro.h"
Used: C:\Users\admin\Documents\Arduino\libraries\esp8266-esp32-sdk-master
Multiple libraries were found for "ArduinoJson.h"
Used: C:\Users\admin\Documents\Arduino\libraries\ArduinoJson
Multiple libraries were found for "WebSocketsClient.h"
Used: C:\Users\admin\Documents\Arduino\libraries\arduinoWebSockets-master
Multiple libraries were found for "Hash.h"
Used: C:\Users\admin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\Hash
exit status 1
'state' was not declared in this scope
from esp8266-esp32-sdk.
Sorry, there was a small typo. The Code is now updated and compiling.
from esp8266-esp32-sdk.
Works Great Thank you!!! I was so close I was putting HIGH and LOW in there lol. Thank you this hidden box remote lock should turn out great.
You should add this code to your examples for sure as with the WEMOS and there relay with a little tweak to the code as it on D1 on the wemo relay. you can have a relay small lock setup with a small eclectic lock.
Where can i find your paypal address ? I would love to send you a little something for all the help.
from esp8266-esp32-sdk.
Best support would be to buy a SinricPro device
from esp8266-esp32-sdk.
Best support would be to buy a SinricPro device
DONE Thank you!
from esp8266-esp32-sdk.
sorry I'm not very practical, I can't find the websockets 2.2.0 library to use sinric pro with esp32
from esp8266-esp32-sdk.
Link is in readme: https://github.com/sinricpro/esp8266-esp32-sdk#dependencies
from esp8266-esp32-sdk.
thanks for the answer but I can't find where to download it, I have read the link several times but nothing. Is there a version of the library in zip format?
from esp8266-esp32-sdk.
Just use the latest Version of WebSockets form Markus Sattler...there is a difference in GIT TAG version and real version.
You can use PIO LIbrary Manager or IDE Library Manager to install
from esp8266-esp32-sdk.
I tried to download the file 2.2.0 and added to the libraries, I used a d1 mini and it gives me this:
Arduino: 1.8.12 (Windows 8.1), Board: "WeMos D1 R1, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS: 2MB OTA: ~ 1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600 "
In file included from C: \ Users \ wilson \ Documents \ Arduino \ sketch_mar23g \ sketch_mar23g.ino: 1: 0:
C: \ Users \ wilson \ Documents \ Arduino \ libraries \ WebSockets_2.2.0_549 \ src / SocketIOclient.h: 38: 51: error: expected class-name before '{' token
class SocketIOclient: protected WebSocketsClient {
^
More than one library found for "SocketIOclient.h"
Used: C: \ Users \ wilson \ Documents \ Arduino \ libraries \ WebSockets_2.2.0_549
Not used: C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1.4
exit status 1
Error during compilation for the WeMos D1 R1 card.
This report may be richer in information by enabling the option
"Show detailed output during compilation"
in "File -> Settings
from esp8266-esp32-sdk.
More than one library found for "SocketIOclient.h"
Uninstall all websockets library and reinstall just one
from esp8266-esp32-sdk.
good evening, I uninstalled all the websockets libraries, downloaded the Markus Sattler library, I zipped it and added it to the library and it gives me this error message: Arduino: 1.8.12 (Windows 8.1), Board: "WeMos D1 R1, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS: 2MB OTA: ~ 1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600 "
In file included from C: \ Users \ wilson \ Documents \ Arduino \ sketch_mar23f \ sketch_mar23f.ino: 36: 0:
C: \ Users \ wilson \ Documents \ Arduino \ libraries \ SinricPro \ src / SinricPro.h: 13: 32: fatal error: SinricProWebsocket.h: No such file or directory
#include "SinricProWebsocket.h"
^
compilation terminated.
exit status 1
Error during compilation for the WeMos D1 R1 card.
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets \ src
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1.4: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1. 4 \ src
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets \ src
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1.4: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1. 4 \ src
This report may be richer in information by enabling the option
"Show detailed output during compilation"
in "File -> Settings
from esp8266-esp32-sdk.
Please share your code for analyzing
from esp8266-esp32-sdk.
Arduino: 1.8.12 (Windows 8.1), Board: "WeMos D1 R1, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS: 2MB OTA: ~ 1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600 "
In file included from C: \ Users \ wilson \ Documents \ Arduino \ sketch_mar23f \ sketch_mar23f.ino: 36: 0:
C: \ Users \ wilson \ Documents \ Arduino \ libraries \ SinricPro \ src / SinricPro.h: 13: 32: fatal error: SinricProWebsocket.h: No such file or directory
#include "SinricProWebsocket.h"
^
compilation terminated.
exit status 1
Error during compilation for the WeMos D1 R1 card.
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets \ src
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1.4: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1. 4 \ src
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ ArduinoWebsockets \ src
Invalid library found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1.4: No header file (.h) found in C: \ Users \ wilson \ Documents \ Arduino \ libraries \ arduinoWebSockets-2.1. 4 \ src
This report may be richer in information by enabling the option
"Show detailed output during compilation"
in "File -> Settings
from esp8266-esp32-sdk.
Again: Please upload your code, for analyze.
from esp8266-esp32-sdk.
Sivar2311,
thank you for your time and your patience, I have uninstalled everything and reinstalled the bookcases and now it's ok, I can't wait to try.
from esp8266-esp32-sdk.
Related Issues (20)
- Emulating a momentary switch with Sinric Pro HOT 2
- I'm stuck coding for multiple devices. (ESP8266) HOT 10
- missing capability on AC Unit HOT 3
- Manual Push switch not working when disconnected from internet. HOT 8
- Connection rest by peer HOT 12
- Compilation error: invalid user-defined conversion from 'SINRICPRO_3_0_1::SinricProClass::Proxy' to 'SinricProDoorbell&&' {aka 'SINRICPRO_3_0_1::SinricProDoorbell&&'} [-fpermissive] HOT 5
- Error compiling code - probably upon recent update to ArduinoJSON HOT 2
- sinric app somtimes unresponsive app and serial different values HOT 27
- Sinric Pro With ESP8266 and OLED SSD1306 Display HOT 5
- Enable and Disable A4988 stepper driver with ESP8266 digital pin HOT 3
- Issues with Sending Sensor Data to Sinric Pro from ESP32 HOT 3
- Error compiling code - vtable undefined HOT 14
- OTA with non-local network HOT 4
- Temperature Sensor Type and Alexa HOT 3
- Arduino uno r4 wifi HOT 4
- Adding device through the app HOT 3
- Button to turn on a RGB strip light HOT 2
- AC Unit HOT 7
- help dear HOT 2
- Switch state change time out. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-esp32-sdk.