Aliyun-python-sdk-iot
This is the iot module of Aliyun Python SDK.
Aliyun Python SDK is the official software development kit. It makes things easy to integrate your Python application, library, or script with Aliyun services.
This module works on Python versions:
2.6.5 and greater
Documentation:
Please visit http://develop.aliyun.com/sdk/python
**python demo**
``` python
# -*- coding: utf-8 -*-
import aliyunsdkiotclient.AliyunIotMqttClient as iot
import ConfigParser
import json
config = ConfigParser.ConfigParser()
config.read('mqtt.cfg')
productKey = config.get('device', 'productKey')
deviceName = config.get('device', 'deviceName')
deviceSecret = config.get('device', 'deviceSecret')
clientId = config.get('device', 'clientId')
certPath = config.get('server', 'tslCertPath')
host = productKey + '.' + config.get('server', 'host')
port = config.getint('server', 'port')
def on_connect(client, userdata, flags_dict, rc):
print("Connected with result code " + str(rc))
# Subscribing in on_connect() means that if we lose the connection
topic = '/' + productKey + '/' + deviceName + '/data'
client.subscribe(topic, 0)
# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
topic = '/' + productKey + '/' + deviceName + '/update'
print(msg.payload)
data = {'pm25': 10, 'pm10': 30, 'deviceName': deviceName}
client.publish(topic, payload=json.dumps(data))
if __name__ == '__main__':
client = iot.getAliyunIotMqttClient(productKey, deviceName, deviceSecret, secure_mode=3)
client.on_connect = on_connect
client.on_message = on_message
client.connect(host=host, port=port, keepalive=60)
client.loop_forever()
```
.. :changelog:
Release History
---------------
0.0.1 (2018-02-13)
++++++++++++++++++
0.0.5 (2018-02-23)
++++++++++++++++++
bugfix
This is the iot module of Aliyun Python SDK.
Aliyun Python SDK is the official software development kit. It makes things easy to integrate your Python application, library, or script with Aliyun services.
This module works on Python versions:
2.6.5 and greater
Documentation:
Please visit http://develop.aliyun.com/sdk/python
**python demo**
``` python
# -*- coding: utf-8 -*-
import aliyunsdkiotclient.AliyunIotMqttClient as iot
import ConfigParser
import json
config = ConfigParser.ConfigParser()
config.read('mqtt.cfg')
productKey = config.get('device', 'productKey')
deviceName = config.get('device', 'deviceName')
deviceSecret = config.get('device', 'deviceSecret')
clientId = config.get('device', 'clientId')
certPath = config.get('server', 'tslCertPath')
host = productKey + '.' + config.get('server', 'host')
port = config.getint('server', 'port')
def on_connect(client, userdata, flags_dict, rc):
print("Connected with result code " + str(rc))
# Subscribing in on_connect() means that if we lose the connection
topic = '/' + productKey + '/' + deviceName + '/data'
client.subscribe(topic, 0)
# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
topic = '/' + productKey + '/' + deviceName + '/update'
print(msg.payload)
data = {'pm25': 10, 'pm10': 30, 'deviceName': deviceName}
client.publish(topic, payload=json.dumps(data))
if __name__ == '__main__':
client = iot.getAliyunIotMqttClient(productKey, deviceName, deviceSecret, secure_mode=3)
client.on_connect = on_connect
client.on_message = on_message
client.connect(host=host, port=port, keepalive=60)
client.loop_forever()
```
.. :changelog:
Release History
---------------
0.0.1 (2018-02-13)
++++++++++++++++++
0.0.5 (2018-02-23)
++++++++++++++++++
bugfix
Metadata
Release files for aliyun-python-sdk-iot-client 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aliyun-python-sdk-iot-client-0.0.14.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aliyun_python_sdk_iot_client-0.0.14-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 13.5 kB
Release files / aliyun-python-sdk-iot-client-0.0.14.tar.gz
| Download URL | aliyun-python-sdk-iot-client-0.0.14.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9cc5c1984468a0b51c4bb12f31cf21c8ba000e57c23284559ea2f415bdbbda02
|
|
BLAKE2b-256 checksum How to use checksums |
255974ce64d442a61af4caf4ee84eea13d5d795a8109d8cb10c9198ea1359cdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15
|
Release files / aliyun_python_sdk_iot_client-0.0.14-py2.py3-none-any.whl
| Download URL | aliyun_python_sdk_iot_client-0.0.14-py2.py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a7e7e38d96cf35b4af24672d3268bbb7d547ac11fd3c3d000f36617b18ae5746
|
|
BLAKE2b-256 checksum How to use checksums |
53870f9bdcef34b66891e131402470fc7aba42e9b0dc6dbf27a9690591ef7c1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15
|