PHP code example of simps-cloud / aliyun-iot

1. Go to this page and download the library: Download simps-cloud/aliyun-iot library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

simps-cloud / aliyun-iot example snippets




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' => "",
];
shell
php bin/subscribe.php
shell
php bin/simps.php http:start

curl http://127.0.0.1:9501/