Overview
To send a command to a single device, you can telnet to the device and apply the command. But what if you need to send the same command to multiple Receivers in a system? Then commandallrx.sh
is what you need!
Syntax
commandallrx.sh [command]
Functionality
- If [command] contains a space character, enclose the command in double quotes (")
commandallrx.sh "start_image_pull 320 1 1"
- For best functionality, end the [command] with the ampersand character (&) so that it runs in the background on the remote device. This is mandatory for longer [commands]
commandallrx.sh "start_image_pull 320 1 1&"
- The commandallrx.sh command itself can be run in the background on the local device with an ampersand (&).
commandallrx.sh "start_image_pull 320 1 1&"&
- commandallrx.sh exists on both Transmitters and Receivers, but has different functionality
Transmitter
When commandallrx.sh is run on a Transmitter, the [command] is sent to all Receivers that are currently watching that Transmitter. This gives the ability to target the [command] to a subset of Receivers
Receiver
When commandallrx.sh is run on a Receiver, the [command] is sent to all Receivers in the system.
Behind the Scenes
commandallrx.sh is performing the same procedure on both the Transmitter and the Receiver, but the result is different because of the process that is executed. When commandallrx.sh [command]
is sent, this is what the device does:
- Run the command
node_list
locally and look for all devices with the word 'client' in their name. - Record the IP addresses of the "client" devices
- Telnet into each "client" device and send [command]
- The telnet order is in the order that the devices showed up in the node_list command
- The local device will run the command on itself last
It is node_list
that causes the difference in behavior between Transmitter and Receiver. A Transmitter will only list the Receivers that it is communicating with; a Receiver will list all other Receivers.
Limitations
- The command only communicates to all Receivers. There is no way to send a single command to all Transmitters, as Transmitters are isolated from each other while on the network.
- The [command] cannot contain the semicolon symbol (;), as in the case of applying multiple astparam s [key] [value] parameters at once
reboot
cannot be sent through commandallrx.sh unless it is ended with an ampersand (&)- Depending on the firmware version, the command may not be sent to the local device. You will have to apply the command locally afterwards.
Examples
- To start Image Pull on all Receivers, telnet into a Receiver and send:
commandallrx.sh "start_image_pull 320 1 1&"&
- To change all Receivers watching a single Transmitter into single-screen mode, telnet into that Transmitter and send:
commandallrx.sh "e e_vw_enable_0_0_0_0&"
- To change all Receivers in the entire installation into single-screen mode, telnet into any Receiver and send:
commandallrx.sh "e e_vw_enable_0_0_0_0&"