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
160 views 0 comments
by anonymous
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 anonymous

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.