NET Relay
Syntax
NET <ip> <command>
Behaviour
- The receiving board extracts the target IP and the command.
- It sends the command to
<ip>:55152over UDP. - It answers its own sender with
OK NET ip=<ip>(orERR 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
| Parameter | Value |
|---|---|
| Maximum command length (after the IP) | 107 bytes |
| Self-relay | Rejected (ERR NET self) |
| Broadcast and multicast addresses | Rejected (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.