CWM Messages

This section describes application layer messages that are generated and recognized by the CWM.

CWM Heartbeat Messages

The CWM generates its own application layer heartbeat message primarily to aid remote troubleshooting of OKE installations.

If supported the ti field reports the internal temperature of the CWM in whole degrees C.

The diag field is an array of 32-bit unsigned integers. The counters are reset to 0 on a reset and could overflow to 0. The first array value is total number of OKM queue read requests. The second value is total number of queue reads without a _crc field. The third value is the total number of queue reads with an invalid _crc field. The forth field is the total number of queue reads that were invalid JSON.

If supported the cfgpend field is a Boolean that indicates if the CWM needs to reboot to apply a configuration.

The scan field is a Boolean that indicates if the CWM is scanning its ports for an OKE.

The baud field is an unsigned 32-bit integer indicating the current baud rate the CWM is operating at.

The sidx field is an unsigned 16-bit integer indicating the port index being scanned.

The smax field is an unsigned 16-bit integer indicating the total number of port indexes to scan.

The txp field is a Boolean indicating if there is a transmit request pending on the OKE port.

The msp field is an array of 16-bit integers that indicate the maximum number of OKMs that the Telemetry, Priority, and Inbound queues can store respectively.

The rcon field is a hexadecimal string field representing the 16-bit register value of the PIC24's RCON register on boot.

The 5v and 12v fields respectively report the voltages of the power rails in mV.

The port field is an enumerated string indicating which port the CWM is currently using to communicate to the OKE.

OKE Port Configuration

The OKC may manually configure the CWM's OKE communication port and settings using this message within the _pld field of a standard OKM.

oke

The oke field encapsulates the port configuration that the CWM should use for communicating to an attached OKE. The value of the field is an object containing both the port and baud fields.

The port field value is an enumerated string with a value of "usb", "ttl", "232", or "485". The SPOD CWM implementation only supports "232" and "485".

The baud field value is an unsigned 32-bit integer, any value >= 9600 and <= 230400 is valid. The most common setting is 115200.

Example _pld object:

{"oke":{"port":"232","baud":115200}}

 

If the OKE port configuration message is valid then the configuration will be saved in non-volatile memory and take effect immediately.

Related pages