You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+96-50Lines changed: 96 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Firebase RTDB Arduino Client for ARM/AVR WIFI Dev Boards
2
2
3
3
4
-
Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Development Boards based on WiFiNINA library, v 1.2.1
4
+
Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Development Boards based on WiFiNINA library, v 1.2.2
5
5
6
6
This client library provides the most reliable operations for read, store, and update the Firebase RTDB through the REST API.
7
7
@@ -40,14 +40,11 @@ This following devices were tested and work well.
40
40
41
41
## Features
42
42
43
+
***Read data** at the defined database path using **get** or specific functions e.g. **getInt**, **getDouble**, **getFloat**, **getBool**, **getString**, **getJSON** and **getArray**.
43
44
44
-
***Not required fingerprint** or**certificate data** to connect.
45
+
***Store data** at the defined database path using set functions e.g. **setInt**, **setDouble**,**setFloat**, **setBool**, **setString**, **setJSON** and **setArray**.
45
46
46
-
***Read data** at the defined database path using get functions e.g. **getInt**, **getFloat**, **getBool**, **getString** and **getJSON**.
47
-
48
-
***Store data** at the defined database path using set functions e.g. **setInt**, **setFloat**, **setBool**, **setString** and **setJSON**.
49
-
50
-
***Append data** to the defined database path using push functions e.g. **pushInt**, **pushFloat**, **pushBool**, **pushString** and **pushJSON**.
47
+
***Append data** to the defined database path using push functions e.g. **pushInt**, **pushFloat**, **pushBool**, **pushString**, **pushJSON** and **pushArray**.
51
48
52
49
***Update data** at the defined database path using **updateNode** and **updateNodeSilent** functions.
53
50
@@ -75,6 +72,8 @@ This following devices were tested and work well.
75
72
76
73
This library required [WiFiNINA Library](https://github.com/arduino-libraries/WiFiNINA) to be installed which can be installed through **Boards Manager**
77
74
75
+
Update WiFiNINA firmware and install server SSL certificate, see this [issue #18](https://github.com/mobizt/Firebase-Arduino-WiFiNINA/issues/18) for how to.
76
+
78
77
79
78
## Installing
80
79
@@ -109,11 +108,11 @@ Go to menu **Files** -> **Examples** -> **Firebase-Arduino-WiFiNIN A-master** an
109
108
110
109
//2. Declare the Firebase Data object in global scope
@@ -157,20 +156,20 @@ Here is the example usage to read integer value from defined database path "/tes
157
156
158
157
int val = 0;
159
158
160
-
if (Firebase.getInt(firebaseData, "/test/int")) {
159
+
if (Firebase.getInt(fbdo, "/test/int")) {
161
160
162
161
//Success, then read the payload value
163
162
164
163
//Make sure payload value returned from server is integer
165
164
//This prevent you to get garbage data
166
-
if (firebaseData.dataType() == "int")) {
167
-
val = firebaseData.intData();
165
+
if (fbdo.dataType() == "int")) {
166
+
val = fbdo.intData();
168
167
Serial.println(val);
169
168
}
170
169
171
170
} else {
172
171
//Failed, then print out the error detail
173
-
Serial.println(firebaseData.errorReason());
172
+
Serial.println(fbdo.errorReason());
174
173
}
175
174
176
175
```
@@ -192,17 +191,17 @@ Below is the example usage to store or set float value to database at "/test/flo
192
191
```cpp
193
192
194
193
195
-
if (Firebase.setFloat(firebaseData, "/test/float_data", 123.456789)){
194
+
if (Firebase.setFloat(fbdo, "/test/float_data", 123.456789)){
196
195
197
196
//Success, then read the payload value return from server
198
197
//This confirmed that your data was set to database as float number
199
198
200
-
if (firebaseData.dataType() == "float")
201
-
Serial.println(firebaseData.floatData());
199
+
if (fbdo.dataType() == "float")
200
+
Serial.println(fbdo.floatData());
202
201
203
202
} else {
204
203
//Failed, then print out the error detail
205
-
Serial.println(firebaseData.errorReason());
204
+
Serial.println(fbdo.errorReason());
206
205
}
207
206
208
207
```
@@ -211,16 +210,16 @@ if (Firebase.setFloat(firebaseData, "/test/float_data", 123.456789)){
211
210
212
211
213
212
214
-
**To append new data to database, `push<Data Type>` should be called e.g. pushInt, pushFloat, pushDouble, pushBool, pushStringand pushJSON.**
213
+
**To append new data to database, `push<Data Type>` should be called e.g. pushInt, pushFloat, pushDouble, pushBool, pushString, pushJSON and pushArray.**
215
214
216
215
217
216
With push operation, server will return payload (key or name of newly appended node) to client.
218
217
219
218
Working with JSON data allow us to read or store multiple data at once because JSON data can store many key/value pairs, array of object and nested objects.
220
219
221
-
Function setJSON will set/replace value at defined database path with value in JSON data, and also create child nodes.
220
+
Function setJSON or setArray will set/replace value at defined database path with value in JSON or array data, and also create child nodes.
222
221
223
-
While in function pushJSON, all key/value in JSON data will be appended to the defined database path as new node.
222
+
While in function pushJSON or pushArray , all key/value in JSON or array data will be appended to the defined database path as new node.
224
223
225
224
Below is the example for appending new data (using JSON) to the path "/test/append.
226
225
@@ -231,23 +230,23 @@ Below is the example for appending new data (using JSON) to the path "/test/appe
0 commit comments