Best 4G Router and USB Modem Combination?

Things have moved on since I bought the router, so what are the current suggestions?

One Yachtspot 4G with Wifi and an antenna up the mast and a BT router (the one they never collected) down below.

You can buy similar tech from other outfits at lower prices.
 
Don't know much about these things as I don't need one, but they are the subject of this month's Gear Test in Yachting Monthly.
 
The ZTE MF823 is a bit special. It's a SOC in USB format that runs Linux (you can telnet into it as root with password "zte9x15" and get a BusyBox shell). Once plugged into another computer, it boots, switches to USB client mode and pretends to be an Ethernet adapter to the computer it is plugged in, performing DHCP, NAT and routing duties.

However, like most such modems, it has multiple USB modes it can switch between, those being a mass storage device (to supply drivers and card reader mode for the built-in card slot), Ethernet mode (CDC or RNDIS) and several firmware update/serial/diagnostic modes. For any Linux/Unix/Mac router you will want it to be in CDC Ethernet mode.

Quite unlike most other such modems, it does not rely on or obey usb_modeswitch commands to decide what mode to be in and which devices it shall present to the host, but instead decides this itself, based on a "smart" (it really isn't) detection and settings you can apply only in factory (serial) mode. It often gets this wrong, especially on Linux, where it switches to the RNDIS mode instead of CDC. Linux sort of supports RNDIS a little bit, but due to it being complicated and silly, this is often omitted from embedded Linux builds such as those running on most routers, because CDC makes so much more sense.

So in short, you need to connect it to a computer that it auto-detects as one of the Ethernet modes. Then you issue a special "secret" HTTP request to put it into factory (serial) mode. Now you can apply the AT command to stop all this "smart detection" nonsense and always switch into CDC Ethernet mode, which is the only one that makes any sense anyways. It will then remember this and not give you trouble anymore and is actually quite nice and fast (assuming your mobile network is nice and fast). The exact HTTP request for factory mode and AT commands for CDC mode you need can be found on the Arch linux wiki: https://wiki.archlinux.org/index.php/ZTE_MF_823_(Megafon_M100-3)_4G_Modem

I'm using a Russian (Megafon) import one that came unlocked, cost less than the locked UK one (Ebay) and has the external antenna port which some of them lack. After figuring out all the above, it has since worked flawlessly.

Mine is plugged into a Alfa R36 (actually a Solwise copy thereof) running OpenWRT "Chaos Calmer", which is really quite lovely and has grown a pretty web interface and lots of stability in the years since I last used it. As mentioned in another thread somewhere, the R36 happily runs off boaty 12V (~10-15V), has two ethernet ports, a USB port for the modem, Wifi with antenna and an internal serial port for flashing on OpenWRT and/or optionally serving as NMEA router. Flashing OpenWRT on is trivial (no soldering required), although setting up the internal VLAN switch in OpenWRT to get acccess to both ports required a bit of thinking. Would strongly recommend this combination though.
 
... The exact HTTP request for factory mode and AT commands for CDC mode you need can be found on the Arch linux wiki...

Now I thought I was a bit of a geek, but I got a bit lost in there. Tried to set CDC mode but got {"result":"failure"}, possibly because my LED is blinking (green).

Bottom line: can I set CDC mode from a Windows PC?

[Edit] Managed to Telnet into it, now what?
 
Last edited:
I've got a TP-Link TL-MR3220 3G/4G Wireless Router that works OK with my ancient Huawei E220 USB Modem.

However I can't get it to work with my new ZTE MF823 3G-4G Modem although it is meant to be supported.

Things have moved on since I bought the router, so what are the current suggestions?

We've been using a Raspberry Pi as a router with a ZTE MF823 for more than 6 months and its been working fine. A Pi costs about £30 and the software is free http://www.skippersmate.co.uk
 
Now I thought I was a bit of a geek, but I got a bit lost in there. Tried to set CDC mode but got {"result":"failure"}, possibly because my LED is blinking (green).

Bottom line: can I set CDC mode from a Windows PC?

[Edit] Managed to Telnet into it, now what?

You should be able to set the mode from Windows, yes. Did you heed the warning about the Referer header? If doing it from your browser, first visit the homepage of the device, then issue the "FACTORY" switch HTTP request.

You can see which mode the device is in from either the USB diagnostics on the computer you've plugged it in (the product ID is different for different modes) or since you've telnetted in, via `dmesg | grep zte_usb_devices_used`. On mine it looks like this:

Code:
[    5.663634] zte_set_curent_device: zte_set_curent_device: zte_usb_devices_used.FlagTcard normal==================
[    5.673889] zte_set_curent_device: zte_usb_devices_used->composite_id = 0x 3
[    5.673889]  zte_usb_devices_used->vendor_id = 0x19d2
[    5.673920]  zte_usb_devices_used->product_id = 0x1225
[    5.673920] zte_usb_devices_used->functions   = mass_storage zte_usb_devices_used.serial_number= MF8230ZTED010000
[   19.466717] zte_set_curent_device: zte_set_curent_device: zte_usb_devices_used.FlagTcard normal==================
[   19.476239] zte_set_curent_device: zte_usb_devices_used->composite_id = 0x 3d
[   19.476270]  zte_usb_devices_used->vendor_id = 0x19d2
[   19.476270]  zte_usb_devices_used->product_id = 0x1405
[   19.476270] zte_usb_devices_used->functions   = ecm,mass_storage zte_usb_devices_used.serial_number= MF8230ZTED010000

As you can see, mine starts in 0x1225 (Default / mass storage mode) and then after a little while decides to switch to product ID 0x1405 (CDC mode) as desired. Where on the system this setting is stored I do not know - a quick glance at the /etc/rcS-zte suggests it may be in /usr/zte/zte_conf/config/userseting_nvconfig.txt, but no idea which one - switching it via FACTORY mode and the AT command is probably the safer bet. Happy tinkering :)
 
You should be able to set the mode from Windows, yes. Did you heed the warning about the Referer header? If doing it from your browser, first visit the homepage of the device, then issue the "FACTORY" switch HTTP request...

I'll take another look.

I did fire up a Kali Linux box and played for a while. Found it had usb_modeswitch but got no further.
 
So in short, you need to connect it to a computer that it auto-detects as one of the Ethernet modes. Then you issue a special "secret" HTTP request to put it into factory (serial) mode. Now you can apply the AT command to stop all this "smart detection" nonsense and always switch into CDC Ethernet mode, which is the only one that makes any sense anyways. It will then remember this and not give you trouble anymore and is actually quite nice and fast (assuming your mobile network is nice and fast). The exact HTTP request for factory mode and AT commands for CDC mode you need can be found on the Arch linux wiki: https://wiki.archlinux.org/index.php/ZTE_MF_823_(Megafon_M100-3)_4G_Modem
Fantastic. Such a comprehensive post, Yngmar. ?
 
Do you know why you need a blacksmith ?

HWMBO was having a look at the technical data for said ZTE MF823. Since his Russian is rubbish :( he used Google automatic translation. And this is part of the result :

" Thank you, I realized that the need to torment usb_modeswitch. But what to him to apply the config? I do not understand why we need a blacksmith (HUAWEI)?"

Answers most welcome.
 
Update on this:

I've managed to get into FACTORY mode. I believe the reason it didn't work in Linux was because the IceWeasel browser didn't support JavaScript (see here under Troubleshooting).

OK, so now I can no longer access via 192.168.0.1 in my browser, but I can't from Telnet either!

However, I have gained two ZTE devices in Device Manager under Ports (COM & LPT):

ZTE Diagnostics Interface (COM7)
ZTE NMEA Device (COM6)

(I also have a Wireless iAP in Other Devices, ignoring for the moment)

Should I stick with Windows to issue commands via PuTTY? If so, do I just address COM6 or COM7? [See Post #16 below]

[EDIT]
Just found that the devices have Hardware ID of USB\VID_19D2&PID_0016&REV_5009&MI_01
So now I understand where the 19D2 comes from in the Linux lsusb output, but a bit concerned about 0016
 
Last edited:
Decided to go for it on ZTE NMEA Device (COM6)

Code:
ATI
Manufacturer: ZTE CORPORATION
Model: MF823
Revision: BD_MF823HDV1.0.0B02
IMEI: 866948015920633
+GCAP: +CGSM,+DS,+ES

OK
AT+CREG?
+CREG: 0,1

OK
AT+COPS?
+COPS: 0,0,"3",2

OK
AT+ZCDRUN=8+AT+ZCDRUN=F
Close autorun state result(0:FAIL 1:SUCCESS):1

OK
So same result as in Switch Mode in OSX section of Ingmar's link.

Unfortunately, the modem still won't connect via my router. I've decided to try a TP-LINK TL-MR3020 Portable 3G/4G Wireless N Router instead.
 
Last edited:
Code:
AT+ZCDRUN=8+AT+ZCDRUN=F
Close autorun state result(0:FAIL 1:SUCCESS):1

OK

That looks good on MF823 side now. When you plug it into your Linux, does it now switch itself to product id 0x1405 (CDC Ethernet)? If it does it on Kali Linux, it ought to do the same on your router.

If you can get a shell on the router, you can check what mode/product id it presents itself as there and if it's the right one, why it isn't working. You may or may not need to install the CDC/Ethernet kernel modules if not already present. On OpenWRT the package is "kmod-usb-net-cdc-ether" (plus a few dependencies) and installed via a few clicks from the software menu.
 
Just found that the devices have Hardware ID of USB\VID_19D2&PID_0016&REV_5009&MI_01
So now I understand where the 19D2 comes from in the Linux lsusb output, but a bit concerned about 0016

That looks good on MF823 side now. When you plug it into your Linux, does it now switch itself to product id 0x1405 (CDC Ethernet)? If it does it on Kali Linux, it ought to do the same on your router...

I haven't tried it in Kali, but in my new TL-MR3020 it still doesn't work. System log from router:

...
1st day 00:00:32 3G/4G INFO LTE MODEM = 0, status = 1, targetVendorID = 0x0, targetProductID = 0x0
1st day 00:00:37 3G/4G INFO Before Mode switch VendorID = 0x19d2, ProductID = 0x0016
1st day 00:00:37 3G/4G INFO Memory command is matched.
1st day 00:00:43 3G/4G NOTICE after switch modem vid is 0x19d2 pid is 0x0016
1st day 00:00:43 3G/4G INFO LTE MODEM = 0, status = 2, targetVendorID = 0x19d2, targetProductID = 0x16
1st day 00:00:44 3G/4G INFO USB modem is ready
1st day 00:00:45 3G/4G NOTICE setModemISP 1421 mcc is 234, mnc is 200
1st day 00:00:53 PPP NOTICE Standard authentication.
1st day 00:00:53 3G/4G NOTICE 3G/4G start connecting...
1st day 00:00:53 3G/4G INFO Run 3G dial cmd: pppd 3g 1 /dev/ttyUSB1 115200 connect "chat -s -v -f /etc/ppp/c
1st day 00:00:53 PPP INFO pppd start
...


Perhaps I need to start again. Did you say there was a way to get the ZTE MF823 back to the factory defaults?
 
Last edited:
I haven't tried it in Kali, but in my new TL-MR3020 it still doesn't work. System log from router:

...
1st day 00:00:32 3G/4G INFO LTE MODEM = 0, status = 1, targetVendorID = 0x0, targetProductID = 0x0
1st day 00:00:37 3G/4G INFO Before Mode switch VendorID = 0x19d2, ProductID = 0x0016
1st day 00:00:37 3G/4G INFO Memory command is matched.
1st day 00:00:43 3G/4G NOTICE after switch modem vid is 0x19d2 pid is 0x0016
1st day 00:00:43 3G/4G INFO LTE MODEM = 0, status = 2, targetVendorID = 0x19d2, targetProductID = 0x16
1st day 00:00:44 3G/4G INFO USB modem is ready
1st day 00:00:45 3G/4G NOTICE setModemISP 1421 mcc is 234, mnc is 200
1st day 00:00:53 PPP NOTICE Standard authentication.
1st day 00:00:53 3G/4G NOTICE 3G/4G start connecting...
1st day 00:00:53 3G/4G INFO Run 3G dial cmd: pppd 3g 1 /dev/ttyUSB1 115200 connect "chat -s -v -f /etc/ppp/c
1st day 00:00:53 PPP INFO pppd start
...


Perhaps I need to start again. Did you say there was a way to get the ZTE MF823 back to the factory defaults?

Looks like it is stuck in 0x0016 instead of switching to Ethernet. You can factory reset it from the web interface, if you can get back there: Settings -> Device -> Reset (the menu for that is hidden in the little grey triangle next to PIN Management).

Failing that, you'll have to tell it to switch via the AT commands on the modem serial port (Arch wiki has all the details).

mf823_reset.PNG
 
Top