TRB160 outputs activate external relays during boot before ioman starts

Hello,

I am experiencing a critical boot-time I/O issue on a Teltonika TRB160.

Setup

  • Device: Teltonika TRB160 / TRB16X
  • RutOS
  • Kernel: 5.4.197
  • Two external relays are controlled through the TRB160 configurable open-collector outputs
  • dio0 controls relay 1
  • dio1 controls relay 2
  • Normal operation is correct through MQTT
  • An activation command sets the output active for approximately one second

Problem

At every cold boot or reboot, both external relays activate before the TRB160 finishes booting.

The relays remain activated for a significant period, then return to their normal inactive state once the I/O subsystem is available.

This is a security issue because the relays control electric locks. Every power interruption temporarily unlocks them.

Tests already performed

Both outputs are configured as outputs with a default value of 0 in /etc/config/ioman.

Example:

uci set ioman.dio0.direction='out'
uci set ioman.dio0.value='0'
uci set ioman.dio1.direction='out'
uci set ioman.dio1.value='0'
uci commit ioman

This does not solve the issue.

I also created an early boot probe started from an S01 init script.

The result is:

  • the DIO interfaces are unavailable through ubus during early boot;
  • they return NA until approximately 42.4 seconds uptime;
  • at approximately 42.6 seconds, ioman becomes available;
  • once ioman is available, the outputs report value 0;
  • no software-visible HIGH state is observed after ioman starts.

Therefore, the relay activation appears to happen before ioman can control the pins.

A startup script, rc.local, UCI default value, or restarting ioman cannot prevent the initial activation because they all run after the physical relay has already activated.

Comparison with TRB246

The same relay and MQTT architecture is used at other locations with TRB246 devices.

The TRB246 devices do not show this issue.

On the TRB246, /sys/kernel/debug/gpio shows dedicated output lines claimed by ioman and initialized as outputs LOW during kernel initialization.

On the TRB160, I do not see equivalent dedicated GPIO_OUT lines in the GPIO debug output.

This suggests that the TRB160 configurable DIO pins may have a different bootloader, pinmux, device-tree, or hardware default state.

Good day,

Please post your questions regarding TRB246/TRB160 devices in separate Networks group forum.

Thank you for your understanding.

Here is the link: Latest Teltonika Networks topics - Teltonika Community

Best Regards,
Imran S.