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
86 views 0 comments
by anonymous
Hello,

I do have a device, connected to LAN1 port, which likes to go down from time to time. This event is also detected by teltonika since it reports "Port link state of port LAN1 changed to down". I then have a relay that is connected to teltonika output and that can cut the power to that device and force it to restart. But I haven't found a way to do this automatically. I have tried CLI but since LAN ports are bridged I can not get a way to get a state of port by some command (like ip a or ifconfig etc.). I know that this is duable by using logread and checking for that specific event but I would like to avoid that.

So question is: Is there a way to change output of I/O after detecting that port LAN1 link state changed to down?

1 Answer

0 votes
by anonymous
Hi,

For that, you would need to use hotplug scripts.

The message on the logread is generated by hotplug script.

How to work with hotplug, you can find here https://openwrt.org/docs/guide-user/base-system/hotplug

To turn on or off IO states, use ubus commands, more specifically

ubus call ioman.gpio.din1 invert_value '{"save_conf":False}'

this would flip the state