This document specifies the protocol used to communicate serially via the RS-232 interface with a YuJa
hardware hub. The commands sent can be used to control the recording state, or retrieve current status
information of the hub. Commands are strings sent serially and interpreted by the hub to perform the
desired action.
Specifications
A USB-to-Serial converter is used with a DB-9 Male connector. Only the GND, TxD and RxD pins are used when communicating with the hub.
- Baud Rate = 38400
- Data Bits = 8
- Stop Bits = 1
- Parity = NONE
- Flow Control = NONE
- YuJa Hardware Hub Device
- Pin 2 : RxD <------------------- TxD
- Pin 3 : TxD -------------------> RxD
- Pin 5 : GND ------------------- GND
Serial String Commands and Responses
Due to the absence of flow control in the protocol, commands are sent one at a time on a request/response structure. When sent a command, the hub will parse the serial string and execute the command, and will respond with a serial string of its own. A second command cannot be sent until the hub’s response to the original command has been received. All commands and responses are formatted as follows:
- Head : <!XX>
- Tail : <!YY>
- General Structure : <!XX><COMMAND> <!YY>
where <COMMAND>
Note: The head and tail must be exactly as shown, but the commands are not case sensitive. For example:
- <!XX>CTRL=Start<!YY> is interpreted the same as <!XX>ctrl=start<!YY>.
- However, <!xx>CTRL=Start<!yy> is an unknown command.
- Furthermore, all string responses from the hub are defaulted to be all uppercase.
Control Commands
Control commands alter the state of the YuJa hub. They are used to start/stop the lecture capture.
The command strings to replace <COMMAND> are as follows:
Command | Description | Parameters |
CTRL=Start | Start the lecture capture. If paused, it will resume instead. | N/A |
CTRL=Pause | Pause the lecture capture. | N/A |
CTRL=Stop | Stop the lecture capture. | N/A |
CTRL=Extend |
Add 30 more minutes to an already started lecture capture. Note: Captures within 5 minutes of completing cannot be extended. |
N/A Note: Specific extension time passed as a parameter may be included in a future version. |
Following a control command, the hub will respond with 1 of 3 messages:
- Command Successful: upon successfully interpreting and executing the control command, the hub will respond with the original control command string with all characters capitalized.
- Command Unknown: for unrecognized or invalid commands, the hub will respond with an “UNKNOWN COMMAND” string.
- Command Failed: for valid commands that were unsuccessfully executed by the hub, a response string indicating the error will be sent.
-
Examples:
-
Start the hub:
- Command: <!XX>CTRL=Start<!YY>
- Response: <!XX>CTRL=START<!YY>
-
Invalid command:
- Command: <!XX>CTRL=Capture<!YY>
- Response: <!XX>UNKNOWN COMMAND<!YY>
-
Failed start command:
- Command: <!XX>CTRL=Start<!YY>
- Response: <!XX>FAIL: SESSION OVERLAPS WITH ANOTHER SESSION.<!YY>
-
Start the hub:
Status Commands
Status commands are used to request the current state of the hub. The command strings to replace
<COMMAND> are as follows:
Command | Description | Returns |
STAT=Recording | Returns the recording state of the hub. |
"RECORDING: ON" "RECORDING: OFF" |
STAT=Connection | Returns whether or not the hub is correctly connected to the cloud. |
"CONNECTION: CONNECTED" "CONNECTION: DISCONNECTED" |
STAT=Capture-Duration | Returns the amount of time that has been elapsed since the capture started.* |
"CAPTURE-DURACTION: <duration of capture**> |
STAT=Remaining | Returns the amount of time left until the end of a capture.* |
“REMAINING: <remaining time**>” |
STAT=Length | Returns the total length of the current capture.* |
"LENGTH: <length of capture**>" |
*: A capture session must be started (i.e. recording must be ON) in order for a time to be returned.
**: All time is formatted as hh:mm:ss. If not available, N/A will be returned instead of a time.
Following a status command, the hub will respond with 1 of 2 messages:
- Status: for valid status requests, the hub will return the desired information in the form of a hash.
-
Command Unknown: for unrecognized or invalid commands, the hub will respond with an
“UNKNOWN COMMAND” string. -
Examples:
-
Request recording status:
- Command: <!XX>STAT=Recording<!YY>
- Response: <!XX>RECORDING: ON<!YY>
-
Invalid command:
- Command: <!XX>STAT=Com<!YY>
- Response: <!XX>UNKNOWN COMMAND<!YY>
-
Request capture duration:
- Command: <!XX>STAT=Capture-Duration<!YY>
- Response: <!XX>CAPTURE-DURATION: 00:12:34<!YY>
-
Request capture duration of unstarted hub:
- Command: <!XX>STAT=Capture-Duration<!YY>
- Response: <!XX>CAPTURE-DURATION: N/A<!YY>
-
Request length of capture:
- Command: <!XX>STAT=Length<!YY>
- Response: <!XX>LENGTH: 03:00:00<!YY>
-
Request recording status:
Troubleshooting
If you're not receiving a reply from the Hardware Hub, there are a couple of things you can do to resolve the issue.
- Please make sure you have set the correct specifications for the baud rate to equal 38400. You must then restart the Hub device to ensure it's working.
- You can try swapping your TX and RX pins using a DB9 null connector/null modem adapter. After swapping the connectors, please restart the device to ensure it's working.
- If your issue persists, please contact YuJa Support.