HL w/ ECM, Linux integration

Hello all,

I am working with the HL8548H-G AirPrime development kit. It is connected via USB to my imx6 SABRE board running our yocto build of the Linux 4.1 kernel. My end goal is to have a general-purpose internet connection through the HL modem using connman. But for starters, I would just like to be able to ping google.com through Linux.

I used AT+KUSBCOMP=2 to put the modem in Mode 2. In this mode, I see 1 ECM port, 3 AT ttyACM ports, and 2 traces ports. (Refer to section 5.73 of the AT Commands Interface Guide: http://source.sierrawireless.com/resources/airprime/software/airprime_hl6_and_hl8_series_at_commands_interface_guide/).

Because I have the USB gadget serial Ethernet driver enabled, the ECM port automatically appears as eth2 in ip-addr:

7: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 00:00:11:12:13:14 brd ff:ff:ff:ff:ff:ff

And I can run ipconfig eth2 up, and I see that it comes up with an ipv6 address:

eth2      Link encap:Ethernet  HWaddr 00:00:11:12:13:14
          inet6 addr: fe80::200:11ff:fe12:1314%1995540176/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

However, it does not get an IPV4 address. And ping6 is unable to reach ipv6.google.com:

root@b2qt-imx6sxsabresd:~# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888 (2001:4860:4860::8888): 56 data bytes
ping6: sendto: Network is unreachable

Here are my modem settings:

OK
AT+CGDCONT?
+CGDCONT: 1,"IP","internet.xxxx.net","",0,0

OK
AT+KCNXCFG?
+KCNXCFG: 1,"GPRS","internet.xxxx.net","","","IPV4","0.0.0.0","0.0.0.0","0.0.0.0",0

OK
AT+CGATT?
+CGATT: 1

OK
AT+KCNXTIMER?
+KCNXTIMER: 1,60,2,70,30

OK
AT+KCNXPROFILE?
+KCNXPROFILE: 1

OK

Can anyone give any advice on what steps I’ve missed? Or, is there an integration guide for using the HL’s ECM interface with Linux?

Best regards,
Brady

Brady,

All you need to do is send the below

at+xcedata=1,0

This will activate the PDPD context with the network and also do the same on the USB interface. You do not need to mess around with the at+k commands just at+cgdcont to set the APN.

If you have network manager running I would expect it to perform the dhclient on the interface, if you don’t then you will need to send the command dhclient eth2’ for Linux and the unit to exchange IP information.

Regards

Matt

Matt,

Thank you very much for your response – the at+xcedata is exactly the info I was missing.

Unfortunately the AT+SCEDATA=1,0 command is returning +CME ERROR: 100 after about 10 seconds. Since 100 is “Unknown Error”, I’m not sure where to look next. Do you have any suggestions?

Best,
Brady

Brady,

Check the unit is configured with the right APN (with at+cgdcont?) and that it is attached to the network with the below commands.

at+creg?
at+cgreg?

If they return 0,1 or 0,5 then they are attached and roaming respectively, if however they return 0,0, 0,2, 0,3 or 0,4 then you have a SIM issue.

Also check the signal strength with at+csq, anything above 6 should be good enough to get you a reasonable connection.

Regards

Matt

Hi Matt,

Thanks for the follow-up. Here’s what I see from those commands. I think they look good:

at+cgdcont?
+CGDCONT: 1,"IP","internet.xxxx.net","100.71.235.60",0,0
OK

at+creg?
+CREG: 0,5
OK

at+cgreg?
+CGREG: 0,5
OK

at+csq
+CSQ: 27,99
OK

I am a little curious about the current +COPS settings. I would have thought that the last parameter should be 0 for a GSM modem.

AT+COPS?
+COPS: 0,0,"AT&T",2

Brady,

The responses do look good so not sure why it is failing, maybe check out your syslog to see if there are any errors on there as the fact it has an IP address means the session is in all probability started.

The 2 means it is on 3G, if it was 0 it would be on 2G and 7 it would mean it was on LTE.

Regards

Matt

If eveything looks good on the modem side, maybe I need to start looking into my Linux-side things. My /etc/network/interfaces is:

auto eth2

iface eth2 inet dhcp

allow-hotplug eth2

Maybe as a brute-force check, I should try a static IP instead of dhcp, using the IP that +CGDCONT reported? (100.71.235.60)

Brady,

The dhclient should populate the interfaces, issue I have is with te CME error 100. If you do the at+xcedata=1,0, get the error back and then try a dhclient on each of the Ethernet interfaces to see what happens it might work. Best to stick with DHCP as the address you get from the network each time is going to be different.

Regards

Matt

Thanks, will do. I’ll have to add dhclient to my build system, but that won’t be hard.

Matt,

Got it up and running! Having a network manager (for me, connmand) running while I ran the at+xcedata command seems to have made the difference.

Summary for posterity:

Start connman daemon:

bash# connmand

AT commands:

AT+CGDCONT?
+CGDCONT: 1,"IP","internet.xxxx.net","0.0.0.0",0,0
OK

at+cops?
+COPS: 0,0,"AT&T",2
OK

at+xdns=1,1
OK

at+xcedata=1,1
OK

Then, eth3 was up and had IPv4 and IPv6 addresses. Connman had also seen and brought up the other ECM nodes, but they did not have IP addresses (as expected).

eth1      Link encap:Ethernet  HWaddr 00:04:9F:04:06:24
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth2      Link encap:Ethernet  HWaddr 00:00:11:12:13:14
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth3      Link encap:Ethernet  HWaddr 00:00:11:12:13:16
          inet addr:100.87.239.174  Bcast:100.87.255.255  Mask:255.255.0.0
          inet6 addr: fe80::200:11ff:fe12:1316%1995466448/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2982 (2.9 KiB)  TX bytes:4389 (4.2 KiB)

eth4      Link encap:Ethernet  HWaddr 00:00:11:12:13:18
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I can then ping google:

bash# ping -I eth3 www.google.com
PING www.google.com (172.217.16.36): 56 data bytes
64 bytes from 172.217.16.36: seq=0 ttl=55 time=318.136 ms
64 bytes from 172.217.16.36: seq=1 ttl=55 time=357.830 ms
64 bytes from 172.217.16.36: seq=2 ttl=55 time=317.452 ms
64 bytes from 172.217.16.36: seq=3 ttl=55 time=319.349 ms
^C
--- www.google.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 317.452/328.191/357.830 ms

Glad to hear all is good.

Matt