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,648,194 views 6 comments
by anonymous

Hello,

we ordered our first Teltonika RUTX08 device (really impressed by the very good quality!).

Unfortunately we don't understand the I/O function, we need:

Input high = OpenVPN active
Input low = OpenVPN deactive

Output high = OpenVPN connected
Output low = OpenVPN disconnected

Is the only way to solve this via bash script?
Maybe there is an example or someone can point me into the right direction...

1 Answer

0 votes
by anonymous

Hi,

Thank you for the appreciation of our device, :)

Firstly since you're using the the  4 pin device, to utilize the I/O functions you need to separate the power and ground and wire it separately as shown below.

then navigate to Services>Input/Output>Status>>Power Socket status

You can also obtain the status of input and output pins via the command line (CLI or SSH). List of possible ubus values in RUTX08 devices:

ioman.gpio.din1  - 4PIN input

ioman.gpio.dout1 - 4PIN output

Kindly correct me if I am wrong, As I understand you're query ,you need two profiles where when the input is high u need OpenVPN to activate

When the input is low, you need to OpenVPN to deactivate
Solution
Firstly switch the device to Advanced mode 


This can be easily achieved through solved with simple profile switch it only takes few seconds. 
Go to System>Profiles> and configure one Profile with OpenVpn Activated
and another Profile as OpenVPN off
Now go to Services>Input/Output>I/O Juggler-Action


after pressing the add it will prompt to the next window where you provide the profile from the dropdown section where the previously customized profiles can be selected
like,


Same way Configure all the profiles required.
Then move onto the general section where we actually configure the trigger function, and configure in the same way


then ADD the trigger function where when the first case will be input rising from 0 to 1






Best answer
by anonymous
Thank you for the reply.
Hardware ist clear to me, but not how to trigger the OpenVPN connection.

The only way is a script over Actions/Conditions, right?
by anonymous

I have edited it, please check now, there is some issue in the format.kindly PM me if you require a word document

please let me know if it helps.

thanks

by anonymous
Thank you.
Question to the profiles, if i make some change on the LAN settings (for example) i must copy the profil again, right?

This it not i'm searching for, maybe better to start/stop the OpenVPN service over script?
by anonymous

Whatever changes you have applied at the time of saving profile will be replicated in the profile. If you want to update a setting you will need to create a new profile and delete the old one 

If you are open to script it would be easier I suppose,

thanks

by anonymous
Ok, I define two scripts:

uci set openvpn.NameVPN.enable='1'
/etc/init.d/openvpn restart

and

uci set openvpn.NameVPN.enable='0'
/etc/init.d/openvpn stop

Works fine.

Next problem, output don't work.
I add two actions (OutputON and OutputOff) and add the EnableVPN/Disable conditions, but the output pin is always low.

Is there something I missing?
Can I enable/disable the output over uci?
by anonymous
My trigger don't work after reboot if the input is high during boot:
https://community.teltonika-networks.com/67327/rutx08-input-trigger-rising-after-reboot

Harder than I thought...