Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Latest commit

 

History

History
102 lines (72 loc) · 3.18 KB

README.adoc

File metadata and controls

102 lines (72 loc) · 3.18 KB

This library is DEPRECATED and is no more supported

Arduino Cloud Library

Use this library to connect your Arduino/Genuino to Arduino cloud. To have your configurations ready follow the getting started or go to the cloud dashboard.

1. Supported devices

1.1. Zero + WiFi101, MKR1000

Important
Make sure to have the correct SSL certificate for arduino.cc. Look here for the the update instuctions.

1.2. Yun-Shield

Important
The yun or yun shield firmware should be >=1.6.2. Look here for the the upgrade instuctions.

2. Credits

The library is based on the Paho Library.

Special thanks to Joël Gähwiler author of arduino-mqtt library for his work on porting the paho library on Arduino.

3. APIs

3.1. Setup and Configuration

  • ArduinoCloudThing()

  • void begin(const char* name, const char* username, const char* id, const char* password, Client &client)

3.2. Property configuration

3.2.1. Simple property

  • void addProperty(const char* name, const char* datatype, const char* permission)

3.2.2. Policy managed property

Is possible to specify a policy as:

  • ON_CHANGE: the value will be written only if it is changed

  • TIMED: is necessary to specify a lapse (seconds)

  • void addProperty(const char* name, const char* datatype, const char* permission, const char* policy)

  • void addProperty(const char* name, const char* datatype, const char* permission, const char* policy, int lapse)

3.2.3. Other object property

An object can also read or write a property of another object, is just necessary to specify the other object’s name

  • void addExternalProperty(const char* other_device_name, const char* name, const char* datatype)

3.3. Write properties

  • void writeProperty(const char* name, char* value)

  • void writeProperty(const char* name, float value)

  • void writeProperty(const char* name, int value)

  • void writeProperty(const char* name, String value)

3.4. Read properties

  • String readProperty(const char* name)

  • String readProperty(const char* other_device_name, const char* name)

3.5. Extra

  • void poll()

  • void push()

  • void enableDebug()

  • void disableDebug()

4. Variables

4.1. Permissions

  • R - The property can be only written from the device

  • RW - The property can be written and from the device and can update the value from other objects

4.2. Polices

  • TIMED - Waiting seconds before update a new data

  • ON_CHANGE - Publish value only on change

4.3. Data Type

4.3.1. Standard

  • CHARSTRING

  • FLOAT

  • INT

4.3.2. Temperature

  • TEMPERATURE_C - celsius

  • TEMPERATURE_F - fahrenheit

4.3.3. Lenght

  • LENGHT_M - meters

  • LENGHT_C - centimeters

  • LENGHT_I - inches

4.3.4. Vars

  • PERCENTAGE

  • ANALOG

  • LUMEN

  • PPM - gas part per million

  • STATUS - on/off

5. Debug

The default debug output is on SerialUSB, in order to change the output is necessary to edit CLOUD_DEBUG_SERIAL at the begin of src/ArduinoCloudThingBase.h