FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,593 views 4 comments
by
I have a sensor at one RUT240 that is connected to the WAN(Internet) via mobile SIM. I have a second RUT240 that is connected to the first via wifi. The second has a relay that I need to switch when the first units sensor is activated.

2 Answers

0 votes
by anonymous

Hello, 

you can take a look to the link below. there is an explanation on how to activate/deactivate an IO by knowing the IP of the router you want to manage

https://wiki.teltonika.lt/view/RUT240_Input/Output#Post.2FGet_configuration

Remember that you need to change the IP that is in the example for whatrever IP the main router have. I think (but you have to test it) that the main router is also the gateway for the second router, if you are using the default configuration, there is a big big chance that the IP of the main router you want to control is 192.168.1.1. So in that case you can use directly the POST GET commands you see in the example.

Regards

Best answer
by
Yeah. Thats all good, but how do I get the gateway router to send the command to the second router? It needs to somehow do it when it sees an input change.
by anonymous
Hello.
There is one method to achieve this by using HTTP POST/GET But it is only implemented on RUT955. You still can use RUT240 to receive the IO'commands

With Output post/get you can manage only Outputs (Open collector output and Digital Out).

Delay and time parameters can be used together. Example: delay is 10, time is 5, action is „on“. 10  seconds after command execution output will switch to „on“ (or stay in „on“ state if it‘s already on), then after 5 more seconds it will switch to off state. Overall command execution time is 15 seconds. Actions „on“ and „off“ depend on setting „Output configuration in active state“ (on is active state), which can be set via Services > Input/Output > Output

I'm giving you POST/GET string examples that can be also used from your browser and serve as an example to configure Input Rule:

http://192.168.1.1/cgi-bin/output?username=User1&password=Pass1&action=on&pin=relay
http://192.168.1.1/cgi-bin/output?username=User1&password=Pass1&action=on&pin=relay&delay=10
http://192.168.1.1/cgi-bin/output?username=User1&password=Pass1&action=on&pin=relay&time=5
http://192.168.1.1/cgi-bin/output?username=User1&password=Pass1&action=on&pin=relay&delay=15&time=5
http://192.168.1.1/cgi-bin/output?username=User1&password=Pass1&action=off&pin=relay&delay=15&time=5
http://192.168.1.1/cgi-bin/output?username=User1&password=Pass1&action=on&pin=oc
http://192.168.1.1/cgi-bin/output?username=User1&password=Pass1&action=off&pin=oc


RUT1 configuration:

1. Go to Services --> Input/Output 

2. Create Input Configuration with required Input type, Trigger and set action to HTTP POST/GET

3. Edit created rue. 

In type section select - GET. 

In site link section enter - http:/Main-Router-Gateway-IP/cgi-bin/output

In HTML query you will need to enter data from string examples according to your needed configuration. Screenshot 1 attached as example.

username=test123
password=test123
action=on
pin=OC
time=5


RUT2 configuration (Main router): (Can be a RUT240)

1. Go to Services --> Input/Output --> Post/Get Configuration

Enable Post/Get service
Enter Username: test123 (in the example configuration)
Enter Password: test123 (in the example configuration)
0 votes
by anonymous
Hi,

Seems like option would be to use a SIM card in second router. Then select action:Send SMS when Input in first router is triggered.
by
Yep, I think that may be the only way, but I cant do that because eventally I will have many routers all connected the the main gateway routers wifi and one controls the next. To do that I am going to need many sim cards. And it is remote, so the main gatway will have a good 3G/4G antenna. All units are powered by battery and solar.
by anonymous
Then you will be needed RUT955, it has post/get for I/O: https://wiki.teltonika.lt/view/RUT955_Input/Output#Post.2FGet_examples