|
1 |
| -/****************************************************************************** |
2 |
| - INCLUDE |
3 |
| - ******************************************************************************/ |
4 |
| - |
5 |
| -#include <ArduinoIoTCloud.h> |
6 |
| -#include <Arduino_ConnectionHandler.h> |
7 |
| - |
8 | 1 | #if defined(BOARD_HAS_WIFI)
|
9 | 2 | #elif defined(BOARD_HAS_GSM)
|
10 | 3 | #elif defined(BOARD_HAS_LORA)
|
11 | 4 | #elif defined(BOARD_HAS_NB)
|
12 | 5 | #else
|
13 |
| - #error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010, MKR WAN 1300/1310, MKR NB 1500 and MKR GSM 1400" |
| 6 | + #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what" |
| 7 | +#endif |
| 8 | + |
| 9 | +/****************************************************************************** |
| 10 | + DEFINES |
| 11 | + ******************************************************************************/ |
| 12 | + |
| 13 | +#if defined(BOARD_ESP) |
| 14 | + #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
14 | 15 | #endif
|
15 | 16 |
|
16 | 17 | /******************************************************************************
|
@@ -72,7 +73,10 @@ void onStringPropertyChange();
|
72 | 73 | ******************************************************************************/
|
73 | 74 | #if defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined (BOARD_HAS_NB)
|
74 | 75 | void initProperties() {
|
75 |
| - |
| 76 | +#if defined(BOARD_ESP) |
| 77 | + ArduinoCloud.setBoardId(BOARD_ID); |
| 78 | + ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY); |
| 79 | +#endif |
76 | 80 | ArduinoCloud.addProperty(bool_property_1, READWRITE, 1 * SECONDS);
|
77 | 81 | ArduinoCloud.addProperty(int_property_1, READ, 2 * MINUTES);
|
78 | 82 | ArduinoCloud.addProperty(float_property_1, WRITE, 3 * HOURS);
|
|
0 commit comments