Arduino IoT Cloud - Update

We just released a new version of Arduino IoT Cloud backend. Since there have been some changes and you're one of our beta users, we want to inform you about them. We especially value users like you and want to keep you in the loop.

Callback Name Format
The format for callback names will be different. Instead of [propertyName]callback, use on[propertyName]Change.
This will affect a few items when you update your code using the EDIT CODE button:

  • The cloudProperties.h file will be replaced with the new content based on the callback name change.
  • New callback templates will be added to your ino file.

Please note that existing callbacks will not be deleted.

An initPropertiesValues() Method Added
Every time you generate or update a sketch, a method called initPropertiesValues() will be updated accordingly with your property configuration. The properties values will be initialized to the configured minimum value, or with the default value. For example, if the type is boolean, it will be initialized to false.

ArduinoCloud.poll() Renamed to ArduinoCloud.update()
Any sketch that has already been generated will not be modified. So the ArduinoCloud.poll() method will still work. However, since it is now deprecated, we recommend that you update your sketches for future use.

Sketch Names now like Arduino IDE
Sketch names will now use the same naming format as Arduino IDE. If your thing is named something like "mything", the related sketch will be named "mything_[date][incremental_letter]" (e.g., mything_oct16a). This will prevent conflicts in case a thing is created, deleted and recreated the same day.

Links to Related Things
Generated sketches will now contain a link to the related thing.

Those are all of the recent changes. We hope you find improvements useful. They come from the excellent feedback we've received from our beta users like you. So, please keep the feedback coming. For now, thanks for being a beta user.

Awesome list of improvements.

Now to go on a killing spree (OK there are only two) so I can play with the new stuff.

the method should actually be called initPropertyValues that's better English. both words (properties and values) don't need to be plural.

Today, we're happy to release a new version of the backend powering Arduino IoT Cloud. Since our last e-mail there have been some changes and we wanted to inform you about them as you're enrolled into our beta program. We value feedback from customers like you and would love to hear your thoughts on our recent developments!

initProperties() must now set thingId

The initProperties() method, in the cloudProperties.h file, MUST now call

ArduinoCloud.setThingId(THING_ID);

on top of other code lines.

The THING_ID can be found at the end of the URL in the comment at the top of your .ino file:

/* 

 Sketch generated by the Arduino IoT Cloud Thing "thing2"

 https://create.arduino.cc/cloud/things/bad92d23-e9b2-40b8-8b1c-f624636e0414 

…

*/

In this case the THING_ID is bad92d23-e9b2-40b8-8b1c-f624636e0414
In your .ino file we will automatically add something like:

#define THING_ID "bad92d23-e9b2-40b8-8b1c-f624636e0414"

But for your old sketches you have to do that manually so you can use THING_ID from now on in your .ino file.

For example, in cloudProperties.h:

void initProperties(){
 ArduinoCloud.setThingId(THING_ID);
 ArduinoCloud.addProperty(property1, READ, ON_CHANGE, NULL);
 ArduinoCloud.addProperty(property2, READWRITE, ON_CHANGE, onProperty2Change);
}

This change only applies to previously created sketches and doesn't impact the new ones.

initProperties() and initConnection() calls must be inverted

setup() method of your .ino file, must call initProperties() at first, then initConnection(). For example:

void setup() {

 // Initialize serial and wait for port to open:
 Serial.begin(9600);
 // this delay gives the chance to wait for a Serial Monitor without blocking if none is found
 delay(1500); 

 // Defined in cloudProperties.h
 initProperties();
 // Defined in ArduinoCloudSettings.h
 initConnection();

 // set last network check to now, since it is connected
 lastNetworkCheck = millis();

}

These changes affect sketches created before December 6th, 2018. and don't impact new ones.

Check it out at https://create.arduino.cc/cloud

Hi All,

Any plans to add the Arduino Yun Rev2 board to the IoT Cloud Beta?

There is still no ETA for Arduino Yun support. In the near future we are planning to support MKR GSM 1400, MKR Vidor 4000 and Arduino Uno WiFi.
https://www.arduino.cc/en/Create/FAQ

Hi,

I have a mkr1000 and I'm struggling with IOT connection, I'm stuck on ArduinoCloud.begin(ArduinoIoTPreferredConnection)

I see that the issue already has occurred to to other people (MKR1000 stuck on "Connecting to mqtt broker..." - Microcontrollers - Arduino Forum)
MKR1000 stuck on "Connecting to mqtt broker..."

Arduino IoT seems to perfectly match my needs, the tutorial all seem straight forward but no way to get a connection.

For now it just says "Connecting to mqtt broker..."

Any help or detailed Wiki on making it run on the mkr1000 would be greatly appreciated.

Thank you in advance for any help you could bring me.

Kind Regards,
Adrien

1 Like

Hello: I'm starting just now with my Nano 33 IoT (I have some previous experience in IoT projects using nodeMCU+ThingSpeak), it works ok but I can't find the way to change the ID name for the 'thing': I can change the properties but not the 'thing'... do you know how to do it?

It looks like the ESP8266 is not supported - any suggestions???????

The ESP devices are now supported and works well. If you go to Device Manager -> My 3rd party boards and add a new board you will have the option to pick the ESP8266.

Thanks for all the enhancements eclipse1985!!!

Andreas

Hi,

I'm new using the IoT Cloud and I just created my first project.

Basically my project has 4 Properties:

  1. Light1 (Type Light, Read&Write)
  2. Light2 (Type Light, Read&Write)
  3. PushButton1 (Type Boolean, ReadOnly)
  4. PushButton2 (Type Boolean, ReadOnly)

Everything work just GREAT and I already used it with Alexa too!
But right now I'm struggling on How to change the state on Light1 or Light2 when I push either PushButton1 or PushButton2.

Can somebody help me? Is it possible to achieve?

Thanks a lot!

Hi keko_gonzz!

You need to give both push buttons the right R/W...

Andreas

andreas_waldherr:
Hi keko_gonzz!

You need to give both push buttons the right R/W...

Andreas

Thanks a lot Andreas, I'm gonna try that out!

Hello!

I have a problem with updating off IOT CLOUD. Although I switched off my MKR WIFI 1010 arduino there still exist status that devices is online. Could you help me please?

ripaxxx:
Good day, please, give me an advice. Is there any way to make the cloud work with an MEGA board with ethernetshield?

Hi @ripaxxx. This is not currently supported. You can read some more information here:
https://forum.arduino.cc/index.php?topic=596106

I have a working IoT Cloud project using a MKR WiFi 1010, MKR ENV Shield, PIR intrusion detector and IoT Remote iPhone app. However, I've found that the IoT device frequently drops off line and sometimes only disconnecting the MKR 1010 USB cable from my Mac (running Big Sur) and battery from the MKR 1010 is necessary in order to get IoT Cloud to recognize that the board is online. Is this a known problem that others are experiencing or is there something in my configuration that may be causing it?

It would also be valuable to have an audible sound or notification from the IoT Remote iPhone app to alert me when the PIR intrusion sensor is activated or an environmental variable such as temperature exceeds a limit set in the sketch. Right now I'm using the Messenger widget to display these alerts but there does not appear to be a widget that will produce audible sounds on the IoT Remote app. Is this something that is planned for the IoT Remote app?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.