| page_type | sample | |||
|---|---|---|---|---|
| languages |
|
|||
| products |
|
|||
| name | Azure MXChip IoT DevKit State | |||
| description | Monitor DevKit states and control the user LED with Azure IoT Hub device twins. | |||
| urlFragment | sample |
In this tutorial, you can monitor the MXChip IoT DevKit WiFi information and sensor states and control the color of the user LED using Azure IoT Hub device twins.
The MXChip IoT DevKit (a.k.a. IoT DevKit) is an all-in-one Arduino compatible board with rich peripherals and sensors. You can develop for it using Azure IoT Device Workbench . And it comes with a growing projects catalog to guide you prototype Internet of Things (IoT) solutions that take advantage of Microsoft Azure services.
Finish the Getting Started Guide to:
- Have your DevKit connected to Wi-Fi.
- Prepare the development environment.
An active Azure subscription. If you do not have one, you can register via one of these two methods:
- Activate a free 30-day trial Microsoft Azure account.
- Claim your Azure credit if you are MSDN or Visual Studio subscriber.
- Start Visual Studio Code.
- Make sure Azure IoT Device Workbench is installed.
- Connect IoT DevKit to your PC.
Use F1 or Ctrl+Shift+P (macOS: Cmd+Shift+P) to open the command palette, type Azure IoT Device Workbench, and then select Open Examples....
Select IoT DevKit.
Then the IoT Device Workbench Example window is shown up.
Find DevKit State and click Open Sample button. A new VS Code window with a project folder in it opens.
A popup will show asking to restore packages. Click Restore to restore the NuGet packages for the Azure Functions app.
In the solution window, open the command palette and select Azure IoT Device Workbench: Provision Azure Services....
Then VS Code guides you through provisioning the required Azure services.
The whole process includes:
- Select an existing IoT Hub or create a new IoT Hub.
- Select an existing IoT Hub device or create a new IoT Hub device.
- Create a new Function App.
Please take a note of the Function App name and IoT Hub device name you created. It will be used in the next section.
Open Functions\State.cs and modify the following line with the device name you provisioned in previous step:
static readonly string deviceName = "";Open the command palette and select IoT Device Workbench: Deploy to Azure....
-
Switch the IoT DevKit into Configuration mode. To do so:
- Hold down button A.
- Push and release the Reset button.
-
The screen displays the DevKit ID and 'Configuration'.
-
Open the command palette and select Azure IoT Device Workbench: Configure Device Settings....
-
Select Config Device Connection string.
-
Then select Select IoT Hub Device Connection String.
-
Select Select IoT Hub Device Connection String.
This sets the connection string that is retrieved from the
Provision Azure servicestep. -
Click OK on the popup to confirm the device is in Configuration mode.
-
The configuration success notification popup bottom right corner once it's done.
-
Open the command palette and select IoT Device Workbench:Upload Device Code.
-
VS Code then starts verifying and uploading the code to your DevKit.
-
The IoT DevKit reboots and starts running the code.
- Open
<Path to project>\web\index.htmlin browser. - Input the Function App name you write down.
- Click connect button.
- You should see DevKit state in a few seconds.

















