Comments (14)
From this
#define relayswitch 7
You can't use GPIO7 because it uses as MISO of SPI bus that connect with Flash memory. Your device can't run and program because no data to/from flash memory.
For query, you must and always assign orderBy as states in Firebase document, like this.
QueryFilter query;
query.orderBy("id");
query.equalTo("esp.2615");
query.limitToLast(1);
You may get error like this return from server.
connection refused, Index not defined, add ".indexOn": "id", for path "/arushpass/cool/chill", to the rules
You also set the database rules like this by use wild card $ to any dynamic child keys of user_key which can be room1, room2,... and their child key $device. The name that use with $ can by any what you want.
"rules": {
...
...
,
"user_key":{
"$room":{
"$device":{
".indexOn":"id"
}
}
}
}
or use only one wild card $ to refer to any child keys under user_key included room1, room2, device_name and so on.
"rules": {
...
...
,
"user_key":{
"$device":{
".indexOn":"id"
}
}
}
from firebase-esp8266.
Thanks for the quick reply
You also set the database rules like this by use wild card $ to any dynamic child keys of user_key which can be room1, room2,... and their child key $device. The name that use with $ can by any what you want.
"rules": { ... ... , "user_key":{ "$room":{ "$device":{ ".indexOn":"id" } } } }or use only one wild card $ to refer to any child keys under user_key included room1, room2, device_name and so on.
"rules": { ... ... , "user_key":{ "$device":{ ".indexOn":"id" } } }
My user_key, device, room can be changed or deleted so do I have to edit the rules every time it is deleted or updated ?
from firebase-esp8266.
Yes but it better to have permanent parent key.
from firebase-esp8266.
Oh
So can I set my rules like this:
"rules" : { .... .... .... , ".indexOn": "id" }
from firebase-esp8266.
This means id is the parent key at the root of database and sort or select is no effect, indexOn should set to childs.
from firebase-esp8266.
Thanks
One more question:
Is it normal that when I am streaming I cannot execute Serial.println()
from firebase-esp8266.
Don't understand. But don't serial print continuously like that, mcu needs idle time to feed the watchdog timer or handle WiFi task too, if you do that wdt reset may occur (only when connected to PC).
from firebase-esp8266.
Oh thanks
BTW can I use GPIO4. In the pinout it tells GPIO4 is not used
from firebase-esp8266.
Yes, you can see any esp8266 dev board like this what the pin you can use
https://wiki.wemos.cc/products:d1:d1_mini
Some can be multifunction as basic GPIO and communication port as SPI or I2C.
from firebase-esp8266.
Thanks man
I'll try it now and tell you
from firebase-esp8266.
I am getting:
not connected
Stream timeout, resume streaming...
and after I edit my id the relay does not change it's state
from firebase-esp8266.
Your internet problem or something. Begin stream may fail in setup. What's about code in loop?
from firebase-esp8266.
Did not understand, did you ask code in loop?
I have not changed it a bit
from firebase-esp8266.
Try the examples
https://github.com/mobizt/Firebase-ESP8266/blob/master/examples/Stream/Stream.ino
https://github.com/mobizt/Firebase-ESP8266/blob/master/examples/Different_objects_stream/Different_objects_stream.ino
It should work, if any failed, it's your internet or AP problem.
from firebase-esp8266.
Related Issues (20)
- ESP8266 is crashing while writing to firebase realtime database HOT 5
- soft wdt reset issue in esp8266 HOT 1
- I'm trying to read this data HOT 2
- WiFiClientSecure issue HOT 6
- Get Token status HOT 1
- issuse HOT 14
- BUG Token info: type = id token (GITKit token), status = on request HOT 1
- PLEASE HELP HOT 3
- [HELP] Cannot connect esp8266 and firebase. Compilation error: invalid conversion from 'int' to 'FirebaseConfig*' {aka 'firebase_cfg_t*'} [-fpermissive] HOT 1
- I've been getting a connection refused after a few seconds
- I've been getting a connection refused after a few seconds after connection to firebase HOT 1
- HELP : Executed HTTPS and connection Firebase HOT 2
- HELP :: captivePortal and firebase connection HOT 4
- BUG FirebaseESP8266.h with version @^4.4.12 of Library HOT 4
- FirebaseJson is confilcted with json inside ESP8266WebServer library HOT 6
- HELP
- Content Available for FCM_HTTPv1_JSON_Message HOT 1
- Unable to Fetch Data from Firebase
- Wi-Fi Reset Doesn't Initialize Firebase Variables and LED Status Doesn't Update Post-Reconnection HOT 6
- ERROR CODE: -3, REASON: NOT CONNECTED STREAM TIMED OUT, RESUMING... HOT 8
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 firebase-esp8266.