Skip to content

Commit bd7eecd

Browse files
committed
Fixing up example with new API regarding ESP8266 connection to Arduino IoT cloud
1 parent 4b2b675 commit bd7eecd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

examples/ArduinoIoTCloud_ESP8266/ArduinoIoTCloud_ESP8266.ino

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
#include "arduino_secrets.h"
77
#include "thingProperties.h"
88

9-
#define ARDUINO_CLOUD_DEVICE_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" /* Entry "Board ID" when selecting board within Arduino Create */
10-
#define ARDUINO_CLOUD_DEVICE_PASS "my-password" /* Password set via IoT API */
11-
129
void setup() {
1310

1411
pinMode(LED_BUILTIN, OUTPUT);
@@ -23,7 +20,7 @@ void setup() {
2320

2421
setDebugMessageLevel(DBG_INFO);
2522

26-
ArduinoCloud.begin(ArduinoIoTPreferredConnection, ARDUINO_CLOUD_DEVICE_ID, ARDUINO_CLOUD_DEVICE_PASS);
23+
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
2724
}
2825

2926
void loop() {

examples/ArduinoIoTCloud_ESP8266/arduino_secrets.h

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
#define SECRET_SSID "my-wifi-ssid"
44
#define SECRET_PASS "my-wifi-password"
5+
#define SECRET_DEVICE_PASS "my-device-password" /* Password set via IoT API */

examples/ArduinoIoTCloud_ESP8266/thingProperties.h

+3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
#include <Arduino_ConnectionHandler.h>
33

44
#define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" /* "Thing ID" when selecting thing within Arduino Create */
5+
#define DEVICE_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" /* Entry "Board ID" when selecting board within Arduino Create */
56

67
void onLedChange();
78

89
bool led;
910

1011
void initProperties() {
1112
ArduinoCloud.setThingId(THING_ID);
13+
ArduinoCloud.setDeviceId(DEVICE_ID);
14+
ArduinoCloud.setPassword(SECRET_DEVICE_PASS);
1215
ArduinoCloud.addProperty(led, READWRITE, ON_CHANGE, onLedChange);
1316
}
1417

0 commit comments

Comments
 (0)