- Notifications
You must be signed in to change notification settings - Fork82
License
arduino-libraries/ArduinoIoTCloud
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
TheArduinoIoTCloud
library is the central element of the firmware enabling certain Arduino boards to connect to theArduino IoT Cloud. The following boards are supported:
- WiFi:
MKR 1000
,MKR WiFi 1010
,Nano 33 IoT
,Portenta H7
,ESP8266
- GSM:
MKR GSM 1400
- 5G:
MKR NB 1500
- LoRa:
MKR WAN 1300/1310
- Register your Arduino IoT Cloud capable board viaArduino IoT Cloud (Devices Section).
- Create a new logical representation known as aThing.
Devices: Physical objects built around a board (e.g.
MKR WiFi 1010
). This is the hardware which runs the sketch, reads sensors, controls actuators and communicates with the Arduino IoT Cloud.Things: Logical representation of a connected object. They embody inherent properties of the object, with as little reference to the actual hardware or code used to implement them. Each Thing is represented by a collection ofProperties (e.g., temperature, light, pressure...).
Properties: Qualities defining the characteristics of a system. AProperty can be defined asread-only (
READ
) to indicate that Arduino IoT Cloud can read the data, but cannot change the value of suchProperty. On the other end, it may be designated to beread-and-write (READWRITE
), allowing Arduino IoT Cloud to remotely change the property’s value and trigger an event notification on the device. It is also possible to mark properties aswrite-only (WRITE
) which means the cloud can write to this property but not read its value (this limits data transmission for properties which are used to trigger events only).
thingProperties.h
voidonLedChange();/* ...*/bool led;int seconds;/* ...*/voidinitProperties() { ArduinoCloud.setThingId("ARDUINO-THING-ID"); ArduinoCloud.addProperty(led, WRITE, ON_CHANGE, onLedChange); ArduinoCloud.addProperty(seconds, READ, ON_CHANGE);}/* ...*/WiFiConnectionHandlerArduinoIoTPreferredConnection("SECRET_SSID","SECRET_PASS");
MyCloudApplication.ino
#include"thingProperties.h"voidsetup() { Serial.begin(9600);while(!Serial) { }pinMode(LED_BUILTIN, OUTPUT);initProperties(); ArduinoCloud.begin(ArduinoIoTPreferredConnection);}voidloop() { ArduinoCloud.update(); seconds =millis() /1000;}voidonLedChange() {digitalWrite(LED_BUILTIN, led);}
- Device can not subscribe to
THING_ID
ArduinoIoTCloudTCP::handle_SubscribeMqttTopics could not subscribe to /a/t/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/e/i
In this case either the device has not been associated with the thing within the Arduino IoT Cloud GUI configuration or there's a typo in the thing id.
About
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.