>> There is a new Arduino
library in town that will help you connect your devices to Azure IoT if you're
an Arduino a developer. Wellington is here to tell
us about this new library, the samples and show
us how that works, this today on the IoT Show. [MUSIC]. Hi, everyone thanks for
watching the IoT show, I'm Olivier, your host. Today I'm joined by Wellington
and we're going to discuss an Arduino library and samples
to connect devices to Azure IoT. Hey Wellington, how are you? >> Hey Olivier, I'm good. Thanks for having me here again. >> Thanks for coming
back to the IoT show. Last time you came
with some cool demos, I'm sure we're going to have
some cool demos as well today. >> We have something. >> What's the deal here? We have a library for Arduino IoT, the last two seamlessly connect devices to Azure IoT. Is that right? >> Yeah, that's correct.
This is not new, we used to have a library to
get devices connected to Azure, but that was getting quite old. We did a complete revamp on that library that's now
based on the embedded CSDK, which is perfect for small
constrained devices, and we made it public last month. We are now keeping it up to date
and bringing new samples on how to get Arduino compatible
devices connected to Azure. >> Got it. I like that you say Arduino compatible devices
because we'll talk about what hardware is required to connect to Azure IoT with the requirements
we have in terms of security, in terms of encryption and so on. You're part of that
embedded CSDK team. You guys are working on that
embedded CSDK, and here, is it fair to say that it's an
Arduino version or not a version. It's the same code as the embedded
CSDK used on other devices? >> It is, yeah. We could say these are
instances of the embedded CSDK. One for each of the different development kits
that we have samples for. It's just packaged in
a way that is easy for users to just go
to the Arduino IDE, find the library there,
it's packaged there. When you install that library, you will have access to all of the embedded CSDK
working on the Arduino. >> We'll talk about the details
as you're showing us how. Let's jump into the demo
and see what's going on. >> Absolutely. Let me go here and
show you that aka.ms/arduino. That should be your starting point. From here, you'll be able to see all of the different dev
kits for which we have support. Today, as you can see here, we have support for ESP32, ESP8266 and the Realtek AmebaD
for all of these devices. Then we have samples that are
working both with IoT Hub, but also we have IoT Central samples >> Trust things. That means that
you have all the functionalities from the connectivity part
all the way up to plug in play and the more advanced
functionalities that are available in between
devices and the Cloud services? >> Exactly. We're going
all the way from, "Hey, I just want to get my device
connected to IoT hub, help me out with that and I want
to send telemetry get commands." IoT help sample will
help you with that. If you want to go in a more
sophisticated scenario to say, "Yeah, I don't want to have
to deal with creating a hub, maintaining the hub and
all things like that, I want to go with a ready to
use solution like IoT Central." We have a sample for that as well, that also showcases how IoT
plug and play would help us. >> I like that. Actually, I more and more recommend people to start
with IoT Central because especially if you're an
embedded developer working on devices because it really
simplifies the approach, or the onboarding onto the Cloud. That's great. Quick question
people might be confused, and really we've been
careful hearing the wording, but I wanted to reiterate an
explanation around Arduino devices. The perception could be that, "Hey, there's a library now I can connect my Arduino device to Azure IoT." It's not exactly that. Can you elaborate a
little around that? >> Absolutely. This is
an Arduino library, meaning that I can use the Arduino IDE and I can install that library
using the Arduino IDE, and then the Arduino
IDE will help you get that code flashed
into your device. Now, not all devices are capable of connecting to Azure or
to IoT for all that matter. Imagine that you have
an Arduino Uno board, and I do have one right here. If I take an Arduino
board and this board, won't come with any
type of connectivity. But even if I add one of those expansion ports
here that would say, "Okay, now I have a Wi-Fi or now I have Ethernet or
something like that." Even in that scenario, this device wouldn't
be able to handle what we need in terms of establishing
a TLS connection with Azure. This is not fast enough. It does not have memory enough. When we say connecting
Arduino compatible devices, we're talking more about devices that have a little more
power and Wi-Fi capacity. >> Got it. As a matter of fact, lots of these smaller
Arduino devices, don't even have a
network connectivity. They're just here to connect to
some sensors actuators locally. When we say connection, it requires Internet connection. Obviously, yes, I love it. Great that you clarifies that. Let's look at the
samples and how they are showing up in the Arduino IDE. >> Absolutely. Let me
bring the Arduino IDE. In this scenario here, I already have the library here, but if you're looking to
get your library installed, we will go to "Manage
libraries," and from here we would look for Azure. >> Do you have any specific library
location to add to the tool? Sometimes you have specific
libraries when you want to add them, you need to add a link
to a new location, is that the case for these ones
or are they just available? >> It is not the case. We don't
need to do anything special. We just open Arduino, sketch libraries and then
"Library Manage," you type Azure, you will find here Azure SDK
for C and this is the new one. You just install it and then you go. You will also find Azure IoT Hub, which is the previous one I
was talking to you about. We're in the process of
deprecating this library. Going on, Azure SDK for C
should be the best one. >> Just to make sure it's
cool Azure SDK for C, but it's very much
dedicated to IoT scenarios. It does not include bunch
of libraries to connect to other Azure services like
storage or other things, it's really Azure IoT Hub device
provisioning service, these services. >> That is correct. This is a
library especially for IoT. Once you have installed that, then we can go to file examples, you'll find the Azure
SDK for C here. Under that, all of these samples
as we were seeing on that ripple. Then I can take any of these, and the sample that I want to
show you today is the one based on the ESP32 Azure IoT kit, which is one ESP32 that already has a bunch of sensors and buttons, a buzzer, LCD screen and a number of other
[inaudible] and whistles. >> That kit is definitely a bit fancy because it has all
the sensors on them. Will that sample work on a more, I would say, popular, ESP32 to dev kits, eventually without the
screen and sensors? >> Oh yes, that is a great
question. Yes, it does. If you look here at the list, we have the IoT Central
ESP32 Azure IoT kit, which is this device that
comes with all of the sensors. But if you do have one of this
simple ESP32 with no sensors, you can use the IoT Central ESP32 that will come with
simulated telemetry data. You can use this right
now and it will work, its just not showing
real data telemetry. >> Got it. >> Yes. >> Show me a bit of the sample. We're not going to dive too much
into the details because we have another video that will be a
walk-through of all the details, but I really want you to
show us the high level. "Hey, here is where
we are connecting, here is a few things so that people realize the extent of these
samples in that library." >> Absolutely. The work
that any user will have, any device builder out
there will have to get this sample connected is
to go to IoT Central, create an application,
create a device, get the credentials for that device. We will go here to
the iot.configs.h, I update SSID and password
for my Wi-Fi network, I add ID scope, device ID, and device key. That's it. >> That's it. >> Flash the device and
everything else will happen. >> Yeah. I've navigated through that sample and for
people who have been playing around with the other Azure IoT as
the key samples. It's the same. It's basically connectivity into the device provisioning service and then establishing the
connection, sending telemetry, synchronizing the device,
twain receiving commands. It's pretty straightforward. It
includes plug and play as well. >> It does. You'll
see here that one of the things that we have on this
sketch is the Azure PNP Model ID. This is the model that represents
the capabilities of this device. When this device gets
connected to Central, it will inform central
of this model ID. Because of that, Central can do
a look up in our model database. It will find this model, it will know all of the
devices capability, and it can create the dashboard
for us automatically. >> Yeah. Once again, we have other shows about plug
and play, which are great. Quick question for you, these symbols are pretty large
because you do a lot of things, for a device to be able
to send telemetry, synchronize the device to
industry as a JSON file for the last known state and receiving commands while leveraging
the MQTT protocol, these samples are pretty bulky. You can definitely go
and watch them out. I think we have simple ones
to connect to Azure IoT Hub, and that don't have all the plug
and play infrastructure or code, but there still that feeling that, how can we make it
a bit more generic? We discuss that just
before recording, but you definitely reminded me
that there are some specificities to the hardware that need to be
brought up in the code here. Can you elaborate a
little bit on that one? >> Absolutely. We made it so by dividing this sample into the
different files that are part of the sample to try and make it
simpler so that users don't have to understand what's going on in each one of these files to
actually make use of it. We do have some things, so once they update
their credentials here, the sample is already working. Now, if they want to
understand a bit more, they can see here under
the PNP template, what is it that we are taking
from this device and up to be able to make the plug
and play magic to work? But then we'll also see that in
order for this device to work, we need to go through provisioning, we need to go through
all of the 15 pieces and there's a lot of work that
needs to happen to make it work. Then we implemented a
simple state machine here to show all of the different states in
which this device can be. You can see here all of
these different one. There's a bunch of them. But then this makes the whole thing simpler because when
you're looking at this, the loop here on this Arduino code, what we get is pretty
much connect to Wi-Fi if it is not connected
to Wi-Fi connect it, start Azure IoT, which is
pretty much getting connected. Once we get there,
this is why we do. We're just monitoring the state and we make decisions based on that. If it is connected, we can send telemetry here, send device information, and send in telemetry. That's it. If we have any problem, we can disconnect, go back to the beginning
and connect it all again. >> Love it. >> It makes it simpler like that. >> It does. That would be the way an
embedded developer will want to develop and then write his code with that state machine. But
it's not mandatory. You can go ahead and just pick out of these samples
as you need them. We do what you did, so we'll talk about IoT Central. We do want to see it connected. Once again, we have that
other deep dive video that shows all the implementation, but here on the IoT show we like the parts of show me that device
connected to IOT Central. >> Absolutely. Let me show you so this is my IoT Central application. Here, you see I have
one device created. This is Red Mouse. When I click on this device, it is already connected. When I click on this device, I can see couple of things. First, that it is connected and also that under
that tab overview, I can already see
temperature, humidity, light pressure information being
plotted here and also here, so these are all live data
coming from my device. I have information
about the magnetometer. I have the information
about the accelerometer. All of this information is
being pulled from the device and because we have a PNP model
that is attached to this device, Central was able to create all
of these dashboard for us. This is telemetry
part on the Overview, but we also have Commands here. I can toggle LEDs and I can show
information here on the display. Actually, I do have the device here, so let me show you
how that would work. Here, under my camera, I have this device in here. This is the screen, a bunch of sensors. Now I'm going to toggle this LED. This is the first one. When I come here to the interface
and I Run toggle LED one, you'll see that, there you go. The LED one is now lit. I can toggle LED two as well. Then, there we go, we see
the other LED lighting up, and then I can also
send string here, IoT Show, and then I Run. It should replace why it's here. >> IoT Show. Love it.
Perfect, the ideal demo. That's going to be
the screenshot for the thumbnail here. I love it. >> There you go. >> It does work, and we'll show that deep dive demo a
bit more about how, but that's a great introduction
here to this new library. Wellington, so this is on GitHub
and on on aka.ms/arduino. What's next? The team is there,
maintaining that library. Can people contribute? Tell me more about this
part here real quick. >> Absolutely. Everything we do, going from the embedded CSK, the libraries for our domain, and all of the different
software that we create is all open source and
they're all in the open. Just like the Arduino
library we created, we will maintain that. If you're taking this library,
you're trying it out, you're facing any problems, go ahead, file an issue. We will take a look. We will
help you out with that. If your preferred device
is not here and you want to take a look and create support
for that and create a PR, we will take your PR, we will take a look at that. We'll work with you
and we can even bring that additional sample to
our collection of samples. It is now really much
looking at the community and letting the community
tell us what is next, what is important, what are the things that we
should be considering? >> Perfect, Wellington. That's
pretty straight forward. Go to aka.ms/arduino. I'm happy that you snatched that
one because a kid will miss link. Arduino would not expect that one
to be available, so well done. >> I was lucky. >> Well, thanks so much for coming
to the show today, Wellington. Everyone go and check
out this library. Take it for a spin. Let us know what you think. Engage with Wellington
Steam on GitHub. Also, have a good Arduino IDE
development. See you soon. Bye. >> Cheers. [MUSIC]