Skip to Content
Hands-On Edge Analytics with Azure IoT
book

Hands-On Edge Analytics with Azure IoT

by Colin Dow
May 2020
Intermediate to advanced
262 pages
6h 48m
English
Packt Publishing
Content preview from Hands-On Edge Analytics with Azure IoT

Creating simulated sensor data using Python

For our temperature sensor, we will simulate it using a Python program. You may use the same Windows computer running Device Explorer or a separate one. You may use your favorite Python development platform or the command line. Please ensure that you are using version 3.7 or higher of Python:

  1. Before we can connect to our Azure IoT Hub with Python, we will require the appropriate libraries. Using pip, install the Azure IoT Device library with the following command:
pip install azure-iot-device
  1. In your favorite Python editor, create a new Python file and name it SimulatedDevicePython.py.
  1. Enter the following code into the file and save it:
from azure.iot.device import IoTHubDeviceClient, Message ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

David Jensen

Publisher Resources

ISBN: 9781838829902Supplemental Content