Hello all developers, my name is Neo. I'm a technical specialist
in Microsoft partner team based in China.
Today I will show you some cool things we have built with our
local partner M5stack to simplify our development and
unlock new opportunities for device builders. Its name is
Project PnPFlow.
One of the biggest problem of IoT today is tight coupling of
device and solution.
Implement application work with different kinds of devices
or develop a device that can be easily integrated by various
applications. Both can be very challenged.
Since there is no common language out there, preporatory
protocol and customized code are required everywhere.
Azure IoT pluy and play is a ecosystem to address this issue.
By using a declarative approach where device model themselves in
terms of capabilities using an industry standard language.
Device developers can now build their firmware completely
independent of cloud solution and the solution developers can
implement standard visualization, reuse across
different application without any customized code.
IoT plug and play aims to improve the interoperability
in the IoT world. It is built on top of open modeling language
called DTDL which is also used by Azure Digital Twin product to
model our physical world. DTDL describes three kinds of
information to model any devices in the world. What Telemetry or
time series data a device emit.
What properties on the device that can be seen or operated by
application?
And what command on device can execute remotely?
Different schema and semantic types are defined in the DTDL
specification so application can understand the exact date format
and implement the most user-friendly interface for
device.
Azure IoT Hub and Azure IoT Central support plug and play out of
box.
Any solution built on top of them can leverage this
capability to eliminate, customized code and the lower
efforts to connect the plug and play enabled device.
For the sake of the time, I won't to go to more details. I hope
you have got a basic understanding of Azure IoT
plug and play. This is the foundation of PnPFlow that I'm
going to talk about soon.
So what is PnPFlow all about and what problems it solves?
One thing I didn't talk before is the plug and play compatible
device development.
Develop a device fully conform to its model or write a model
file for existing devices is not so straightforward.
Though Microsoft provide SDK and tools to accelerate this process,
it still needs device developers to integrate into firmware manually
It can be error prone or time consumed.
PnPFlow is end to end solution to simplify the whole.
process.
It is a unique IoT developer experiences enable device
builder to develop the schema aware IoT devices in M5Stack UIFlow
IDE without knowing the complexity of plug and play
protocol.
Device capability can be further discovered by the IoT Central
and work seamlessly with the template based web UI.
I should give you some background of M5Sstack
M5Stack is part of Microsoft. It is a startup based in Shenzhen,
Silicon Valley of China. They focus on first party device design
for quick and easy IoT development.
M5Stack has developed hundreds of modules, include sensors,
actuators and communication modules that can be easily
extended and stacked to implement any kind of IoT
solution.
One of the key differentiator M5Stack provide is their
graphical programming IDE UIFlow. It is very similar
to MakeCode provide visual and drag and drop programming experiences
but with much more hardware supported. Actually device
development in UIflow is already Azure IoT enabled. There
is a dedicated page of Azure IoT Native operations such as
initial connection to IoT Hub or sending D2C message to IoT hub.
It lays a good foundation for Project PnPFlow.
Let's get back to our main topics. I will use this page to
further explain how PnPFlow actually works.
Behind the scene, each M5 stack core, unit or module hardware
is associated with a prebuild plug and play model hosted on
GitHub. This models defined the data schema and semantic
information that the IoT solution will see out of box.
The UIFlow IDE has the building intelligence to know how to
construct the smart blocks to represent telemetry, property or
command discovered from each prebuild model file.
When you just start to design their own device solution in
PnPFlow, they can pick up any smart blocks and integrate them
with their own business logic.
The UIFlow will dynamically composed the top-level device
model based on the user specific design and make sure it is
always synchronized.
To further improve the developer experiences, UIFLOW
natively integrated with Azure IoT Central as a companion app so
user can login Azure IoT Central, create and update device
template, device identity without the leaving UIFlow.
The Azure IoT Central template based web you are will be
customized to reflect the device exact capabilities without any
manual operations.
The magic happens when user click the RUN button to
download the firmware to the device. The device will connect
to Azure IoT Central and start to behavior as its model
expanded. The IoT Central device dashboard will map the
data correctly thanks to the plug and play protocols behind.
OK, let's go to see some real demos.
I've got few devices for demo, M5Stack Core2 IoT module as
the main controller.
Connecting to one ENV 2 unit that can be used to collect
environment data and one RGB unit to extend three color LEDs.
The Core2 is configured with the Wi-Fi credential to be able
to connect to public Internet.
Here I have also created a fresh Azure IoT Central application for the
demo purpose.
As you can see, there is no device or template exists in my
application at this moment.
Then I will go to UIFlow to show you how these things works
together.
Now, I'm in the UIFlow IDE.
My Core2 is already remembered by my browser.
and remotely connected to my session over a secure token.
The first thing I will do is to add Unit to my workspace.
Click this button. We can see all the Units supported by the
UIFlow.
For those Unit that have the Azure IoT plug and play support
you can see there is a small icon associated with it.
You can also filter that these devices by using the checkbox
button here.
I will add ENV2.
and RGB Unit to my design.
The connect through the port A and put B of the IoT module.
Then I will go to the place where we can use the plug and play
blocks.
Go to the IoT Cloud, Azure and IoT plug and play.
Drag and drop the connect to IoT Central block to my canvas.
On the right side we will see a new plug nad play Icon will be
displayed.
Click this to expand the PnPFlow control panel.
There's three tabs here. I will use the first one.
IoT Central control panel to set up a connection to my
application.
Users should enter their Azure IoT Central application URL
prefix.
For the application I just create it is pnpflow.
Then I need to provide the API token to be able to authenticate
my application.
I can just click this small icon to go to the API token
generation page to create a new one.
For the demo purpose, I will use our existing token.
Actually, this step is to verify the API token and save it to the
web page to make rest API call later.
After successful logging, more settings and operation will be
prompted.
The scope ID is the identifier of our application.
And it will be automatically filled into the IoT central
connection block here.
The model ID is the IDE-generated random ID. You can
modify it or use your own model ID.
Or leave it unchanged to be able to get started.
Now I will start to design my device in UIFlow.
I want my device to collect temperature, humidity and
accelerometer data to the Cloud every 30 seconds.
I will show you how easy I can do this by using plug and play
flow.
Go to the IoT plug and play page.
Drag and drop the send telemetry block to the workspace.
From the drop down list, select the ENV2. You can see all the
telemetries that ENV2 need to support.
Since we don't need the pressure data, we can just delete it.
I can do the same for the accelerometer data, but I
want to show you a different way to do it.
From the hardware category you can see all the hardware
operations that built-in support by the IoT module. Select IMU
and there is a plug and play ready block here. Drag and
drop to our workspace. You can see IMU is pre-selected.
For the same reason, we don't need the gyro.
So just remove them.
As usual, we need some control block.
and some timer to control the device behavior.
I will add a 30 second timer at the end of the loop to control
the telemetry.
I also want to send some properties to cloud.
We can go to the IoT plug and play page.
Select the update property to the cloud.
From the drop down list I can select the device information
interface.
There are several properties that you can use to report.
I will keep only in the manufacturer and firmware
version for example.
The last thing I want to do with my device is to control the
external RGB Unit.
We can use the plug and Play Ready block to do this.
Let's go to the Unit RGB and select the ready block.
It's already implemented a set color set brightness method
The parameters are defined by the Pre-built
plug and play model, so don't worry about it. The UIflow know how to pass the
them to the hardware operations. I will copy this block.
And then select the set brightness so we keep both
method.
OK, that's all I want to deal with my device.
Now I want to show you the model that I create.
We can go to the model viewer. We can see the exact model that
created by the UIFlow.
When we adjust our design in this workspace, the model will
be changed on the fly to reflect the actual behavior of the
device.
The next step is to connect my device to the solution.
Normally the solution need to be configured specifically for
these devices, but for PnPFlow this is not necessary.
Let's go back to IoT central control panel. We can create a
template.
Just name my template.
And we can also create a device identity associated with this
template.
As you can see, the device ID and the device identity, which
is the device key, is automatically filled in this IoT
Central connection block.
So everything's ready.
Next step I will download the firmware, download the script
to the device.
Just click the RUN button.
And then I can use this small icon to go to the device page in
IoT Central application.
Here you can see.
There are a few tabs.
configured by this template.
There is a default About page displays the properties that we
just send to cloud and there is Overview page display the exact
telemetry we want to send to cloud, temperature, humidity and
the accelerometer data.
And also there is a Command page.
That we can use to control the device LED. For example, if I
want to set the first LED to red, I can do this.
All these things we just played in IoT Central is
automatically adapted for our device, because the template is
created based on the model that we compose in the UIFlow. I
didn't do any manual configuration.
Well this is all I want to show you today.
PnPflow is now in public preview.
We're still working on it, so more hardware will be supported
and customized plug and play model block will be supported later.
Feel free to have a try and give us some feedback.
Thanks for watching.