Device Parameter Configuration Documentation¶
Overview¶
This document outlines the process for configuring parameters on a device (e.g., a VCUA device) via MQTT. The configuration includes setting the Access Point Name (APN), upload frequency (GPRS Sleep Time Window), Fleet ID (FLID), and recharging the device using a public key or recharge code. Each task involves publishing a command to a specific MQTT topic, with the device responding via a status payload. The instructions assume the use of an MQTT client (e.g., MQTT Explorer) and a device with an ID such as VCUA2404000000.
The sample payload provided is a JSON object returned by the device, containing five main sections: att (attributes), cmd (commands), sts (status), dta (data), and dia (diagnostics). Each section includes key-value pairs where keys are acronyms, and this documentation expands them into full descriptions for clarity.
Configuration Tasks¶
1. Configure APN Settings¶
Purpose: Sets the Access Point Name (APN) for the device’s GPRS connection to connect to the carrier’s network.
Steps:
- Log in to MQTT Client: Open your MQTT client (e.g., MQTT Explorer) and connect to the broker.
- Publish Command:
- Topic: cmd/V01/GPRSV2//VCUA/[DEVICE_ID]
- Replace [DEVICE_ID] with the actual device ID (e.g., VCUA2404000000).
-
Payload:
json
CollapseWrapCopy
{ "set": { "apn": "[APN_NAME]" } }- Replace [APN_NAME] with your carrier’s APN (e.g., orange.m2m.spec).
- Topic: cmd/V01/GPRSV2//VCUA/[DEVICE_ID]
Example:
- Topic: cmd/V01/GPRSV2//VCUA/VCUA2404000000
-
Payload:
json
CollapseWrapCopy
{ "set": { "apn": "orange.m2m.spec" } }
Confirmation: The device responds with a status payload (see "Sample Device Payload" section) where the cmd.napn field reflects the updated APN (e.g., "orange.m2m.spec").
2. Set Upload Frequency¶
Purpose: Configures the GPRS Sleep Time Window (gstw), which determines how often the device uploads data (in minutes). The minimum value is 6 minutes.
Steps:
- Publish Command:
- Topic: cmd/V01/GPRSV2//VCUA/[DEVICE_ID]
-
Payload:
json
CollapseWrapCopy
{ "set": { "gstw": 60 } }- The value (60) represents 60 minutes. Adjust as needed, ensuring it’s greater than 6.
Example:
- Topic: cmd/V01/GPRSV2//VCUA/VCUA2404000000
-
Payload:
json
CollapseWrapCopy
{ "set": { "gstw": 60 } }
Confirmation: The device updates cmd.gstw in the status payload (e.g., 60), confirming the new upload frequency.
3. Set FLID ID¶
Purpose: Assigns a custom Fleet ID (flid) to the device for identification within a group or fleet.
Steps:
- Publish Command:
- Topic: cmd/V01/GPRSV2/fleet/VCUA/[DEVICE_ID]
-
Payload:
json
CollapseWrapCopy
{ "set": { "flid": ["CUSTOM_VALUE"] } }- Replace CUSTOM_VALUE with your desired identifier (e.g., "willing"). Note that flid is an array.
Example:
- Topic: cmd/V01/GPRSV2//VCUA/VCUA2404000000
-
Payload:
json
CollapseWrapCopy
{ "set": { "flid": ["willing"] } }
Confirmation: The device updates att.flid in the status payload (e.g., "willing" instead of an empty string).
4. Recharge the Device¶
Purpose: Recharges the device’s PAYG (Pay-As-You-Go) credit using a recharge code, extending its operational days.
Steps:
- Publish Command:
- Topic: cmd/V01/GPRSV2//VCUA/[DEVICE_ID]
-
Payload:
json
CollapseWrapCopy
{ "set": { "pubk": "[RECHARGE_CODE]" } }- Replace [RECHARGE_CODE] with the recharge code (e.g., *015 596 899 441 605 616 031#).
Example:
- Topic: cmd/V01/GPRSV2//VCUA/VCUA2404000000
-
Payload:
json
CollapseWrapCopy
{ "set": { "pubk": "*015 596 899 441 605 616 031#" } }
Confirmation: The device updates cmd.pubk with the new code and adjusts sts.rcrd (Remaining Credit Days) in the status payload (e.g., from 1 to 11 days).
Sample Device Payload¶
The device responds to configuration commands or status requests with a JSON payload. Below is a sample payload with explanations:
json
CollapseWrapCopy
{
"att": {
"opid": "VCUA2404000000",
"ppid": "VCUA2404000000<<<<<<",
"flid": "",
"ccid": "89330123607808970780",
"frmv": "4.0.6"
},
"cmd": {
"pubk": "*015 596 899 441 605 616 031#",
"gstw": 60,
"gctw": 59,
"napn": "orange.m2m.spec",
"swch": 0,
"read": 0,
"rptm": 0,
"raml": [],
"hbfq": 1
},
"sts": {
"sstc": 0,
"crtm": "",
"udtm": "",
"time": "",
"plat": 0.00,
"plon": 0.00,
"gpss": 28,
"gpfc": 0,
"rcrd": 0,
"trhd": 0,
"tpgd": 0,
"pgst": 1,
"tkre": 0,
"ocst": 1
},
"dta": {
"batp": 1991,
"inpp": 1991,
"outp": 0,
"aeng": 1319,
"pckv": 73400,
"pckc": 27136,
"rsoc": 81,
"rcap": 24170,
"fccp": 30530,
"pckt": 0,
"acyc": 43,
"slon": 0.00,
"slat": 0.00,
"salt": 0,
"sstm": " ",
"sgps": 0,
"sspe": 0,
"ppst": 448,
"pmcs": 0,
"cmos": 1,
"dmos": 1,
"ctmp": 35,
"mtpm": 0,
"mtrd": 3218,
"tspd": 31,
"rvlt": 73,
"rcur": -24036,
"rmax": 0,
"cmxs": 12000,
"cmxc": 900
},
"dia": {
"cv01": 3223,
"cv02": 3229,
"cv03": 3225,
"cv04": 3224,
"cv05": 3225,
"cv06": 3228,
"cv07": 3222,
"cv08": 3229,
"cv09": 3226,
"cv10": 3226,
"cv11": 3226,
"cv12": 3224,
"cv13": 3227,
"cv14": 3224,
"cv15": 3223,
"cv16": 3228,
"cv17": 3224,
"cv18": 3217,
"cv19": 3223,
"cv20": 3223,
"cv21": 3221,
"cv22": 3220,
"cv23": 3227,
"pkt1": 30,
"pkt2": 29,
"pkt3": 29,
"pkt4": 30,
"pkt5": 32,
"pkt6": 31
}
}
Key Sections Explained¶
- att (Attributes): Contains device identification and firmware details.
- cmd (Commands): Reflects the current configuration settings and last commands sent.
- sts (Status): Provides operational status and PAYG-related information.
- dta (Data): Includes battery, power, and environmental data.
- dia (Diagnostics): Reports cell voltages and temperatures for diagnostic purposes.
List of Acronyms with Full Meanings¶
Below is a comprehensive list of acronyms from the sample payload, with their full meanings as provided or inferred from context:
att (Attributes)¶
- opid: OEM Device ID. Factory set.
- ppid: PAYG Device ID. Factory set. Field override options.
- flid: Fleet ID. Factory set. Field override options.
- ccid: Cellular SIM Card ID (ICCID).
- frmv: Firmware Version. Factory set.
cmd (Commands)¶
- pubk: Public Key / Last Code
- gstw: GPRS Sleep Time Window in mins
- gctw: GPRS Connect Time Window in mins
- napn: GPRS Carrier APN Name
- swch: Generic device switch swch
- read: Last read request of ANY GATT = [opid|...|]
- rptm: Set notification request mode = [0|1|2|3|4], 0: Auto-Periodic | 1 = Request-Response | 2 = Change-Notification
- raml: Reserved AML (unknown context; possibly a list of reserved values)
- hbfq: Heart Beat Interval Minutes
sts (Status)¶
- sstc: System Status Code
- crtm: Created at time
- udtm: Update at time
- time: Device internal timer readout at last communication
- plat: Device GPS Latitude
- plon: Device GPS Longitude
- gpss: GPS Signal Strength in db
- gpfc: GPRS Connect Failure Counts
- rcrd: Remaining Credit Days
- trhd: Total Running History Days
- tpgd: PAYG Running Days
- pgst: PAYG State = PAYG | FREE
- tkre: Token response = NEW | REPEAT | ERROR
- ocst: Device Output State
dta (Data)¶
- batp: Battery Net Charging Power W
- inpp: Total Input Power W
- outp: Output Power W
- aeng: Accumulated Energy Output in Whs
- pckv: Pack Voltage mV
- pckc: Pack Current in mA
- rsoc: Relative State of Charge
- rcap: Remaining Capacity in Whs
- fccp: Full Charge Capacity in Whs
- pckt: Pack Temperature in Celsius
- acyc: Accumulated Cycles
- slon: Satellite Longitude in DD (decimal degrees)
- slat: Satellite Latitude in DD (decimal degrees)
- salt: Satellite Altitude in Metres
- sstm: Satellite-Synchronized Network Clock time in ISO 8601
- sgps: Satellite GPS Strength
- sspe: Satellite Speed in kM/h
- ppst: PACK protection status
- pmcs: Pack MOS Control Status (inferred; not explicitly defined)
- cmos: Discharging MOS Status, 0 for off, 1 for on
- dmos: Charging MOS Status, 0 for off, 1 for on
- ctmp: Controller Temperature in Celsius (inferred)
- mtpm: Maximum Temperature (inferred; possibly a typo for max temp)
- mtrd: Motor Running Distance (inferred; context unclear)
- tspd: Total Speed (inferred; possibly total operating speed)
- rvlt: Rated Voltage (inferred; possibly in volts)
- rcur: Rated Current (inferred; possibly in mA, negative indicates discharge)
- rmax: Rated Maximum (inferred; possibly max capacity or power)
- cmxs: Charge Maximum Voltage Setting (inferred; possibly in mV)
- cmxc: Charge Maximum Current Setting (inferred; possibly in mA)
dia (Diagnostics)¶
- cv01: Cell 01 Voltage mV
- cv02: Cell 02 Voltage mV
- cv03: Cell 03 Voltage mV
- cv04: Cell 04 Voltage mV
- cv05: Cell 05 Voltage mV
- cv06: Cell 06 Voltage mV
- cv07: Cell 07 Voltage mV
- cv08: Cell 08 Voltage mV
- cv09: Cell 09 Voltage mV
- cv10: Cell 10 Voltage mV
- cv11: Cell 11 Voltage mV
- cv12: Cell 12 Voltage mV
- cv13: Cell 13 Voltage mV
- cv14: Cell 14 Voltage mV
- cv15: Cell 15 Voltage mV
- cv16: Cell 16 Voltage mV
- cv17: Cell 17 Voltage mV
- cv18: Cell 18 Voltage mV
- cv19: Cell 19 Voltage mV
- cv20: Cell 20 Voltage mV
- cv21: Cell 21 Voltage mV
- cv22: Cell 22 Voltage mV
- cv23: Cell 23 Voltage mV
- pkt1: Pack Temperature-1 C
- pkt2: Pack Temperature-2 C
- pkt3: Pack Temperature-3 C
- pkt4: Pack Temperature-4 C
- pkt5: MOS Temperature C
- pkt6: Environment Temperature
This documentation should serve as a complete reference for configuring your device and understanding its payload. If you need further clarification, code integration, or additional sections (e.g., troubleshooting), let me know!