R7 Serial: API
The Serial Command API enables external control systems to interact with RockAIR, RockFLEET, or RockBLOCK RTU devices via an RS-232 or RS-485 serial interface.
The main purpose of the Serial API is to provide a method of sending and receiving hexadecimal or binary encoded data through your device. It is designed to be deliberately restrictive, with the overriding principle being that the external control system should not compromise the autonomous tracking/logging capability of the device.
Connect to your device using the CONNECT app and ensure that Serial Mode is set to 'Serial API'
.
Follow app menus: Configure > External Data > Serial Mode = Serial API
Serial API Interface
Device | Serial API Support | Serial Version |
---|---|---|
RockFLEET (with appropriate configuration) | YES | RS232 RS485 |
RockAIR | YES | RS232 |
RockBLOCK RTU | YES | RS232 |
Interface Wiring
- RS232 versions are ‘3-wire’ with RX, TX and GND signals.
- RS485 versions (RockFLEET only) are optoisolated, with A, B, Y, Z and GND signals.
Interface Settings
For both serial interfaces, the recommended communication settings:
Serial Option | Settings |
---|---|
Baud Rate | 19200 Baud rate can be configured via the CONNECT app. |
Data Bits | 8 |
Parity | None |
Stop Bits | 1 |
Flow Control | None |
System State
Serial API functionality requires the device to be set to 'Unlimited Power'.
Serial API functionality will be paused in limited power configuration and when deactivated, GPS streaming will be turned off whenever the API is paused.
The Serial API feature can be enabled but not active on the serial port depending on system state (e.g. limited power or deactivation).
When it becomes active, the device will issue an unsolicited message to the serial port as a prompt for external equipment.
This message includes the current firmware version, for example:
"Version 03.04.19"
Serial API Commands
All commands must be terminated with a \r (Carriage Return).
The following commands are supported when Serial API mode is active:
Serial Command | Function |
---|---|
R7+GPS | Request position data |
R7+GPS,HOT | Check/change the GPS Hot setting. (RockAIR and RockFLEET only) |
R7+GPS,STREAM | Turn on GPS position data streaming to serial interface |
R7+TRACK,FREQ | Check/change the Satellite Context Tracking Frequency. (RockAIR and RockFLEET only) NOTE: GPRS and Distress context settings are not accessible via Serial API. |
R7+[WH|WHP|WHNC|WHNCP] | Transmit hex-encoded data with or without positional data and checksum |
R7+[WB|WBP|WBNC|WBNCP] | Transmit binary data with or without positional data and checksum |
R7+[WH|WHP|WHNC|WHNCP],ID=n or R7+[WB|WBP|WBNC|WBNCP],ID=n | Sets outbound message ID. Used in combination with send hex or binary data commands. |
R7+STAT | Checks status of outbound message |
R7+RH | Read inbound message |
R7+D | Delete inbound message |
R7+VERSION | Returns the Firmware Version |
Error Messages
Error Type | Description |
---|---|
ERROR 0 | Data format error - eg. - Non-hex payload - Incorrect checksum provided - Binary payload timeout |
ERROR 1 | Device deactivated - will not be seen as device is unable to respond in deactivated state |
ERROR 2 | This error type will be returned in response to any R7+WH.. or R7+WB.. message commands if the database is full. |
ERROR 3 | This error will be returned to indicate rejection of a message command when the submitted ID is a duplicate of one already in the DB and not yet sent. |
These errors are returned via the serial interface in response to failed commands.