I get a cheap 4G modem recently. Very interesting, my BOM cost of such thing will be over 150CNY(consider mass production 10K), but the provider of the 4G modem sell it only 100CNY and provide 6GB free data usage…
The modem is based on MDM9600 from Qualcomm which is well known since 2012.
PS: now I know the low cost secret 🙂 all recycle chips…kind of environmentalist?
Let me explain how to make it work with VoCore2.
Prepare Firmware
First need to add kmod-usb-serial to firmware, old version of vocore2 firmware do not have it inside, you need to recompile your firmware and put the driver inside…it can not be install from opkg update. Or use later than 20190802 version firmware, I have embed it into firmware.
It is in make menuconfig -> Kernel modules -> USB Support -> (* or M)kmod-usb-serial
After this, we can upload the firmware to vocore2 and use opkg install other necessary packages(or you can directly compile them from source)
opkg update opkg install usb-modeswitch usbutils
Install these packages should be enough, but in order to make it easier, we can also install luci-proto-3g, so we can setup in luci web interface.
Once we plugin the USB 4G modem to vocore2 usb port, new device will show when you call lsusb:
Bus 001 Device 003: ID 05c6:92fe Qualcomm, Inc
This is not the real modem, just a virtual usb disk, we need to use usbmode to switch it into modem mode.
openwrt provided usb-modeswitch can do this, but it do not have my 4G modem USB VID/PID which is 05c6:92fe.
I have to patch /etc/usbmode.json in vocore2. add config to its line 453, right after 05c6:9024
"05c6:92fe": { "*": { "t_vendor": 1478, "t_product": [ 36901 ], "mode": "StandardEject", "msg": [ ] } },
PS: just eject the disk then the mode changes…simple.
and then call “usbmode -s”, the USB disk now switch to real LTE modem.
now call lsusb, you will find a new device:
Bus 001 Device 003: ID 05c6:9201 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)
and in /dev/ folder, you will find ttyUSB0, ttyUSB1, ttyUSB2, ttyUSB3.
note: use command comgt -d /dev/ttyUSBx to check which ttyUSB is usable, mine is ttyUSB1
setup usbserial driver to this device:
usbserial is load at startup.
echo "usbserial vendor=0x05c6 product=0x9201" > /etc/modules.d/usb-serial
Or call insmod with parameters.
Now after reboot, it is ready to use.
Setup Network
For simple, just use luci, in Network -> Interfaces, click on “Add Interface”
note: APN and dial number might be different for different service providers.
Then click “Save and Apply”, you can access to internet by 4G now 🙂
Or we can do it in a HARD way, do it in console.
add config to /etc/config/network.
config interface 'lte' option proto '3g' option device '/dev/ttyUSB1' option service 'umts' option apn '3gnet' option dialnumber '*99#' option ipv6 'auto'
add config to /etc/config/firewall
config zone option name 'wan' list network 'wan' list network 'wan6' list network 'wwan' list network 'lte' option output 'ACCEPT' option forward 'REJECT' option masq '1' option mtu_fix '1' option input 'ACCEPT'
manually run to start ppp diag…(I am lazy, did not test this, might not work) or just simply call /etc/init.d/network restart
/usr/sbin/pppd nodetach ipparam lte ifname 3g-lte lcp-echo-interval 1 lcp-echo-failure 5 lcp-echo-adaptiv
after that you can find it in your ifconfig.
3g-lte Link encap:Point-to-Point Protocol inet addr:10.14.231.24 P-t-P:10.64.64.64 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:408 errors:0 dropped:0 overruns:0 frame:0 TX packets:474 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:148233 (144.7 KiB) TX bytes:79615 (77.7 KiB)
And now you can access internet once connect to VoCore2 hotspot.
PS: I find a bug, after reboot, pppd service will start but after around 10 seconds, it disappears. Look like some network process killed it.
Have to change the /etc/config/network, ttyUSB1 change to ttyUSB2(or USB2 to USB1) and restart network after boot up ready.