I am using the Arduino IDE software installed to implement my smart plant pot. I have implemented WiFi and MQTT and used MQTTX to publish the data from sensors which successfully worked.
I would now like to move the data from my sensors to the Arduino Cloud. Do I just import my sketch to the online sketchbook on Arduino Cloud?
Can anyone please help?
Hi @keithb123. It sounds like a cool project!
You are welcome to do that if you like, but it won't help to achieve your goal:
The Arduino Cloud sketchbook is a convenient place to store your sketches, but nothing more. Importing your sketch to your Arduino Cloud sketchbook doesn't magically make your sketch interface with Arduino Cloud's IoT features.
My recommendation is for you to start with the "Cloud Blink" template:
https://app.arduino.cc/templates/cloud-blink
Even though it doesn't directly get you to your goal, it will allow you to quickly create and use a complete Arduino Cloud IoT project. You will verify that your board can communicate with Arduino Cloud and have a demonstration of what the code of an Arduino Cloud Thing sketch looks like.
I will provide an overview of the process of converting your sketch to an Arduino Cloud Thing sketch:
- Set your board up as an Arduino Cloud Device.
ⓘ If you tried the "Cloud Blink" template, this still will have been done for you already. - Create an Arduino Cloud Thing for your project.
- Create an Arduino Cloud Variable for each of the things you want to communicate with Arduino Cloud about.
- Merge your non-Thing sketch code into the Thing sketch.
Arduino Cloud automagically generates an Arduino sketch at step (3) of the process above. But that sketch only contains the basic framework for your Thing to connect to and communicate with the Arduino Cloud server. You still need to add the code that reads from the sensor, sets the Arduino Cloud Variables, and does whatever other things you want in your project. Your non-Cloud sketch can serve as a reference for that code, but you must make sure to correctly adapt it to work within the Arduino Cloud framework of the generated sketch.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.