Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

arduino-libraries/ArduinoIoTCloud

 
 

Repository files navigation

Compile ExamplesSpell CheckUnit Testscodecov

What?

TheArduinoIoTCloud library is the central element of the firmware enabling certain Arduino boards to connect to theArduino IoT Cloud. The following boards are supported:

How?

  1. Register your Arduino IoT Cloud capable board viaArduino IoT Cloud (Devices Section).
  2. Create a new logical representation known as aThing.

Arduino IoT Cloud Components

  • 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).

How-to-use

  • 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);}

FAQ

  • Device can not subscribe toTHING_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.


[8]ページ先頭

©2009-2025 Movatter.jp