Examples

As the documentation is short on this ( the only available is the inline docs in the Cloud UI ), please post here useful example of sketches.

I'm going to pin this to increase visibility. Mod please add examples behind this line


An example (fake) thermostat View
Showcase usage of callbacks

Thanks !
That is exactly the sort of thing we need.

1 Like

I haven't found an example of how to send data to the cloud. The example here LevelSensor.ino at least gives me an idea of how it could work. Can someone show me how to update my two variables Room_Temp and Room_Humidity using the corresponding on_X_Change() functions?
With this sketch I want to send the data read out by a BME280, temperature and relative humidity, into the cloud.

It's very simple :slight_smile:

In the main loop() whenever you change the value of the Room_Temp or Room_Humidity variables their values is automatically sent to the cloud. that's it

If the properties are read-write , when to cloud changes one of the values the corresponding on_X_Change() function is called. inside that function place some code that does something with the new value.

Room_Temp or Room_Humidity ideally should be read-only values because they are read from sensors and sent to the cloud. read-write properties are used when you want a value that both the device and the cloud can change.
Let us know if you need more info

Thank you very much for the prompt answer.

But then I don't understand why the error message "No data yet received" is displayed in the cloud, for the value of Room_Temp. For the value of Room_Humidity no error is displayed, but no value is output. During a local test the sensor data were read out. Maybe I made a mistake, I will check everything again.

My MKR1010 suddenly had no connection to my IoT WLAN access point. So far this position on the desk was not obstructive. But at an elevated place, on a TFT monitor everything works. It's really that simple!

@Sun_Wuk0ng i'm happy to see that you made it work! Just to be clear: when you see the label No data yet received on a widget in your Thing's dashboard it means that - since you added that particular property - your board didn't make it to connect to the cloud with the new code generated for that property (for example because it couldn't connect to wifi).
Once you upload the sketch to the board, I suggest you to open the Serial Monitor (just click on the Monitor tab on the left) to see the info about the connection state. In fact, the cloud sketch prints there information and errors about the state of the connection to wifi and to the cloud itself.

Another full tutorial available here:
Arduno IoT Cloud Getting Started

mastrolinux:
Another full tutorial available here:
Arduno IoT Cloud Getting Started

This is really good and it works. Thank you.
Please, how can I connect my own web app or web page or mobile app with the api of the IoT cloud?
One example from the state when we can toggle the led in the dashboard to the state
where we have html button with event that does the same thing as the dashboard would be
extremely wonderfull and important too. Please :slight_smile: