Getting Started Azure IoT Hub

Azure IoT Fundamentals

https://github.com/Azure-Samples/azureiotlabs

Overview of Azure IoT Hub

Quick Starts

0. Install Azure Cli

$ brew update && brew upgrade azure-cli
$ az extension add --name azure-cli-iot-ext
  1. Send Telemetry (Python)

1.1 Create an IoT hub

1.2 Register a device

known bug with MacOS and Python3.5

1.3 Send simulated telemetry

1.4 Read telemetry from your hub

2. Control a device (Python)

Register a device

  1. Add the IoT Hub CLI extension and create the device identity. Replace {YourIoTHubName} with the name of your IoT hub:
$ az extension add --name azure-cli-iot-ext 
$ az iot hub device-identity create --hub-name {YourIoTHubName} --device-id MyPythonDevice

2. Run the following command to get the device connection string for the device you just registered:

$ az iot hub device-identity show-connection-string — hub-name {YourIoTHubName} — device-id MyPythonDevice — output table

3. You also need a service connection string to enable the back-end application to connect to your IoT hub and retrieve the messages. The following command retrieves the service connection string for your IoT hub:

$ az iot hub show-connection-string — hub-name {YourIoTHubName} — output table

Call the direct method

The back-end application connects to a service-side endpoint on your IoT Hub. The application makes direct method calls to a device through your IoT hub and listens for acknowledgements. An IoT Hub back-end application typically runs in the cloud.

Troubleshooting:

https://developers.de/2018/08/13/device-identity-is-not-in-the-az-iot-hub

    Dr. Warodom Khamphanchai

    Written by

    Full Stack Developer, Hardware Hacker, Ex-Software Developer in Silicon Valley, Interested in IoT, Machine Learning, AI, and Technology Entrepreneurship

    PEA HiVE Platform

    Follow us to get the latest news of PEA HiVE Platform

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade