NOTE: this is not about battery operated 4G modems (such as the huwawei E5577 for example), see here for instructions to connect 4G modems via USB to openwrt
This is a 4MB space tp-link router, here are the steps
opkg install kmod-usb-serial kmod-usb2 luci-proto-3g kmod-usb-serial-option usb-modeswitch kmod-usb2 kmod-usb-serial-wwan kmod-usb-serial ppp comgt
A package required for older releases of openwrt
opkg install sdparm
And the optional package
opkg install usbutils
Now, reboot the router, then go to the routers LUCI interfaces page, then add an interface
From the drop down, chose UMTS/GPRS
On the next page, you should see one of the devices names /dev/ttyUSB0, in my case there are 2 since the device provides a storage controller, the modem was on USB0 not USB1, your might be different (try both if you have 2)
Now i chose UMTS only so that the modem will always use 3G because edge is good for nothing
Then your APN and username/password as you would on a phone or anywhere else… then save and apply