EnOS MQTT SDK for Python
Using EnOS Device SDK for Python
Table of Contents
- Feature List
- Quick Start
- Sample Codes
- Related Information
- Release Notes
The EnOS Device SDK for Python allows developers to write Python scripts to use their devices to access EnOS IoT hub through MQTT.
To use the EnOS Device SDK, you will need Python 3.5.3 or later, and
pip is required. Note that Python 2.x is not recommended as some functions might not be compatible with Python 2.x in future SDK versions.
If you are upgrading from an earlier version of EnOS Device SDK for Python, you need to change the path of the SDK package by adding
enos prefix in your "Import" statement in the existing Python codes to use the latest version.
You can install the SDK from pip, or build from source.
Installing from pip
The latest version of EnOS Device SDK for Python is available in the Python Package Index (PyPi) and can be installed using
pip install enos-mqtt-sdk-python
setuptools if necessary:
pip install --upgrade setuptools
Building From Source
Obtain the source code of EnOS Device SDK for Python.
- From GitHub:
git clone https://github.com/EnvisionIot/enos-mqtt-sdk-python.git
- From EnOS SDK Center. Click SDK Center from the left navigation of EnOS Console, and obtain the SDK source code by clicking the GitHub icon in the Obtain column.
From the directory where the source code is stored, run the following command:
python setup.py install
For the list of features supported by this SDK and the availability of EnOS device connectivity and management features in all SDKs we provide, see EnOS Device SDK.
- Create an MQTT client and connect it to EnOS Cloud using the secret-per-device authentication:
client = MqttClient(enos_mqtt_url, product_key, device_key, device_secret) client.connect()
- Build a request to post a measurement point and publish the request using the connected client.
measure_point_post_request = MeasurepointPostRequest.builder() .add_measurepoint('measurepoint_id', measurepoint_value) .set_timestamp(timestamp) .build() # publish request and wait for the response measure_point_response = client.publish(measure_point_post_request)
- Close the connection
- Establishing Connection with EnOS Cloud
- Device Tag Operations
- Device Attribute Operations
- Reporting Measurement Points
- Reporting Events
- Receiving Commands from Cloud
- Passing Through Device Information or Receiving Passed-through Information from Cloud
- Managing Sub-devices
- To learn more about EnOS IoT Hub, see EnOS IoT Hub Documentation.
- To learn more about how to develop your device for EnOS IoT Hub, see EnOS Device Development Guide (Python).
- 2019/11/15(0.1.0): Reconstruction and new functions added.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size enos_mqtt_sdk_python-0.1.0-py3-none-any.whl (102.0 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size enos-mqtt-sdk-python-0.1.0.tar.gz (49.5 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for enos_mqtt_sdk_python-0.1.0-py3-none-any.whl
Hashes for enos-mqtt-sdk-python-0.1.0.tar.gz