Reader small image

You're reading from  Arduino IoT Cloud for Developers

Product typeBook
Published inNov 2023
PublisherPackt
ISBN-139781837637171
Edition1st Edition
Right arrow
Author (1)
Muhammad Afzal
Muhammad Afzal
author image
Muhammad Afzal

Muhammad Afzal is a senior software engineer, with more than 14 years of experience working on web-based and IoT systems in multinational organizations. He always enjoys working and solving real-world business problems with technology. He provides freelance services to IoT-based product companies to write technical reviews and projects, and he also provides consultancy to organizations. In his free time, Muhammad creates videos and courses for YouTube and Udemy. He also runs a maker movement in his region for young students to boost their interest in adopting the latest technologies.
Read more about Muhammad Afzal

Right arrow

First Look at the Arduino IoT Cloud

Every developer/programmer/cloud engineer, when they start their coding/cloud journey, is very curious to get started with the platform immediately. Well, guys, your wait is over, and we welcome you to this chapter with a Hello World greeting. This chapter not only provides you with a Hello World example but also comes with many important core concepts of how the Arduino IoT Cloud works. This is the most important chapter for all readers, as this chapter will give you an overview of how to get started with the Arduino IoT Cloud, as the Arduino IoT Cloud platform has significant differences compared to other platforms. This chapter is divided into two parts; in the first part, you will learn how to use the Arduino MKR Wi-Fi 1010 board to interact with the Arduino IoT Cloud platform, and in the second part, you will learn how to use an API with Node-RED for communication with the cloud platform.

Along with these examples, you will learn the difference...

Technical requirements

Before we start, we first need to set up an Arduino IoT Cloud-compatible board. I recommend the Arduino MKR Wi-Fi 1010, but there is a complete list of compatible boards at https://docs.arduino.cc/arduino-cloud/getting-started/technical-reference#compatible-hardware, which you can choose according to your requirements.

Second, you should have an Arduino IoT Cloud account. If you don’t, then sign up at https://cloud.arduino.cc/ and select a plan according to your requirements.

Third, we need to download and install the Arduino Create Agent. Arduino has created a beautiful web-based guide for installation at https://create.arduino.cc/getting-started/plugin/welcome.

The second part of the chapter is related to Node-RED, which will be used for devices that are not officially supported by the Arduino IoT Cloud such as Raspberry Pi and older versions of Arduino development boards. Download and install Node-RED according to your operating system from...

Understanding how the Arduino IoT Cloud works

So, before we start our Arduino IoT Cloud journey, we need to understand how it operates because it’s a little bit different from traditional IoT cloud platforms. As a result, the Arduino IoT Cloud is a more flexible, secure, and industry-deployment-ready IoT solution. Firstly, we will understand the design of the Arduino IoT Cloud with the following diagram, which will help you to understand the key pillars of the Arduino IoT Cloud:

Figure 2.1 – The Arduino IoT Cloud architecture

Figure 2.1 – The Arduino IoT Cloud architecture

Most cloud platforms work with the concept of devices and sensors, but in the Arduino IoT Cloud, we have the concept of the Thing, which includes devices and variables known as sensors/actuators. You may be thinking that a Thing and a Device are both the same; actually, they’re not. It’s important to make this distinction because if we do not understand it, then it will create more complications going forward...

The Arduino IoT Cloud and the MKR1010 Hello World example

A Hello World program is the first program that every programmer uses when they start learning any programming technology to get a taste for a platform. However, when it comes to the IoT side, things are different; you will be working with hardware and software, which means the Hello World example will be different from its traditional onscreen appearance. In this section, we will demonstrate how to turn on/off a built-in LED of an Arduino MKR Wi-Fi 1010 development board using the Arduino IoT Cloud dashboard, which is a Hello World example for the Arduino IoT Cloud.

In a series of steps, you will learn how to work with Arduino IoT Cloud-compatible boards. This part is very important to understand how a Thing works on the Arduino IoT Cloud platform. First, you need to get the required hardware, software, and accounts, as mentioned in the Technical requirements section.

So, in this section, we are going to start the Hello...

Introducing Node-RED

Node-RED is a free, open source visual programming tool for IoT and other applications. It was developed by IBM Emerging Technology and was first released in 2013. Node-RED provides a web-based interface to wire together hardware devices, APIs, and online services in new and interesting ways. The tool uses a graphical flow-based programming language, making it easy for users with little or no programming experience to build complex IoT systems. Node-RED has become popular in the IoT and smart home communities for its ease of use and ability to integrate with a wide range of devices and services.

Node-RED is a flow-based development tool for IoT and other applications. It provides a visual, drag-and-drop interface to connect different devices, APIs, and online services. With Node-RED, users can wire together inputs, outputs, and functions to create sophisticated IoT solutions. As well as being open source and free to use, Node-RED has a large user community and...

The Arduino IoT Cloud and a Node-RED Hello World example

In this section, we will build on our project by adding some extra functionality to our system via Node-RED. This will help you to understand how you can use Node-RED to integrate non-compatible devices with the Arduino IoT Cloud.

Node-RED will monitor the LED status based on a value that is either true or false. On the basis of this status, Node-RED will send the command to another Thing variable called LEDStatus, which will be linked to the Status widget, which shows the LED as being either on or off. Using this example, you will learn how to read data from a Thing property/variable and how to write data to a Thing property/variable.

Node-RED has a module that was officially developed by Arduino for connectivity with the Arduino IoT Cloud. It provides five nodes to carry out different types of operations. For further details, visit https://flows.nodered.org/node/@arduino/node-red-contrib-arduino-iot-cloud.

A tour of...

Summary

This chapter is the first chapter where we explored how to connect devices with the Arduino IoT Cloud using a basic LED on/off example. In the first part, we used an Arduino IoT Cloud-compatible development board, which was the MKR Wi-Fi 1010 board, where we learned how to create Things and cloud variables, how to associate devices, how to configure networks, and how to create sketches. At the end of that section, there was an assignment for you to practice on.

In the second part of this chapter, we explored how to connect non-compatible development boards, such as Arduino UNO, Arduino Mega, and Raspberry Pi, with the Arduino IoT Cloud, using Node-RED and the Arduino API interface. Here we have explored Node-RED, the Node-RED module for the Arduino IoT Cloud, and generating API keys in the cloud. This part of the chapter helped teach you how to use non-compatible existing technologies with the Arduino IoT Cloud.

Arduino has a lot of options in the Arduino IoT Cloud, such...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Arduino IoT Cloud for Developers
Published in: Nov 2023Publisher: PacktISBN-13: 9781837637171
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Muhammad Afzal

Muhammad Afzal is a senior software engineer, with more than 14 years of experience working on web-based and IoT systems in multinational organizations. He always enjoys working and solving real-world business problems with technology. He provides freelance services to IoT-based product companies to write technical reviews and projects, and he also provides consultancy to organizations. In his free time, Muhammad creates videos and courses for YouTube and Udemy. He also runs a maker movement in his region for young students to boost their interest in adopting the latest technologies.
Read more about Muhammad Afzal