Azure IoT with Python

Teerapong Ponmat
Jul 26, 2017 · 2 min read
  1. install python sdk

1.1 check cmake and gcc in env

cmake –version

gcc –version

1.2 install A Python SDK for connecting devices to Microsoft Azure IoT services

1.3 git clone --recursive https://github.com/Azure/azure-iot-sdk-python.git

*–recursive can clone anathor rapo to folder c @ 3290e56

  1. 4 setup and build at folder azure-iot-sdk-python/build_all/linux/

in link

2) test publish mqtt

2.1 create IoT hub in AZURE

2.2 publish mqtt to Azure

2.2.1 create iot device in Azure

2.2.1 change code in python sample file

CONNECTION_STRING = “HostName= — — -.azure-

devices.net;DeviceId=CoolingSampleDevice_0925;SharedAccessKey= — —

KlOAujkFakeqs2U46GCHybT — -=”

2.2 Subscribe mqtt to Azure

2.2.1. create stream process

2.2.2 create service bus topic,

and add bus topic (name home1)

2.2.3 modify stream process (input, Query,output)

2.2.3.4 select input with iothub name

2.2.3.4 Query

2.2.3.4 Output

add output with Hive02 by select output in servicebus name(Hive02) and topic name(home1)

2.4 test subscribe data by python

Teerapong Ponmat

Written by

Full Stack Developer mostly Python

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