Introduction
This document outlines the communications protocol that the YardsTech® Scales uses to communicate with other third party software via WiFi.
Broadcasting device presence
The YardsTech® Scales will periodically (approx. every 5 seconds) send a UDP broadcast packet onto the WiFi network. The broadcast will contain the unit's unique identifier (eg. "FXL-YTS001-12:34:56:78:90:AB") and will be to IP address 255.255.255.255 on port 15000.
Any device listening for broadcast packets on this port can use the source address of the UDP packet to determine the IP address of the YardsTech® Scales.
Establishing a connection to the device
To communicate with the YardsTech® Scales a TCP connection must be created on port 20000. All commands are sent to and received from the YardsTech® Scales must be on that port. The YardsTech® Scales can support up to 10 simultaneous client connections.
Maintaining a connection to the device
The YardsTech® Scales monitor client connections and will automatically close/disconnect client connections that have fallen silent. If a connection has not been used (ie no commands have been received) within the last approx. 5 seconds the YardsTech® Scales will send a ping to the client. The format of the ping is as follows:
[!]<crlf>
The client must respond to the ping with the same response i.e.
[!]<crlf>
If the client has not responded within approx. 25 seconds, then connection will be closed and discarded.
Commands accepted by the device
Following are a list of commands that can be sent to the YardsTech® Scales.
Zero/tare weight
Command : [Z]<crlf>
Response : [ZOK]<crlf>
Function : zero's or tares the scales.
Reweigh
Command : [A]<crlf>
Response : [AOK]<crlf>
Function : removes the currently locked weight and performs a reweight.
Get weight
Command : [W]<crlf>
Response : [WL-xxxx.x yy]<crlf> for a locked weight.
or [WZ-xxxx.x yy]<crlf> for a weight hovering around 0.
or [WC-xxxx.x yy]<crlf> for a weight that is currently not locked and not 0 i.e. changing.
Function : Retrieves the current weight from the scales, along with the weight status. The weight format will be either "-xxxx.x" for negative weights and " xxxx.x" for positive weights (note the leading space). "yy" will be the weight units eg. "kg"
Get instantaneous scale weight
Command : [IW]<crlf>
Response : [IW-xxxx.x yy]<crlf>
Function : Retrieves the current weight from the scales. The weight is always the current instantaneous weight as measured by the scales. The weight format will be as per the get weight command above.
Commands issued by the device
The following commands can be issued by the YardsTech® Scales at any point in time. They are sent to all currently connected clients, but do not require a response from the client.
Barcode received
Command : [Bxxxxx]<crlf>
Function : The YardsTech® Scales received a barcode (most likely from the YardsTech® App). "xxxxx" will be the barcode text/number as received from the barcode reader.
EID/RFID received
Command : [Rxxxxx]<crlf>
Function : The YardsTech® Scales received an EID (most likely from an EID reader attached to the YardsTech® Scales via Bluetooth). "xxxxx" will be the EID number as received from the EID reader.