4781 questions

5854 answers

9373 comments

5704 members

0 votes
508 views 0 comments
by
Hi,

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?

Wbr,

-t

1 Answer

+1 vote
by

Hello,

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):

#!/bin/ash

while [ 1 ]; do

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

ret=$?

if [ $ret -ne 0 ]; then

gpio.sh set DOUT1

else

gpio.sh clear DOUT1

fi

sleep 10

done

  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