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`。 - :ref:`AT+GWDEVICENAME `:Set the BLE network device name - :ref:`AT+GWCONFIGEN `:Enable Guangyun APP network distribution mode - :ref:`AT+GWCONNECTCONFIG `:Set the key parameters of the cloud device - :ref:`AT+GWHTTPCLIENTLINE `:The process for downloading certificates is enabled - :ref:`AT+GWAWSCONNECT `:Enable connection - :ref:`AT+GWAWSPUB `:post data .. _cmd-GWDEVICENAME: AT+GWDEVICENAME:Configure the Bluetooth name and PID for the distribution network. ------------------------------------------ executive command ^^^^^^^^ **command:** :: AT+GWDEVICENAME=<“Bluetooth name”>, **response:** :: OK parameter ^^^^ - ****:The value is a string of characters. The device name displayed during network configuration generally starts with granwin - ****: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 .. _cmd-GWCONFIGEN: 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 .. _cmd-GWCONNECTCONFIG: AT+GWCONNECTCONFIG:Set the key parameters of the cloud device. ------------------------------------------ executive command ^^^^^^^^ **command:** :: AT+GWCONNECTCONFIG=<“clientId”>,<"Secret“>,<“productKey”> **response:** :: OK parameter ^^^^ - ****:Client ID. - ****:Device 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 .. _cmd-GWHTTPCLIENTLINE: 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 .. _cmd-GWAWSCONNECT: AT+GWAWSCONNECT:Enable the connection. ------------------------------------------ executive command ^^^^^^^^ **command:** :: AT+GWAWSCONNECT= **response:** :: OK parameter ^^^^ - ****: - 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 .. _cmd-GWAWSPUB: AT+GWAWSPUB:post data ------------------------------------------ executive command ^^^^^^^^ **command:** :: AT+GWAWSPUB=,, **response:** :: OK parameter ^^^^ - ****: - 0: topic: ${productKey}/${thingName}/user/update - 1: topic: ${productKey}/${thingName}/user/property/query_response - 2: topic: ${productKey}/${thingName}/user/ota/firmware/report - ****: - json character string - ****: - 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