Skip to main content

NET Relay

Syntax​

NET <ip> <command>

Behaviour​

  1. The receiving board extracts the target IP and the command.
  2. It sends the command to <ip>:55152 over UDP.
  3. It answers its own sender with OK NET ip=<ip> (or ERR NET <reason>).

The relay is fire-and-forget. The reply only confirms that the command was sent. The target board executes the command and answers the board that sent it, on port 55153; that answer is not forwarded back to the original sender. Status lines (OK, ERR, EVT) received on the command port are never executed as commands, so two boards never answer each other in a loop.

Constraints​

ParameterValue
Maximum command length (after the IP)107 bytes
Self-relayRejected (ERR NET self)
Broadcast and multicast addressesRejected (ERR NET bad_ip)

Example​

From a Studio program on board A, to trigger board B, use the NET command block:

Board A loop
NET command "192.168.1.21" "FLAG SET 1"

The equivalent raw UDP command from a PC:

echo -n "NET 192.168.1.21 FLAG SET 1" | nc -u 192.168.1.11 55152

The Studio block also accepts $variable in the command text; see Network blocks.