10490 questions

12505 answers

19431 comments

21988 members

0 votes
52 views 0 comments
by
Hi

I want to turn configured output to high after 2 mins of the TRB142 rebooting. Otherwise the pin is low. How do I do this?
As far as I can see you can only do it with a trigger.
Thanks

1 Answer

0 votes
by

Hello George,

You could use the custom scripts feature to switch the I/O state to high state after the device finished the booting procedure.

Please follow the steps below to do this task:

1. Open your WebUI interface and follow this path:

System>CustomScripts

You will find a section named Startup Script.

2. Copy and paste the script below inside the box:

#! /bin/sh

#This script switches the I/O state to on/high state.

#sleep 120s #Uncomment this line to hold the execution of this script for 2 minutes after the booting procedure ends.

#Switch I/O PIN state. (To configure PIN 4, replace ioman.gpio.dio0 for ioman.gpio.dio1)

ubus call ioman.gpio.dio0 update '{"direction":"out"}' #This set the I/O configuration to output

ubus call ioman.gpio.dio0 update '{"value":"1"}' #This set the I/O state to on/high.

3. In the Command Line Interface (CLI), execute the following command: chmod 700 /etc/rc.local

4. Reboot your device and confirm it works as expected.

For more information about TRB 142 I/O services and custom scripts setup, please refer to:

https://wiki.teltonika-networks.com/view/TRB142_Input/Output

https://wiki.teltonika-networks.com/view/RUT955_Custom_Scripts

I hope this helps to solve your query. I look forward to reading your feedback.