RAK7289CV2 basicstation not recovering from lost ttyACM0

Just got this on one of the gateways:

Tue May  2 07:21:30 2023 user.err basicstation[11688]: [HAL:ERRO] [lgw_usb_open:160] failed to open COM port /dev/ttyACM0 - No such file or directory
Tue May  2 07:21:30 2023 user.err basicstation[11688]: [HAL:ERRO] [lgw_connect:1182] CONNECTING CONCENTRATOR FAILED
Tue May  2 07:21:30 2023 user.err basicstation[11688]: [RAL:ERRO] Concentrator start failed: lgw_start
Tue May  2 07:21:30 2023 user.err basicstation[11688]: [RAL:ERRO] ral_config failed with status 0x08
Tue May  2 07:21:30 2023 user.err basicstation[11688]: [any:ERRO] Closing connection to muxs - error in s2e_onMsg

It just keeps going without exiting/restarting it seems. Same process ID every attempt in the log, no line about it trying to restart.

Actually calling the reset script does not help getting the device back either. Maybe it’s related to the restarting of the LTE modem when there’s no connection. (because that also uses USB)

I’ve also seen the case where the USB device still exists, but still has an error communicating.

Mon May 15 10:31:42 2023 user.err basicstation[7492]: [HAL:ERRO] [lgw_usb_close:252] failed to reset SX1302
Mon May 15 10:31:42 2023 user.err basicstation[7492]: [HAL:ERRO] [lgw_usb_close:266] USB PORT FAILED TO CLOSE
Mon May 15 10:31:43 2023 user.err basicstation[7492]: [HAL:ERRO] [lgw_usb_open:197] failed to ping the concentrator MCU
Mon May 15 10:31:43 2023 user.err basicstation[7492]: [HAL:ERRO] [lgw_connect:1182] CONNECTING CONCENTRATOR FAILED
Mon May 15 10:31:43 2023 user.err basicstation[7492]: [RAL:ERRO] Concentrator start failed: lgw_start
Mon May 15 10:31:43 2023 user.err basicstation[7492]: [RAL:ERRO] ral_config failed with status 0x08 ```

I might just update the radio_init.sh script with a usbreset. (you can find the source online easily).

#!/bin/sh

reset either the USB hub or just the device.

if [ ! -e /dev/ttyACM0 ]; then
/usr/bin/usbreset $(lsusb -d 05e3:0608 | sed -En ‘s@^Bus ([0-9]{3}) Device ([0-9]{3}).@/dev/bus/usb/\1/\2@p’)
else
/usr/bin/usbreset $(lsusb -d 0483:5740 | sed -En 's@^Bus ([0-9]{3}) Device ([0-9]{3}).
@/dev/bus/usb/\1/\2@p’)
fi
/bin/sleep 1
/usr/bin/reset_lgw.sh start 11
exit 0

Oh, it seems like the updated radio_init gets the pin from einfo and it was a different pin.
(Only found this out after uhubctl reset didn’t work either.)

Hello @Rafael ,

You need to update to the latest version of the firmware where this problem is solved.
You can find the firmware here: https://downloads.rakwireless.com/LoRa/WisGateOS2/WisGateOS2_Latest_Firmware.zip

Best Regards,
Nikola Semov