RS485 issue on newer versions of RUT955

I'm running into an issue with RS485 communication on newer RUT955 devices when using OpenWrt. When I test RS485 from the RUT955 to my PC via a RS485-to-USB adapter, everything works perfectly under Teltonika’s stock RUTOS firmware. However, after flashing OpenWrt, RS485 communication fails—no data is transmitted or received.

Background:

  • RUTOS: RS485 communication works as expected when testing from the RUT955 to a PC using a RS485-to-USB adapter.
  • OpenWrt: After flashing OpenWrt on the same hardware, the RS485 port (e.g., /dev/ttyATH1) appears active, but no communication occurs.

I’ve tried various configuration changes (serial settings, flow control adjustments, etc.), but nothing has resolved the issue on OpenWrt.

Has anyone else experienced this problem on newer RUT955 units running OpenWrt? Is there a known solution or workaround to get RS485 working reliably on these devices under OpenWrt?

Not sure if this change is relevant, but i will include it anyways.
https://wiki.teltonika-networks.com/view/RUT955_Product_Change_Notifications#2022-05-24:_RS232_serial_interface_IC_and_RS485_TX_line_change

Any help or pointers would be greatly appreciated.

I made some progress and figured I would post an update, in case anyone else is having this issue or has some knowledge to help.

Here's what seemed to fix it:

  • Checked Stock RUTOS DTS: Found it used active-high RTS and had rs485-rx-during-tx enabled for the port (/dev/ttyATH1, node &hs_uart).

  • Corrected OpenWrt Base DTS: The original OpenWrt .dtsi (ar9344_teltonika_rut9xx.dtsi) had rs485-rts-active-low; and was missing rs485-rx-during-tx;. I changed the &hs_uart node to match the stock logic:

DTS

&hs_uart {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pmx_uart2>;
        rs485-rts-active-low;               REMOVED THIS LINE
	rts-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
	linux,rs485-enabled-at-boot-time;
	rs485-rx-during-tx;                      ADDED THIS LINE
};

Forced RX Enable Pin High: Also identified RS485_R (GPIO 13 on the &gpio_ext 74hc595 expander) as the likely Receiver Enable pin. To be safe, I added a gpio-hog in the device .dts (qca9531_teltonika_rut955.dts) to make sure it's driven high at boot:

DTS

    // Inside &spi -> gpio_ext: gpio_ext@2 { ... }

		rs485_rx_en_hog {
             gpio-hog;
             gpios = <13 GPIO_ACTIVE_HIGH>; // Offset 13 on this chip
             output-high; // Set default state to output HIGH
             line-name = "rs485-rx-enable";
        };

With firmware built including both these changes, RS485 talks fine with a simple USB to RS485 adapter.

I've only had the issue with batches newer than 110 and I tried to apply this to a 135 but although communication was fine through the adapter, it did not behave same as earlier batches on a testbench (might've been config differences but im not sure yet).

Would appreciate insights as this is mostly foreign territory for me.