Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simps-cloud/aliyun-iot
使用Simps框架调用阿里云物联网平台服务(MQTT)
https://github.com/simps-cloud/aliyun-iot
aliyun aliyun-iot simps
Last synced: about 1 month ago
JSON representation
使用Simps框架调用阿里云物联网平台服务(MQTT)
- Host: GitHub
- URL: https://github.com/simps-cloud/aliyun-iot
- Owner: simps-cloud
- License: apache-2.0
- Created: 2020-05-08T01:32:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-30T08:33:15.000Z (almost 4 years ago)
- Last Synced: 2024-10-01T18:09:47.800Z (about 2 months ago)
- Topics: aliyun, aliyun-iot, simps
- Language: PHP
- Homepage: https://qq52o.me/2752.html
- Size: 13.7 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simps & Aliyun IOT
使用 [Simps框架](https://github.com/simple-swoole/simps) 调用 [阿里云物联网平台](https://iot.console.aliyun.com) 服务(MQTT)
## 安装
使用`composer`进行安装或者直接使用`git clone`源码
```shell
composer create-project simps-cloud/aliyun-iotgit clone [email protected]:simps-cloud/aliyun-iot.git
```## 使用
* 前往 [阿里云物联网平台](https://iot.console.aliyun.com) 创建产品和设备,[参考文档](https://help.aliyun.com/document_detail/73705.html)
* 创建`config/aliyuniot.php`配置文件
```php
"{$YourProductKey}.iot-as-mqtt.{$region}.aliyuncs.com", // 连接域名
'port' => 1883, // 端口默认1883
'keepalive' => 300, // 心跳
'client_id' => "d812edc1-18da-2085-0edf-a4a588c296d1", // clientID
'device_name' => "",
'device_secret' => "",
'product_key' => "",
'product_secret' => "",
];
```* 订阅
```shell
php bin/subscribe.php
```
* 发布```shell
php bin/simps.php http:startcurl http://127.0.0.1:9501/
```⚠️内置的 MQTTClient 已标记废弃,请使用 [simps/mqtt](https://github.com/simps/mqtt)
🎉详细说明参考博客[《基于Swoole使用MQTT协议连接阿里云物联网平台设备实现消息订阅》](https://qq52o.me/2752.html)
⭐️支持请前往点个Star:[Simps](https://github.com/simple-swoole/simps)