Skip to content

bechynsky/AzureIoTDeviceClientPY

Repository files navigation

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'])

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages