Fumbling With OpenWrt and RM500U-CN

Apologies, basically looking for some help , I am far from an expert when it comes to Linux or OpenWRT , though I appreciate it, and my experience with it is just basic, replacing crappy stock routers with OpenWRT to use the extra functions , such as VLANS , multiple DHCP , FIrewall rules and power schedules ..

My next challenge was finding affordable internet 50Mb up , so 5G with an unlocked or Open Source router was an idea that had drove me to into a 5G rabbit hole until I came across Wavshare's 5G solution here , which includes a Quectel RM500U-CN M.2 modem, which has Band 78 support (used locally by Cells here in UK) , despite being manufactured for the Chinese Market .. These are allegedly sold worldwide , so I had the impression that I could get the same modem working in one of my X86 PC's or Routers with M.2 slots, running OpenWRT

image

I purchased one of these Quectel RM500U-CN M.2 Modems (Just the modem , not the entire Hat) for $50 along with a batch of computer parts from Taobao .. I had a ZBT 1602 with M.2 adapter ,an M.2 USB caddy for 4G/5G Networks cards and also a ITX board with an M.2 1 x M.2 Socket for network PCIE/USB mode

However I am lost , when it comes to getting this working . I experiemented with the USB first , to can get Windows to recognize the modem , update the firmware , and also send AT commands through a terminal but . Though I am just stabbing in the dark , so to speak . It just shows as a disconnected as an ethernet device , after exhausting the suggested commands .

I have read many articles and guides .. So there is some encouragement , apparently the modem is MBIM Compliant here on Openmptcp github , so I guess that suggests it can work

The modem woks with OpenWRT According to Wavshare's OpenWRT tutorial here,

Though this suggests to put the modem into QMI mode .. Though the Former link suggests to use MBIM mode - maybe I am just thick ?

I currently have the Modem attached via USB caddy to a OpenWRT ITX X86/64 Build . I was hoping it would it would be recognised , I am guessing this is just wishful thinking

If anyone can advise , this would be great ..

1 Like

The easiest way is probably use ECM, AT+QCFG="usbnet",1
OpenWrt configuration per https://openwrt.org/docs/guide-user/network/wan/wwan/ethernetoverusb_cdc
You will need to send some extra commands to the modem to initiate the connection, similar to Quectel EC200T-CN LTE module not working in OpenWrt - #18 by AndrewZ

1 Like

Would you or anyone else be interested in a team view or other remote connection ? I could offer a donation and for posterity document the the solution

Thanks

1 Like

Just in case anyone else finds this dead end, the instructions provided are correct, but a little more would help, so I will document how I got it working in a logical order here as this is where I ended up first, I tried RNDIS (got DHCP IP assigned but no external connection), NCM (Openwrt just kept asking the modem for the modem manufacturer id, which the modem duly returned, rinse and repeat) and ECM, ECM is the only one that worked. Apparently later versions of firmware can do MBIM, mine can't. I used an MT1300 running 23.05.0 just because it was to hand. Much of the info came from https://openwrt.org/docs/guide-user/network/wan/wwan/ethernetoverusb_cdc

  1. Plug your modem with sim into your Openwrt device USB port, mine seems to have plenty of USB power (USB3) but the manufacturer warns of low power USB causing issues, there is a seperate USB-C power input on the modem, the switch on the side switches between router USB power and local USB connector power.

  2. Your OpenWrt device will need a working internet connection, I just pulled the LAN cable from the back of my PC and plugged into the device WAN port, then cabled my PC back into a LAN port on the device so I could ssh in, noting that my LAN subnet is different to the openWrt device subnet, this is important, the opkg commands will probably fail if they are the same. ssh as root into your openwrt device and run:-

opkg update
opkg install kmod-usb-net-cdc-ether usb-modeswitch kmod-usb-serial-option picocom

Not sure if usb-modeswitch and kmod-usb-serial-option are actually required but they're there anyway.

  1. run

picocom -D /dev/ttyUSB2

this gets you talking directly to the modem so you can set it to the correct mode, this came from the RM500-CN manual https://www.waveshare.com/wiki/RM500U-CN_5G_HAT

  1. run

ATE1
AT+CPIN?
AT+QCFG="usbnet",1
AT+QNETDEVCTL=2,3,1
AT+CFUN=1,1

The last line reboots the modem, from what I've read it may also actually be saving the config before it reboots as well. Use CTRL-A then X to exit minicom.

  1. I did the following in luci simply because I don't know how to in the cli, the commands are probably in the linked instructions:-

Network -> Interfaces -> "Add new interface"

Name it, it's a DHCP client, the Device is "usb0", in the Firewall Settings tab "Create/Assign firewall zone" select the wan zone.

Save, Save and apply. Leave it a bit, you should get an IPv4 upstream device appear on the overview page with the "Device" Ethernet adaptor: "usb0", it should have lovely ip addresses populated in the ip address fields

Hopefully works, mine does, both 3 and EE in the UK. I did suffer initially with really slow download speeds, but I think I was just using AT+QCFG="usbnet",1 to set ECM mode without the other commands from the manual (noting AT+QENG="serving cell" from the manual doesn't work)

Interesting if it works for anyone else. It's been power cycled a few times and seems to be holding.

usb-modeswitch is not needed, kmod-usb-serial-option is required.
These commands need to be run once:

AT+QCFG="usbnet",1
AT+QCFG="nat",0
AT+QICSGP=1,1,"apn"
AT+QNETDEVCTL=1,3,1
AT+CFUN=1,1

Replace apn with your APN name.

Correct syntax is AT+QENG="servingcell"

1 Like

Didn't seem to need AT+QCFG="nat",0 or AT+QICSGP=1,1,"apn". One thing to note is I now don't get /dev/ttyUSB[1-4] created so can't minicom back in.Hoping it's the driver doing the right things and plugging into a device without the drivers will let me in. I also note you use 1,3,1 for QNETDEVCTL, when the manufacturer list 2,3,1 in their instructions, am I correct in digging out that first 1 is manual connect, 3 is auto connect, and what I would expect, and 2 not being in any document I could find :confused: