Connect a USB device to RAK7258

Hi all,

Device: RAK7258, firmware version LoRaGateway_1.1.0053_Release_r187.

It seems RAK7258 can not recognise my USB device.

Here is the issue:

  1. connect an FTDI FT232 USB to Serial cable to the USB port on RAK7258
  2. enter dmesg to check the USB event, here below is what I can see and I cannot see the ftdi device
    ‘’’
    … …
    [ 39.780000] qmi_wwan 1-1:1.4: no of_node; not parsing pinctrl DT
    [ 39.790000] qmi_wwan 1-1:1.4: cdc-wdm0: USB WDM device
    [ 39.800000] qmi_wwan 1-1:1.4: QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35 work on RawIP mode
    [ 39.820000] qmi_wwan 1-1:1.4 wwan0: register ‘qmi_wwan’ at usb-101c0000.ehci-1, WWAN/QMI device, 22:ff:71:cf:d1:a3
    [ 44.010000] device eth0.1 entered promiscuous mode
    [ 44.020000] device eth0 entered promiscuous mode
    [ 44.080000] br-lan: port 1(eth0.1) entered forwarding state
    [ 44.090000] br-lan: port 1(eth0.1) entered forwarding state
    [ 45.360000] efuse_probe: efuse = 10000002
    [ 45.600000] tssi_0_target_pwr_g_band = 27
    [ 45.600000] tssi_1_target_pwr_g_band = 27
    [ 46.090000] br-lan: port 1(eth0.1) entered forwarding state
    [ 50.470000] S95done (1642): drop_caches: 1
    [ 55.520000] <==== rt28xx_init, Status=0
    [ 57.380000] device ra0 entered promiscuous mode
    [ 57.390000] br-lan: port 2(ra0) entered forwarding state
    [ 57.400000] br-lan: port 2(ra0) entered forwarding state
    [ 59.400000] br-lan: port 2(ra0) entered forwarding state
    [ 62.230000] random: nonblocking pool is initialized
    [ 63.610000] lora_pkt_fwd uses obsolete (PF_INET,SOCK_PACKET)
    [ 797.380000] da match,0x60c5a876121b
    ‘’’
  3. ftdi device not detected and no device added in /dev/

I expect to see:

  1. when I connect the FTDI cable to my Ubuntu 18.04 pc
  2. enter dmesg, I can see the device show up
    ‘’’
    … …
    [ 1116.017254] usb 1-2: new full-speed USB device number 5 using ohci-pci
    [ 1116.575382] usb 1-2: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00
    [ 1116.575386] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 1116.575388] usb 1-2: Product: VE Direct cable
    [ 1116.575391] usb 1-2: Manufacturer: VictronEnergy BV
    [ 1116.575393] usb 1-2: SerialNumber: VE34GJ7D
    [ 1116.586214] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
    [ 1116.586252] usb 1-2: Detected FT-X
    [ 1116.616225] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
    ‘’’
  3. addentional ttyUSB0 is added to /dev/

Thanks.

Cheers,
Paul

You might need to build the appropriate kernel module, or at least load it.

What is on the other end of the FTDI? What are you actually trying to accomplish?

I would like to connect a Arduino at the other end of FTDI, so I can hook up other sensors like to it like i2c, analogue …

I probably could rebuild the kernel (newbie). However, I hope the RAK can provide this driver in default package.

Thanks.

It’s been a long time since Arduino shipped a board with an FTDI, most are CDC/ACM or imitations with a CH340. CDC/ACM probably is supported to be able to use LTE modems.

Anyway, it happens that you could build the 3.18.45 and needed module for one of the open source MT7628 projects and simply copy the driver over, you don’t actually have to reinstall, though you seem to be pursuing enough custom goals that it’s probably worth the effort to make your own build.

Yeah, not exactly the Arduino. The device I am connecting uses FTDI.

Would you please point out what project you are referening to?

Thanks.

Hi mate,

I had another look, in the LoRaGateway_1.1.0053_Release_r188, the usb ftdi serial drivers are installed:

  • kmod-usb-serial-ftdi - 3.18.45-1
  • kmod-usb-serial - 3.18.45-1

and by a closer look at the kernel startup message by command dmesg, I can see that driver seems loaded:

[ 22.350000] usbcore: registered new interface driver ums-usbat
[ 22.380000] usbcore: registered new interface driver usbserial
[ 22.390000] usbcore: registered new interface driver usbserial_generic
[ 22.400000] usbserial: USB Serial support registered for generic
[ 22.460000] xt_time: kernel timezone is -0000
[ 22.470000] usbcore: registered new interface driver ch341
[ 22.480000] usbserial: USB Serial support registered for ch341-uart
[ 22.500000] usbcore: registered new interface driver cp210x
[ 22.510000] usbserial: USB Serial support registered for cp210x
[ 22.520000] usbcore: registered new interface driver ftdi_sio
[ 22.530000] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 22.560000] PPP generic driver version 2.4.2

The problem still exists that the USB device is not detected when plugged in.

Cheers,
Paul

Hi:
The FTDI USB Device Driver in the RAK728 is designed to support the FT2232 chip. We are not sure if it can drive FT232. You can try the command ‘lsusb’ to list all of the usb device. Please confirm that your USB device is in this list.image


I connect a CH341 USB Serial device to the USB Port. It can be recognized successfully.

Hi Yutao,

Thanks for your reply.

Is it possible for you to add support for FT230X chip in your future firmware release?

We deploy solar-powered LoRa Gateways. The solar panel and battery are managed by Victron controller. Solar and battery information can be read via the serial cable which is FT230x based. If RAK can add this driver support in, the gateway can read the Victron controller and post it to the cloud which is essential to operate a battery-powered gateway.

Thanks a lot.

Cheers,
Paul

We checked the code of the Linux kernel driver to confirm that the RAK7258 can support the FT230X chip (ID - 0403:6015).
Please confirm that yor usb device is in this list :
image

That is definitely the critical test.

Question though: is the external USB port functional in all versions of the RAK7258?

Or does the version with an internal LTE modem reserve the processor’s single USB port for that, and make it unavailable to external devices?

On further examination of your kernel log:

[ 39.780000] qmi_wwan 1-1:1.4: no of_node; not parsing pinctrl DT
[ 39.790000] qmi_wwan 1-1:1.4: cdc-wdm0: USB WDM device
[ 39.800000] qmi_wwan 1-1:1.4: QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35 work on RawIP mode
[ 39.820000] qmi_wwan 1-1:1.4 wwan0: register ‘qmi_wwan’ at usb-101c0000.ehci-1,

You appear to have an LTE model of the gateway, and the LTE modem does in fact appear to be connected via USB.

Since the MT7628 chip has only a single USB port, and the RAK7258 motherboard does not appear to have a USB hub I believe your problem is that the external USB port is disabled in favor of the on-board LTE modem.

Hi Chris and Yutao,

Yes, I have LTE version RAK7258.

This seems a hardware limitation then. Is there any workaround? Thank you all for your time investigating this issue.

Cheers,
Paul

The MTK7628 processor itself does indeed have one USB port. But it is part of the RAK634 module that is installed on the RAK7258 motherboard.
Otherwise, how do you explain the following output from the lsusb command?
lsusb

And also the following messages in the boot log:

You have the bare MT7628’s single USB host port and it is occurpied by an LTE modem, so there’s no usable external port available, just as explained before.

Perhaps you’re getting confused by the two root hub devices with linux foundation ID’s - those aren’t hubs in the usual consumer meaning of the word, just how the USB host port itself works. And they’re listed twice because USB 1.1 and USB 2 have distinct software paths.

I have a system that uses a Linkit Smart MT7628 processor module (eg basically the same thing), an actual USB hub, and an LTE modem hanging off of it. In that case lsusb shows the actual physical hub, and the modem we chose to hang off of it, as well as the two Linux Foundation root hub devices.