Trying to use USB-to-RS232 (FTDI) with Mofi 3500

I have a Mofi 3500-3GN ver. 2 rev. 2.

I am trying to use an FTDI based USB-to-serial adapter with this router's built in USB port. Starting with the latest firmware on their website ("9.2 std", somewhat based on Barrier Breaker r36346, kernel 3.3.8, but customized and compiled by them in unknown ways), dmesg and lsusb shows:

# dmesg 
...
[  429.090000] usb 1-1: new full-speed USB device number 2 using dwc_otg

# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

However no new device shows up under /dev/tty___

I have also tried with 17.01.5, 18.06.0, 18.06.1...
(e.g. from https://archive.openwrt.org/releases/17.01.5/targets/ramips/rt305x/lede-17.01.5-ramips-rt305x-mofi3500-3gn-squashfs-sysupgrade.bin)

...followed by various combinations of "opkg update" and "opkg install kmod-usb-serial-ftdi"
(both letting opkg download it or also manually getting e.g. from https://archive.openwrt.org/releases/17.01.5/targets/ramips/rt305x/packages/kmod-usb-serial-ftdi_4.4.140-1_mipsel_24kc.ipk)

In no case could I see a new device show up under /dev/tty___. Can anyone direct me as to how I may get this to work?

Note, this question is separate from talking to the router through the router's onboard serial through the 4-pin header (which I am also doing with a different USB-to-TTL adapter). I need to use the router's USB (plus this FTDI adapter) to log data from another serial device.

Have you done this yet?

opkg update
opkg install kmod-usb-serial kmod-usb-serial-ftdi

Did you reboot?

Can you paste a copy of this install output?

Can you paste a copy of this install output?

# opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/ramips/packages/Packages.gz.
Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trunk/ramips/packages/Packages.gz, wget returned 8.

So with the stock firmware from mofinetwork.com, the repository address appears to be an old/broken URL.

After I edit opkg.conf to change the first line (guessing here based on browsing manually for where Packages.gz is found on the archive.openwrt.org server):
changed from:

src/gz barrier_breaker http://downloads.openwrt.org/snapshots/trunk/ramips/packages

to:

src/gz barrier_breaker http://archive.openwrt.org/snapshots/trunk/ramips/rt305x/packages/packages

...then I get

# opkg update
Downloading http://archive.openwrt.org/snapshots/trunk/ramips/rt305x/packages/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker.
# opkg install kmod-usb-serial kmod-usb-serial-ftdi
Package kmod-usb-serial (3.3.8-1) installed in root is up to date.
Unknown package 'kmod-usb-serial-ftdi'.
Collected errors:
 * opkg_install_cmd: Cannot install package kmod-usb-serial-ftdi.

The above tests are just with the stock firmware as I described above. As I said I (previously) tried similar opkg commands with 17.01.5, 18.06.0, 18.06.1 but I did not grab the full output of opkg install ... at that time. I can do now but which is the first one I should try?

In the future, please inform us that you are not using OpenWrt software.

This is not suggested.

Ummm...Barrier Breaker is no longer supported.

I would always suggest the most up-to-date, 18.06.1.

kmods must match the built kernel version exactly. If you're using a custom build and the group that built it doesn't offer the kmod you need in their repository, you are out of luck.

1 Like

Since Barrier Breaker hasn't been supported (and is therefor not secure to utilize) in over 4 years, you're better off doing one of the following:

  • Work on compiling OpenWrt 18.06.1 for the Mofi 3500, as nothing comes up in the Table of Hardware when searching for "mofi"

  • Buy a newer device with a SoC that's supported by OpenWrt, which I believe someone else posted in the past two weeks is ~$20 for the cheapest device (can't recall what brand/model)
1 Like

Following up on that good suggestion, there are plenty of opinions on dirt-cheap, cheap, and inexpensive options that will run current versions of OpenWrt in the long thread

1 Like

I really appreciate all the several replies and your trying to help. But I don't understand some of these comments.

e.g. "inform us when not using OpenWrt" I informed in my very second line "latest firmware on their website" in OP. and I also described trying 3 "real" OpenWrt versions with same results (I just didn't want to make a 20 page post with every single command I tried plus its output from all 4 versions: stock + 17.01.5 + 18.06.0 + 18.06.1)

e.g. "nothing in hardware table searching mofi" the openwrt site has Mofi3500-specific ...initramfs-kernel.bin and ...squashfs-sysupgrade.bin files for the 3 versions I mentioned above, which I also mentioned in my OP. Is that not a correct place from which to get a .bin firmware file? (or the equivalent 18.06.1 URL)

So as I said I tried 4 versions, then for the purposes of troubleshooting and asking for help here, I started back at the beginning with the company-supplied version.

For now I will follow the advice of trying 18.06.1 and report back. Thank you.

1 Like

You can't simply edit the repositories. If mofinetwork was the domain in your router, then you are not running OpenWrt firmware.

You are running firmware compiled by the OEM using OpenWrt.


If that is not the case, I apologize for the confusion.

:+1:

Be sure to reinstall the drivers each time.

Please post a link, as searching for mofi* in Brand or Model in the Table of Hardware shows no devices found.

1 Like

mofi3500-3gn is found here https://archive.openwrt.org/releases/18.06.1/targets/ramips/rt305x/ (and similarly for 18.06.0 and 17.01.5). So I somehow found my way to those downloads folders before ever finding the table of hardware page (which clearly, as you say, has no mofi listed there).

So what does it mean when it is in one place and not in the other?

And, despite it not being in the table of hardware, shouldn't the next thing I try (for getting my FTDI device working) be the mofi specific firmware found in the above releases folder?

1 Like

It just means the ToH needs to be updated. Also, if you find an OpenWrt weblink with Archive in it, it should not be used. The link should be: https://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/

  • You're likely going to want to compile your own firmware, as my guess is that's a 16MB ROM device,
1 Like

While I appreciate this as a prediction of my future : - ), but should I not try this firmware (already specific to mofi3500-3gn model) built by the project's main build process first? https://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/openwrt-18.06.1-ramips-rt305x-mofi3500-3gn-initramfs-kernel.bin

And then based on what errors, hurdles, or gotchas are found that way, then I know what I'm trying to achieve when building it myself?

You'll just want to ensure you continually monitor the free space on /overlay when installing packages:
df -h | grep /overlay

Is that what the 128 MBit (= 16 MB) is referring to here? This is within the first few lines of the serial output on the 4 pin header while powering up:

...
Board: Ralink APSoC DRAM:  32 MB
...
ASIC 3052_MP2 (Port5<->None)
DRAM component: 128 Mbits SDR
DRAM bus: 32 bit
Total memory: 32 MBytes
Flash component: NOR Flash
...

@mucm I'm not sure... but since 128mbit = 16MB, it's likely.

  • I was going off a post on the Mofi site for the firmware download, which said is was ~7.5MB with ~7.5MB free.

okay, upgraded using openwrt-18.06.1-ramips-rt305x-mofi3500-3gn-initramfs-kernel.bin. Made 1 firewall change and then I power cycled and noticed the firewall setting I had done was not kept after power cycle. So I then did the squashfs-sysupgrade using openwrt-18.06.1-ramips-rt305x-mofi3500-3gn-squashfs-sysupgrade.bin. After that, firewall changes were kept after power cycles (I guess I was supposed to understand that already), and the overlay partition was larger (640 kb to 4.3 Mb).

So I ran the opkg commands, and rebooted, as recommended early on in this thread.

root@OpenWrt:/# df |grep overlay
/dev/mtdblock6            4352       292      4060   7% /overlay
overlayfs:/overlay        4352       292      4060   7% /

root@OpenWrt:/# opkg update
Downloading http://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/telephony/Packages.sig
Signature check passed.
root@OpenWrt:/# opkg install kmod-usb-serial kmod-usb-serial-ftdi
Installing kmod-usb-serial (4.14.63-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/packages/kmod-usb-serial_4.14.63-1_mipsel_24kc.ipk
Installing kmod-nls-base (4.14.63-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/packages/kmod-nls-base_4.14.63-1_mipsel_24kc.ipk
Installing kmod-usb-core (4.14.63-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/packages/kmod-usb-core_4.14.63-1_mipsel_24kc.ipk
Installing kmod-usb-serial-ftdi (4.14.63-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.1/targets/ramips/rt305x/packages/kmod-usb-serial-ftdi_4.14.63-1_mipsel_24kc.ipk
Configuring kmod-nls-base.
Configuring kmod-usb-core.
[  612.327364] kmodloader: loading kernel modules from /etc/modules.d/*
[  612.443202] usbcore: registered new interface driver usbfs
[  612.454583] usbcore: registered new interface driver hub
[  612.465617] usbcore: registered new device driver usb
[  613.250260] usbcore: registered new interface driver usbserial
[  613.262316] usbcore: registered new interface driver usbserial_generic
[  613.275784] usbserial: USB Serial support registered for generic
[  613.294297] usbcore: registered new interface driver ftdi_sio
[  613.306191] usbserial: USB Serial support registered for FTDI USB Serial Device
[  613.323804] kmodloader: done loading kernel modules from /etc/modules.d/*
Configuring kmod-usb-serial.
[  613.481226] kmodloader: loading kernel modules from /etc/modules.d/*
[  613.499621] kmodloader: done loading kernel modules from /etc/modules.d/*
Configuring kmod-usb-serial-ftdi.
[  613.626344] kmodloader: loading kernel modules from /etc/modules.d/*
[  613.644241] kmodloader: done loading kernel modules from /etc/modules.d/*

(rebooted)

root@OpenWrt:/# df |grep overlay
/dev/mtdblock6            4352       404      3948   9% /overlay
overlayfs:/overlay        4352       404      3948   9% /

root@OpenWrt:/# ls -latr /dev/ | tail -n 5
crw-------    1 root     root        5,   1 Jan  1  1970 console
crw-------    1 root     root      108,   0 Dec  5 19:23 ppp
srw-rw-rw-    1 root     root             0 Dec  5 19:23 log
drwxr-xr-x    3 root     root          1180 Dec  5 19:23 .
crw-------    1 root     root        4,  64 Dec  5 19:48 ttyS0

(connected FTDI based USB-to-RS232 device to router's USB port)

root@OpenWrt:/# ls -latr /dev/ | tail -n 5
crw-------    1 root     root        5,   1 Jan  1  1970 console
crw-------    1 root     root      108,   0 Dec  5 19:23 ppp
srw-rw-rw-    1 root     root             0 Dec  5 19:23 log
drwxr-xr-x    3 root     root          1180 Dec  5 19:23 .
crw-------    1 root     root        4,  64 Dec  5 19:48 ttyS0

So as I said in my OP, no new device shows up under /dev/ when I connect this USB device. Any additional ideas now that I am at a "known" place on a recent release would be appreciated.

So now you are running a new official version, and it looks like there is 8 MB of flash, which is plenty for this situation.

It must be the wrong driver for the device. There are a bunch of different FTDI chips, I don't know if they all use the same driver.

Plug in the device while running, this should cause a series of kernel log messages as the drivers load. If you only see "new high speed USB device" and no more, that means that the low level kmod-usb has enumerated the device on the bus, but no high-level driver has claimed it.

If you don't see any log messages after hot-plugging in the device, that means that the low level USB is not working. This is often because there is a switchable power supply to the USB port, and a GPIO pin needs to be set to turn it on.

1 Like

Well as I saw in OP when at least lsusb worked for this device, it is USB ID 0403 6001 (and this is also seen when connecting to desktop Linux PC).

Sadly, none:

root@OpenWrt:~# dmesg |tail -n 5
[   24.809328] br-lan: port 1(eth0.1) entered blocking state
[   24.820264] br-lan: port 1(eth0.1) entered forwarding state
[   24.831844] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   25.509533] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  114.020350] random: crng init done

(then I connected USB device)

root@OpenWrt:~# dmesg |tail -n 5
[   24.809328] br-lan: port 1(eth0.1) entered blocking state
[   24.820264] br-lan: port 1(eth0.1) entered forwarding state
[   24.831844] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   25.509533] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  114.020350] random: crng init done

Hmm, but the LEDs on the dongle come on (and similarly lights come on for a USB thumb drive, and also similar there's no dmesg lines for that either - I guess because USB filesystem features are not in the plain 18.06.1 firmware).

Does this imply that power to the USB port is not the issue? Or if port power could be the issue (despite these LEDs lighting) then can you direct me to any docs on controlling it via the GPIO?

If you can provide the brand & model of the cable, and/or the FTDI chip model, it will help us in figuring out which driver package you need to install

  • Also, are you utilizing a USB-TTL cable, USB-to-RS232 cable, or a USB-to-UART board?