Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vs/AzureIoTDeviceClientPY/v14 New function for Abandon a cloud-to-device message Jan 18, 2016
.gitignore First init Jan 18, 2016
AzureIoTDeviceClientPY.pyproj
AzureIoTDeviceClientPY.sln First init Jan 18, 2016
DeviceClient.py New api version Feb 20, 2018
LICENSE Initial commit Jan 18, 2016
README.md Update README.md Jan 18, 2016

README.md

Azure IoT Hub DeviceClient for Python

Basic library for Azure IoT Hub Device Messaging REST API. It doesn't implement all functions. Tested with Python 3.

import DeviceClient


# START: Azure IoT Hub settings
KEY = "xxxxx";
HUB = "xxxxx";
DEVICE_NAME = "xxxxx";
# END: Azure IoT Hub settings

device = DeviceClient.DeviceClient(HUB, DEVICE_NAME, KEY)

device.create_sas(600)

# Device to Cloud
print(device.send(b"{message: 'Hello from Python'}"))

# Cloud to Device
message = device.read_message()
print(message['body'])

device.complete_message(message['etag'])
You can’t perform that action at this time.