4781 questions

5854 answers


5704 members

0 votes
508 views 0 comments

How could I program the RUT240 to provide a signal (for external single LED) into the output pin to indicate an active/existing mobile data connection?



1 Answer

+1 vote


RUT240 does not have a functionality which would activate router's output based on mobile data connection status. Therefore you cannot configure such router's behavior just from router's WebUI.

Nonetheless, there is a solution: You could use simple SSH script, which allow you to monitor if router has mobile data connectivity (actually, in this example, script would monitor internet connectivity all together, and not just "mobile data connection status"). To achieve this:

  1. Connect to router via SSH (e.g. using Putty application):

         - SSH login: root

         - SSH password: <your router's password>

  2. Execute the following SSH command (it would create a new file, in which you will write your script. File name here is "aaa"):

            vi /bin/aaa

  3. Press "a" keyboard button then copy the following text into the file (by clicking "right mouse button", since "ctrl + v" combination would not work in SSH):


while [ 1 ]; do

ping -s 0 -c 3 -q >/dev/null


if [ $ret -ne 0 ]; then

gpio.sh set DOUT1


gpio.sh clear DOUT1


sleep 10


  4. Then press "esc" keyboard button, press ":x" and press "enter" keyboard button (this would save and close the file)

  5. After that, execute the following SSH command:

       chmod +x /bin/aaa

  6. Finally, connect to router's WebUI, navigate to "System -> User scripts" menu and write "/bin/aaa" line ABOVE "exit 0" line. Save the changes and reboot the router. (This action would make router to start your script each time router is powered on)

That's it.With this script, router would periodically (every 10 seconds) check for internet connectivity. When router will have internet connectivity, its output will be "inactive" and when connectivity will be lost, output will be activated. Feel free to reverse output actions or change the timing of the script.

Hope this helps you to accomplish your unique solution. It would be great if you could let me know if this approach indeed helped you in this situation.

Best answer