simps-cloud / aliyun-iot
calling AliYun IoT services using the Simps framework.
Installs: 52
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 3
Forks: 3
Open Issues: 0
Type:project
Requires
- php: >=7.1
- ext-swoole: >=4.4
- simple-swoole/simps: dev-master
This package is auto-updated.
Last update: 2024-10-29 05:41:17 UTC
README
使用 Simps框架 调用 阿里云物联网平台 服务(MQTT)
安装
使用composer
进行安装或者直接使用git clone
源码
composer create-project simps-cloud/aliyun-iot git clone git@github.com:simps-cloud/aliyun-iot.git
使用
<?php return [ 'host' => "{$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' => "", ];
- 订阅
php bin/subscribe.php
- 发布
php bin/simps.php http:start curl http://127.0.0.1:9501/
⚠️内置的 MQTTClient 已标记废弃,请使用 simps/mqtt
🎉详细说明参考博客《基于Swoole使用MQTT协议连接阿里云物联网平台设备实现消息订阅》
⭐️支持请前往点个Star:Simps