Reachability test and digital output activation on RUT200

We often use RUT200. Sometimes we provide the router to the customer and he inserts the SIM independently. Sometimes the customer does not have the SIM with active data traffic. Is there the possibility in the router to activate a timed PING or when the INPUT signal changes to check the reachability of We would like that in case of success, the OUTPUT output of the router is switched. Does this possibility exist?



Can you clarify what you wanted to achieve?
If is pingable or the digital input signal is changed, then you want to change the state of the Output pin.

I wrote a simple script where it will check either the digital input is 1 (triggered) or the is pingable, it will change the state of the Output pin, then change it back after couple seconds.


while true

        input_value=`ubus call ioman.gpio.din1 status | jsonfilter -e '@.value'`

        # Try to ping
        ping -c 4
        if [ $? -eq 0 ]; then
                pingable=0  # Set pingable to 0 if is reachable


        if [ $input_value -eq 1 ] || [ $pingable -eq 0 ];
                ubus call ioman.gpio.dout1 update '{"value": "1"}'

        # Change the sleep value based on how often you wanted to check the reachability
        sleep 10

        # change to value to low
        ubus call ioman.gpio.dout1 update '{"value": "0"}'

However, if you just wanted to change the Output state if the input state changes, then that would be possible through I/O Juggler.


Thank you so much for your example. It was exactly what I wanted to do. If I run the script from shell, I see the output switch.


I would like to ask for one final confirmation. If I wanted to run it, should I put it in “Startup Script”? because if I launch it from the CLI (Command Line) it works correctly and I see the output switch, but it seems to me that it doesn’t work from the autostart script. Maybe I need to restart the router?

The way I would approach this is that I am going to save the script somewhere in the /bin directory.

Then I will run it using the custom scripts in the WebUI by typing its directory (e.g. /bin/
Just make sure you add an executable rights on the script itself using chmod +x /directory/script command.

Hope that helps.

This topic was automatically closed after 16 days. New replies are no longer allowed.