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
- a manual device created in the Arduino IoT Cloud, associated to your Thing.
224
225
225
-
Connection to the cloud via Node.js/Javascript requires you to first install the [arduino-iot-js](https://github.com/arduino/arduino-iot-js) package.
226
+
Connection to the cloud via Node.js/Javascript requires you to first install the [arduino-iot-js](https://github.com/arduino/arduino-iot-js) package. You will also need to configure a manual device in the cloud, which will generate the **Device ID** and **Secret Key** needed to connect.
226
227
227
228
```sh
228
229
npm install arduino-iot-js
229
230
```
230
231
231
-
After installation, you can use the example below to connect and send variable updates to the cloud. Replace the following variables with your credentials:
232
-
233
-
-`THING_ID` - obtained from your Thing,
234
-
-`NAME_OF_VARIABLE` - name of your variable, obtained from your Thing,
235
-
-`CLIENT_ID` - obtained from [API key section](https://cloud.arduino.cc/home/api-keys),
236
-
-`CLIENT_SECRET` - only obtainable during creation of your API key.
237
-
232
+
After installation, you can use the example below to connect and send variable updates to the cloud.
238
233
239
234
### JavaScript Example
240
235
241
-
This example connects to the cloud (MQTT broker), and sends a variable update with `sendProperty()`. The parameters of `sendProperty()` are `thingId`, `variableName` and `value`.
236
+
This example connects to the cloud (MQTT broker), and sends a variable update with `sendProperty()`, and then listens for updates using the `onPropertyValue()` method.
242
237
243
-
***Please note: the variable name you enter in the script needs to match the variable name in the cloud.***
238
+
***Please note: `cloudVar` needs to contain the variable name you create in the Arduino IoT Cloud. In this case, we are calling it `test_variable`***
0 commit comments