# FogCloud YAT Product Access Protocol
#1. Description
- The identification code of the Fog platform is: 0x10
- When connecting modules to the Fog platform, it is necessary to burn triplets using a one machine, one code method.
- Triples can be burned by Qingke or by customers themselves.
#2. Product Configuration Format
pk: ProductKey
ps: ProductSecret
dn: DeviceName
ds: DeviceSecret
{ "pk": "123", "ps": "456", "dn": "asd", "ds": "zxc", }
#3. Network Configuration
Fog platform distribution method: Bluetooth distribution network.
The format is as follows: MCU->WiFi
CMD | PAYLOAD | |||
Cloud Code | Type | TimeOut | Description | |
0x13 | 0x00 | 0x00 | 2 Byte | EMC Series: Bluetooth distribution network |
0x10 | 0x00 | 2 Byte | EMC Series: Bluetooth distribution network | |
0x03 | 2 Byte | Bluetooth distribution network |
#4. JSON for Data Communication
If you choose to use JSON format as the attribute communication method between MCU and WiFi module for data communication, as the Fog platform data is divided into attributes, events, and services, MCU needs to distinguish data types.
Note: JSON is provided based on actual product functions
#4.1. Attribute Reporting
MCU->WiFi
CMD | PAYLOAD | Description | |
Type | JSON | JSONformat data n value range from 1 ~1023 | |
0x27 | 0x01 | n Byte | Attribute Reporting |
WiFi->MCU None
#4.2. Attribute Distribution
WiFi->MCU
CMD | PAYLOAD | Description | |
Type | JSON | JSONformat data n value range from 1 ~1023 | |
0x27 | 0x01 | n Byte | Attribute distribution |
MCU->WiFi None The format of attribute distribution is consistent with that of Attribute Reporting
#4.3. Event Reporting
MCU->WiFi
CMD | PAYLOAD | Description | |||
Type | EventID Length | EventID | JSON | JSONformat data nvalue range from 1~1020 | |
0x27 | 0x02 | 1 Byte | n Byte | n Byte |
EventID Length: Length of event ID EventID:event ID,string type WiFi->MCU None
#4.4. Service Distribution
WiFi->MCU
CMD | PAYLOAD | Description | |||
Type | ServiceID Len | ServiceID | JSON | JSONformat data n value range from 1 ~1023 | |
0x27 | 0x03 | 1 Byte | n Byte | n Byte | Service Distribution |
ServiceID Len: length of service ID serviceID:service ID,string type MCU->WiFi None
#5. Data Communication of RAW-TLV
#5.1. Attribute Configuration Table Rules
The attribute configuration table of RAW-TLV mode is stored in the cloud.
Script:
Modify the profile, replace the profile in fog.js, and upload it to the Fog backend.
Note: TLV is provided based on actual product attributes and functions.
#6. Cli
Switch Environment:
fog_env <env>(0:product, 1:dev, 2:beta)
Triple Burning:
fog keys. fogke [<fog_pk> <fog_ps><fog_dn><fog_ds>]
Private Domain Name Settings:
fog_private_domain eu-dev.fogcloud.io eu-dev.fogcloud.io
———————————————————————————————————————
END.
若有收获,就点个赞吧