Dual stack with qmicli 1.16.2/1.20.0 and D-Link DWM-222
Marc Andre Selig
ma913 at sedacon.com
Sun Jun 10 13:29:50 UTC 2018
On Sun, Jun 10, 2018 at 11:54:57AM +0200, Reinhard Speyerer wrote:
> On Sat, Jun 09, 2018 at 09:39:47PM +0200, Marc Andre Selig wrote:
> > I am trying to get a D-Link DWM-222 USB LTE modem to work in dual
> > stack mode using qmicli; I tried versions 1.16.2 and 1.20.0.
> for dualstack to work you need a corresponding IPV4V6 entry
[...]
> and you have to use a second CID for the IPv6 commands as in Bjørn's example.
Thank you very much! This is what I missed.
This particular modem seems to work with 802-3 as link layer protocol.
In case anybody comes looking, I am attaching a simple init script.
In /etc/network/interfaces, I just added "iface wwan0 inet dhcp" and
"iface wwan0 inet6 auto".
Thanks again!
Marc
------ cut here for /etc/init.d/network-wwan -----
#! /bin/sh
### BEGIN INIT INFO
# Provides: network-wwan
# Required-Start: mountkernfs $local_fs $syslog urandom
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: bring wwan interface up when device is ready
# Description: This script brings up a wwan interface in dualstack
# mode with a D-Link DWM-222 LTE USB modem.
# It was tested with qmicli 1.20.0; it definitely does
# not work with qmicli 1.16.2 as provided by Debian 9.
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/usr/bin
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
. /lib/init/vars.sh
PIN=1234
APN=internet.t-mobile
DEV=/dev/cdc-wdm0
SERIAL=/dev/ttyUSB2
DUALSTACK=yes
do_start () {
DEV="-d $DEV --device-open-qmi"
i=0
while [ ! -e /dev/cdc-wdm0 ]; do
echo "Waited $i seconds for device initialization"
i=$((i+1))
sleep 1
done
i=0
qmicli $DEV --dms-uim-verify-pin=PIN,$PIN
while ! qmicli $DEV --dms-uim-get-state | grep initialization-completed; do
echo "Waited $i seconds for network registration"
i=$((i+1))
sleep 1
done
sleep 1
echo 'AT+CGDCONT=1,"IPV4V6","'$APN'"' >$SERIAL
QAR="$DEV --client-no-release-cid"
CID4=$(qmicli $QAR --wds-noop|awk -F\' '/CID/{print $2}')
qmicli $QAR --client-cid=$CID4 --wds-set-ip-family=4
qmicli $QAR --client-cid=$CID4 --wds-start-network=apn=$APN
qmicli $QAR --client-cid=$CID4 --wds-get-current-settings
echo CID4=$CID4 >/run/network-wwan.cid
if [ "$DUALSTACK" = yes ]; then
CID6=$(qmicli $QAR --wds-noop|awk -F\' '/CID/{print $2}')
qmicli $QAR --client-cid=$CID6 --wds-set-ip-family=6
qmicli $QAR --client-cid=$CID6 --wds-start-network=apn=$APN
qmicli $QAR --client-cid=$CID6 --wds-get-current-settings
echo CID6=$CID6 >>/run/network-wwan.cid
fi
ifup wwan0
}
case "$1" in
start)
do_start 2>&1 | tee /run/network-wwan.log &
;;
restart|reload|force-reload|status)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
ifdown wwan0
. /run/network-wwan.cid
[ "$CID4" ] && qmicli -d $DEV --device-open-qmi --client-cid=$CID4 \
--wds-stop-network=disable-autoconnect
[ "$CID6" ] && qmicli -d $DEV --device-open-qmi --client-cid=$CID6 \
--wds-stop-network=disable-autoconnect
mv /run/network-wwan.cid /run/network-wwan.cid~
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
:
More information about the libqmi-devel
mailing list