Cloud platform interconnection commands

This chapter describes the instruction set for connecting to the platform of Guangyun Internet of Things. This instruction set will be adapted to different modules. Please refer to the detailed differences:doc:../instruction/other/firmware_differences

AT+GWDEVICENAME:Configure the Bluetooth name and PID for the distribution network.

executive command

command:

AT+GWDEVICENAME=<“Bluetooth name”>,<Manufacturer PID>

response:

OK

parameter

  • <Bluetooth name>:The value is a string of characters. The device name displayed during network configuration generally starts with granwin

  • <Manufacturer PID>:Integer, 1-65535 Generally provided by the Guangyun platform

explain

  • Set the BLE network configuration device name. Note: This parameter must be configured before enabling the BLE network configuration mode.

example

//Set the BLE network device name
AT+GWDEVICENAME="granwin_dev",137

OK

AT+GWCONFIGEN:Enable Guangyun APP network distribution mode.

executive command

command:

AT+GWCONFIGEN

response:

+EVENT:BLE_CONNECT

+EVENT:BLE_DISCONNECT

+EVENT:BLE_CONNECT

+EVENT:WIFI_CONNECT

+EVENT:WIFI_GOT_IP

+EVENT:BLE_DISCONNECT

OK

explain

  • Enable Guangyun APP network distribution mode.

example

//Enter the BLE network configuration mode
AT+GWCONFIGEN

+EVENT:BLE_CONNECT

+EVENT:BLE_DISCONNECT

+EVENT:BLE_CONNECT

+EVENT:WIFI_CONNECT

+EVENT:WIFI_GOT_IP

+EVENT:BLE_DISCONNECT

AT+GWCONNECTCONFIG:Set the key parameters of the cloud device.

executive command

command:

AT+GWCONNECTCONFIG=<“clientId”>,<"Secret“>,<“productKey”>

response:

OK

parameter

  • <client_id>:Client ID.

  • <secret>:Device key.

  • <product_key>:Product key.

explain

  • Set the key parameters of the cloud device. Note: The key parameters are obtained from the platform of Wuyun and need to be configured before downloading the certificate and enabling the connection.

example

//Set Configuration connection parameters
AT+GWCONNECTCONFIG="xxxxxxxxx","xxxxxxxxx","xxxxxxxxxxxx"

OK

AT+GWHTTPCLIENTLINE:The process for downloading certificates is enabled.

executive command

command:

AT+GWHTTPCLIENTLINE

response:

+EVENT:GET TIME:1678693267532
+EVENT:GET TOKEN SUCCESS
+EVENT:GET PRIVATEKEY CART SUCCESS
+EVENT:GET DEVICE CART SUCCESSS

OK

explain

  • Set the key parameters of the cloud device. Note: The key parameters are obtained from the platform of Wuyun and need to be configured before downloading the certificate and enabling the connection.

example

//Set the BLE network device name
AT+SECRET=KZh1eMgxxxxxxxxxx,fdjfGHe1xxxxxx,EJK6xxxxxxxx

OK

AT+GWAWSCONNECT:Enable the connection.

executive command

command:

AT+GWAWSCONNECT=<enable>

response:

OK

parameter

  • <enable>
    • 0:disconnect

    • 1:connection

explain

  • Enable the connection. Note: You need to complete the certificate before you can connect. After completing the connection, the device will subscribe to the related topic by default.

example

//Enable connection
AT+GWAWSCONNECT=1

OK

AT+GWAWSPUB:post data

executive command

command:

AT+GWAWSPUB=<type>,<payload>,<qos>

response:

OK

parameter

  • <type>
    • 0: topic: ${productKey}/${thingName}/user/update

    • 1: topic: ${productKey}/${thingName}/user/property/query_response

    • 2: topic: ${productKey}/${thingName}/user/ota/firmware/report

  • <payload>
    • json character string

  • <qos>
    • 0:qos0

    • 1:qos1

    • 2:qos2

explain

  • Publish the data. Note: The content released is the content of json data object in the data protocol of Guangyun Internet of Things platform, which involves special symbols “which need to be escaped\”

example

//post data
AT+GWAWSPUB=0,"{\"switch\":{\"type\":1,\"value\":1}}",0

OK