Git Product home page Git Product logo

arduinoiotcloud's Introduction

ArduinoIoTCloud

检查Arduino状态 编译示例 拼写检查 单元测试 代码科夫

什么?

ArduinoIoTCloud库是固件的核心元素,使某些 Arduino 板能够连接到Arduino IoT 云。支持以下板:

如何?

  1. 通过 Arduino IoT Cloud (设备部分)注册支持 Arduino IoT Cloud 的板。
  2. 创建一个新的逻辑表示,称为Thing

Arduino 物联网云组件

  • 设备:围绕板构建的物理对象(例如MKR WiFi 1010)。这是运行草图、读取传感器、控制执行器并与 Arduino IoT 云通信的硬件。

  • 事物:连接对象的逻辑表示。它们体现了对象的固有属性,几乎不涉及用于实现它们的实际硬件或代码。每个事物都由属性的集合表示(例如,温度、光、压力...)。

  • 属性:定义系统特征的质量。可以将Property定义为只读( ),表示 Arduino IoT Cloud 可以读取数据,但不能更改该Property值。另一方面,它可以被指定为读写(),允许 Arduino IoT Cloud 远程更改属性的值并在设备上触发事件通知。还可以将属性标记为只写( ),这意味着云可以写入此属性,但不能读取其值(这限制了仅用于触发事件的属性的数据传输)。READREADWRITEWRITE

如何使用

  • thingProperties.h
void onLedChange();
/* ... */
bool led;
int seconds;
/* ... */
void initProperties() {
  ArduinoCloud.setThingId("ARDUINO-THING-ID");
  ArduinoCloud.addProperty(led, WRITE, ON_CHANGE, onLedChange);
  ArduinoCloud.addProperty(seconds, READ, ON_CHANGE);
}
/* ... */
WiFiConnectionHandler ArduinoIoTPreferredConnection("SECRET_SSID", "SECRET_PASS");
  • MyCloudApplication.ino
#include "thingProperties.h"

void setup() { Serial.begin(9600); while(!Serial) { } pinMode(LED_BUILTIN, OUTPUT);

initProperties(); ArduinoCloud.begin(ArduinoIoTPreferredConnection); }

void loop() { ArduinoCloud.update(); seconds = millis() / 1000; }

void onLedChange() { digitalWrite(LED_BUILTIN, led); }

<clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 tooltipped-no-delay d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w" value="#include "thingProperties.h"

void setup() { Serial.begin(9600); while(!Serial) { } pinMode(LED_BUILTIN, OUTPUT);

initProperties(); ArduinoCloud.begin(ArduinoIoTPreferredConnection); }

void loop() { ArduinoCloud.update(); seconds = millis() / 1000; }

void onLedChange() { digitalWrite(LED_BUILTIN, led); }" tabindex="0" role="button">

常问问题

看门狗

该库的1.0.0版本为所有基于 ATSAMD21G18 的云连接板添加了看门狗功能。看门狗只是一个从预设起始值开始倒计时的电子计时器,当达到零时,会触发微控制器的重置。它可用于自动从临时硬件故障或不可恢复的软件错误中恢复。为了避免看门狗达到零,倒计时器需要定期重置为其起始值。这是ArduinoCloud.update()在函数开始时定期调用的情况发生的loop()。尽管看门狗是自动启用的,但可以通过将第二个参数设置为ArduinoCloud.begin(...)来禁用它false

ArduinoCloud.begin(ArduinoIoTPreferredConnection, false).

默认情况下,使用以下板启用 Whatchdog:MKR 1000, MKR WiFi 1010, MKR GSM 1400, MKR NB 1500, MKR WAN 1300/1310, Nano 33 IoT, Portenta H7, , Nano RP2040 Connect, Nicla Vision, OPTA WiFi, OPTA RS485,OPTA LiteGIGA R1 WiFi

设备无法订阅THING_ID

ArduinoIoTCloudTCP::handle_SubscribeMqttTopics could not subscribe to /a/t/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/e/i

在这种情况下,设备尚未与 Arduino IoT Cloud GUI 配置中的事物关联,或者事物 ID 中有拼写错误。

在线旅行社

以下板卡支持 OTA: MKR WiFi 1010, Nano 33 IoT, Portenta H7, Nano RP2040 Connect, Nicla Vision, OPTA WiFi, OPTA RS485, OPTA Lite, GIGA R1 WiFi, Nano ESP32,ESP32

验证

开发板可以使用 3 种方法向 ArduinoIoTCloud 服务器进行身份验证:

arduinoiotcloud's People

Contributors

aentinger avatar pennam avatar facchinm avatar per1234 avatar ubidefeo avatar ilcato avatar sandeepmistry avatar fabik111 avatar sid23 avatar mirkokurt avatar mastrolinux avatar umbynos avatar cmaglie avatar eclipse1985 avatar manchoz avatar luigigubello avatar mattiabertorello avatar agdl avatar alranel avatar jorgetrujilloroman avatar physicsuofraui avatar lorenzoromagnoli avatar mbanzi avatar matteosuppo avatar pratyush1606 avatar yuanxiaoming8899 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.