svollebregt
Occasional Visitor
I am trying to use my ASUS RT-AC68U router to read-out a device through the serial interface. The device send a 35 lines message every 20 seconds, of which I want to capture some data. I tested the USB convertor under Windows and Ubuntu 16.04.3 on my laptop, and I have no problems in receiving the messages.
However, things didn't go as expected on asuswrt.merlin 380.68 with entware installed. At first the interface kept disconnecting, which I fixed by mknod /dev/ttyUSB0 c 188 0 as suggested here: https://github.com/RMerl/asuswrt-me...ux/linux-2.6/Documentation/usb/usb-serial.txt
Now dmesg | grep tty shows this:
serial8250.0: ttyS1 at MMIO 0x18000400 (irq = 117) is a 16550
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
It is a bit puzzling to see the devices apparently connects and disconnects (or maybe it is because I plugged it in and out a few times since the last reboot). In contrast to Ubuntu the device also shows up as a GSM modem. The chipset, however, is CH340 and is also recognized as ch340 or ch341 (drivers should be the same, can't remember which) by Ubuntu.
lsusb on the router shows my device as:
Bus 002 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
But as far as I know the ch341 driver is missing and the generic usbserial driver or some GSM driver is loaded instead. In any case, upon opening /dev/ttyUSB0 with screen or minicom the system just keeps waiting for input.
I don't seem to be the only one encountering this, as in the past patches seem to have been made which enabled the CH341 driver, e.g.: https://www.snbforums.com/threads/ntp-daemon-for-asuswrt-merlin.28041/page-4
Unfortunately, I have no clue how to add the required driver support to my running 380.68 and was hoping someone could point me in the right direction. My guess is I probably have to patch the source and build it myself using this nice guide: https://github.com/RMerl/asuswrt-merlin/wiki/Compile-Firmware-from-source-using-Ubuntu. Patching the source is probably the biggest difficulty, no clue how to do that. I'm kinda rusty with Linux, and I think it has been at least 15 years since I compiled my last kernel or anything in Linux, so please be gentle ;-)
However, things didn't go as expected on asuswrt.merlin 380.68 with entware installed. At first the interface kept disconnecting, which I fixed by mknod /dev/ttyUSB0 c 188 0 as suggested here: https://github.com/RMerl/asuswrt-me...ux/linux-2.6/Documentation/usb/usb-serial.txt
Now dmesg | grep tty shows this:
serial8250.0: ttyS1 at MMIO 0x18000400 (irq = 117) is a 16550
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
It is a bit puzzling to see the devices apparently connects and disconnects (or maybe it is because I plugged it in and out a few times since the last reboot). In contrast to Ubuntu the device also shows up as a GSM modem. The chipset, however, is CH340 and is also recognized as ch340 or ch341 (drivers should be the same, can't remember which) by Ubuntu.
lsusb on the router shows my device as:
Bus 002 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
But as far as I know the ch341 driver is missing and the generic usbserial driver or some GSM driver is loaded instead. In any case, upon opening /dev/ttyUSB0 with screen or minicom the system just keeps waiting for input.
I don't seem to be the only one encountering this, as in the past patches seem to have been made which enabled the CH341 driver, e.g.: https://www.snbforums.com/threads/ntp-daemon-for-asuswrt-merlin.28041/page-4
Unfortunately, I have no clue how to add the required driver support to my running 380.68 and was hoping someone could point me in the right direction. My guess is I probably have to patch the source and build it myself using this nice guide: https://github.com/RMerl/asuswrt-merlin/wiki/Compile-Firmware-from-source-using-Ubuntu. Patching the source is probably the biggest difficulty, no clue how to do that. I'm kinda rusty with Linux, and I think it has been at least 15 years since I compiled my last kernel or anything in Linux, so please be gentle ;-)