cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Connect MXChip to Azure IoT

No ratings

 

 

Send data from an MXChip Developer kit to your Azure IoT Hub

 

GUIDE CONCEPT

 

Users of the MXChip IoT DevKit (a.k.a. MXChip), follow these quick steps to send temperature and humidity data from built-in IoT DevKit sensors to the Azure IoT Hub.

 

YOU'LL LEARN HOW TO

 

  • Connect the IoT DevKit to a wireless access point
  • Create an Azure IoT Hub and register a device for the IoT DevKit
  • Connect IoT Devkit to Azure IoT Hub

 

NOTE: This guide's content aligns with ThingWorx 9.3. The estimated time to complete this guide is 80 minutes

 

Step 1: Create an Azure IoT Hub

 

  1. Choose +Create a resource, then choose Internet of Things.

  2. Click Iot Hub from the list on the right. You see the first screen for creating an IoT hub.

IoTProductMgmt_0-1666106202697.png

 

Fill in the fields.

 

Subscription: Select the subscription to use for your IoT hub.

 

Resource Group: You can create a new resource group or use an existing one. To create a new one, click Create new and fill in the name you want to use. To use an existing resource group, click Use existing and select the resource group from the dropdown list.

 

Region: This is the region in which you want your hub to be located. Select the location closest to you from the dropdown list.

 

IoT Hub Name: Put in the name for your IoT Hub. This name must be globally unique. If the name you enter is available, a green check mark appears.

 

      3. Click Next: Size and scale to continue creating your IoT hub.

 

IoTProductMgmt_1-1666106202696.png

 

On this screen, you can take the defaults and just click Review + create at the bottom.

 

Pricing and scale tier: You can choose from several tiers depending on how many features you want and how many messages you send through your solution per day. The free tier is intended for testing and evaluation. It allows 500 devices to be connected to the IoT hub and up to 8,000 messages per day. Each Azure subscription can create one IoT Hub in the free tier.

 

IoT Hub units: The number of messages allowed per unit per day depends on your hub’s pricing tier. For example, if you want the IoT hub to support ingress of 700,000 messages, you choose two S1 tier units.

 

Advanced / Device-to-cloud partitions: This property relates the device-to-cloud messages to the number of simultaneous readers of the messages. Most IoT hubs only need four partitions.

       

      4. Click Review + create to review your choices. You see something similar to this screen.

 

IoTProductMgmt_2-1666106202685.png

 

      5. Click Create to create your new IoT hub. Creating the hub takes a few minutes.

 

 

Step 2: Create IoT device

 

  1. Navigate to the IoT Hub created and in the IoT Devices page, click + New.

    add_iot_device.png

 

2. Enter the device ID used by the demo MXChip application MyNodeDevice. Use the default settings for auto-generating authentication keys and connecting the new device to your hub. Click Save.

create_device.png

 

3. Navigate to the device created and make a note of the device connection string, which looks like: HostName={YourIoTHubName}.azure-devices.net;DeviceId=MyNodeDevice;SharedAccessKey={YourSharedAccessKey}.

device_connection_string.png

 

Create Azure Storage

 

  1. The ThingWorx Azure IoT Connector we will install in the next guide requires an Azure Storage Account. Follow the Microsoft documentation to create an Azure Storage account.

NOTE: Select Blob storage as the account type and the Hot Access Tier.

 
 

Step 3: Connect to Azure IoT Hub

 

  1. Download the latest version of GetStarted firmware for IoT DevKit.
  2. Connect IoT DevKit to your computer via USB. In Windows you see a new USB mass storage device in Windows Explorer called AZ3166.
  3. Drag and drop the .bin file you downloaded from step 1 into the disk named AZ3166 and wait for IoT Devkit to restart.
  4. Internet connectivity is required to connect to Azure IoT Hub. Use AP Mode on the DevKit to configure and connect to Wi-Fi.Hold down button B, push and release the Reset button, and then release button B. Your IoT DevKit enters AP mode for configuring the Wi-Fi connection. The screen displays the service set identifier (SSID) of the DevKit and the configuration portal IP address:
     

    wifi-ap.jpg

 

5. Use a Web browser on a different Wi-Fi enabled device (computer or mobile phone) to connect to the IoT DevKit SSID displayed in the previous step. If it asks for a password, leave it empty.

 

connect-ssid.png

 

6. Open 192.168.0.1 in the browser. Select or input the Wi-Fi network that you want the IoT DevKit to connect to, type the password for the Wi-Fi conection and input the device connection string you made notge of in step 1. Then click Connect.

 

wifi-portal.png

 

7. The WiFi credentials and device connection string will be saved in the IoT DevKit even after power cycliong. The following page will be displayed in the browser:

 

set_succeed.png

 

8. The IoT DevKit reboots in a few seconds. You then see the assigned Wi-Fi IP address on the screen of the IoT DevKit:

 

wifi-ip.jpg

 

9. Wait for the IoT DevKit to connect to Azure IoT Hub and you will see it sending telemetry data including temperature and humidity value to Azure IoT Hub. The screen of the IoT Devkit would show message count and temperature/humidity data.

 

sending_data.jpg

 

 

Step 4: Next Steps

 

Congratulations! You've successfully completed the Connect MXChip to Azure IoT guide. By following the steps in this lesson, you created an Azure IoT Hub and device.

 

 

The next guide in the Azure MXChip Development Kit learning path is Create an Application Key.

 

Learn More

 

We recommend the following resources to continue your learning experience:

 

CapabilityGuide
AnalyzeBuild a Predictive Analytics Model
BuildGet Started with ThingWorx for IoT

 

Additional Resources

 

If you have questions, issues, or need additional information, refer to:

 

ResourceLink
CommunityDeveloper Community Forum
SupportAzure Support Page

 

 

Version history
Last update:
‎Nov 17, 2022 04:54 PM
Updated by:
Labels (2)
Contributors