OpenWrt3GModem

USB 3G modem on OpenWRT

cf: https://wiki.openwrt.org/doc/recipes/ltedongle

opkg update
opkg install usb-modeswitch
opkg install usb-modeswitch kmod-mii kmod-usb-net kmod-usb-wdm kmod-usb-net-qmi-wwan uqmi
 

Network configuration

root@GL-iNet:~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd66:67b7:4126::/48'

config interface 'lan'
        option ifname 'eth1'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.0.66'
        option netmask '255.255.255.0'
        option gateway '192.168.0.254'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'
        option hostname 'GL-iNet-ec5'

config interface 'wan6'
        option _orig_ifname '@wan'
        option _orig_bridge 'false'
        option proto '3g'
        option pincode '1234'
#       option username 'free'
#       option password 'free'
        option delegate '0'
#       option service 'gprs_only'
        option service 'umts'
        option device '/dev/ttyUSB1'
        option apn 'free'
 

Power consumption

Peak at 0.05A during http request from 0.026 to 0.032 connected

  1. send sms With usb 3G modem
#!/bin/sh

# Modem device
DEV=/dev/ttyUSB1
# Destination mumber

DESTNUM="0600000000"
# Message
SMS="Coucou du routeur ! :-)"

# we need to put sleep 1 to slow down commands for modem to process
echo -e "ATZ\r" >$DEV
sleep 1
echo -e "AT+CMGF=1\r" >$DEV
sleep 1
echo -e "AT+CMGS=\"$DESTNUM\"\r" >$DEV
sleep 1
echo -e "$SMS\x1A" >$DEV