AT Commands for QMI based Dialing?

Michael Shell list1 at michaelshell.org
Sun Dec 28 20:08:49 PST 2014


On Sun, 28 Dec 2014 09:53:56 +0100
Aleksander Morgado <aleksander at aleksander.es> wrote:

> The QMI network interface, AFAIK, needs to be activated via QMI
> protocol always.
> 
> What's the issue with libqmi/qmicli? If you don't want to use them you
> also have other connection managers working with QMI (e.g. ofono or
> uqmi).


I've got libqmi and it works just fine for me, but does require some
dependencies others might not have (glib/gobject). 

Also, it is always nice to be able to walk through a minimal manual network
setup for diagnostic purposes - so one can easily then tell if there is a
hardware or network authorization issue rather than a problem with
libqmi/modem manager or their config.

I have installed uqmi and can start the network via:

uqmi --device=/dev/cdc-wdm0 --keep-client-id wds --start-network my.apn

I assume the return value is the Packet Data Handle (PDH), e.g., 33704704.
What exactly is a PDH number and what mechanism determines this unique
number when a QMI network connection is first started?

However, I cannot stop the network via:

uqmi --device=/dev/cdc-wdm0 wds --stop-network 33704704 --autoconnect
or
uqmi --device=/dev/cdc-wdm0 wds --stop-network 4294967295 --autoconnect

(the latter per https://dev.openwrt.org/ticket/16724 )

I always get an

"Invalid handle"

error.

Installing uqmi can be a real ordeal for most Linux users. The sources are
git only and it requires cmake as well as two components from libubox.

I've attached my build notes at the end of this message. I'm sure it'll
help someone out there out of a jam one day. I could not with a straight
face ask another person to go through all that.

In addition to the OpenWrt release of uqmi at
http://nbd.name/gitweb.cgi?p=uqmi.git;a=summary 
there seems to be another version of uqmi on google code that is GNU make
based:

http://code.google.com/p/rt-n56u/source/browse/trunk/user/uqmi/

Click on tar.gz though and get a monster tar ball that exceeds 30MB because
this uqmi is embedded as part of a much larger wl500g project.

Getting just the uqmi directory is real tempting though because it is GNU
make based and includes a libubox subdir as part of the tree.


   Cheers and thank you,

   Mike

=============

installing uqmi from source, this example is for a LFS Linux system.
http://www.michaelshell.org


uqmi requires json-c, cmake and libubox
helpful URLs:
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=3&t=706&start=45
http://www.wakoond.hu/2013/06/using-uci-on-ubuntu.html



*** json-c ***
json-c-0.12.tar.gz
http://www.linuxfromscratch.org/blfs/view/svn/general/json-c.html
sed -i s/-Werror// Makefile.in
./configure --prefix=/usr --disable-static
make -j1
su
make install



*** cmake ***
cmake-3.1.0.tar.gz
http://www.linuxfromscratch.org/blfs/view/svn/general/cmake.html
http://www.cmake.org/
http://www.cmake.org/install/
./bootstrap --prefix=/usr       \
            --system-libs       \
            --mandir=/share/man \
            --docdir=/share/doc/cmake-3.1.0
make
su
make install

if get .... cmArchiveWrite.cxx:43:75: error: 'archive_entry_copy_sourcepath_w' was not declared in this scope

add 

#define __LA_SSIZE_T ssize_t

after #include of Source/cmArchiveWrite.cxx

if get .... cmArchiveWrite.cxx:45:75: error: 'archive_entry_copy_sourcepath_w' was not declared in this scope

upgrade to libarchive 3.0.2 or greater
or invoke 
--no-system-libarchive
to use internal libarchive copy



*** libubox ****
git clone git://nbd.name/luci2/libubox.git libubox
cd libubox
mkdir build
cd build
cmake ..

  If get "-- checking for modules 'json-c;json'
          -- package 'json' not found"
  seems to be OK though (uses internal version?)

See note about potential path issue with blobmsg_json.h
as well as jshn.c in notes for uqmi below.

make ubox blobmsg_json
  valid targets include: ubox blobmsg_json jshn json_script
                         ubox-static uloop_lua all

  uloop_lua will not compile against lua 5.2, only 5.1
  "uloop.c:116:2: error: implicit declaration of function 'luaI_openlib'"
 
su
mkdir -p /usr/include/libubox
cp ../*.h /usr/include/libubox
cp libubox.so /usr/lib
cp libblobmsg_json.so /usr/lib
ldconfig
 


*** uqmi ****
http://nbd.name/gitweb.cgi?p=uqmi.git;a=summary
select snapshot or
git clone git://nbd.name/uqmi.git uqmi
cd uqmi
cmake CMakeLists.txt
su
make install
mv /usr/local/sbin/uqmi /usr/sbin/uqmi

If an error occurs, no way to make clean if not built in a
separate build directory, reunpack source tree and start over.

If get ... blobmsg_json.h:22:24: fatal error: json/json.h:
       No such file or directory

in libubox's blobmsg_json.h as well as jshn.c change

        #include <json/json.h>

to

        #include <json-c/json.h>

and then rebuild and reinstall libubox.

If get /usr/bin/ld: cannot find -lblobmsg_json
did not build and install blobmsg_json in libubox
and/or run ldconfig.

=============


More information about the ModemManager-devel mailing list