[Gta04-owner] Data connection with ofono and connman

Neil Jerram neil at ossau.homelinux.net
Sat Feb 25 21:19:32 CET 2012


Neil Jerram <neil at ossau.homelinux.net> writes:

> (Next I'll try using ofono to activate the context, and setting up
> routing myself.)

This works, and it turns out I don't even need to set up the default
route.  (And I presume it must also be the case that either ofonod or
connmand set the IP address for me, since I didn't assign an address to
hso0 any other way.)  Here's the transcript:

gta04:~# ofono/test/list-contexts 
[ /hso_0 ]
    [ /hso_0/context2 ]
        Username = user
        Protocol = ip
        Name = Internet
        Settings = { }
        IPv6.Settings = { }
        Active = 0
        AccessPointName = general.t-mobile.uk
        Password = pass
        Type = internet

gta04:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.200   0.0.0.0         UG    0      0        0 usb0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 usb0
gta04:~# route del default
gta04:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 usb0
gta04:~# ofono/test/activate-context 
gta04:~# ofono/test/list-contexts 
[ /hso_0 ]
    [ /hso_0/context2 ]
        Username = user
        Protocol = ip
        Name = Internet
        Settings = { DomainNameServers=149.254.230.7,149.254.192.126, Method=static Netmask=255.255.255.255 Address=31.105.92.216 Interface=hso0 Gateway=0.0.0.0 }
        IPv6.Settings = { }
        Active = 1
        AccessPointName = general.t-mobile.uk
        Password = pass
        Type = internet

gta04:~# ifconfig 
hso0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:31.105.92.216  P-t-P:31.105.92.216  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1486  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:1432 (1.3 KiB)  TX bytes:1567 (1.5 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1684 (1.6 KiB)  TX bytes:1684 (1.6 KiB)

usb0      Link encap:Ethernet  HWaddr 3a:bc:ab:e4:96:d0  
          inet addr:192.168.0.202  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::38bc:abff:fee4:96d0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:273 errors:0 dropped:18 overruns:0 frame:0
          TX packets:197 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:24501 (23.9 KiB)  TX bytes:21304 (20.8 KiB)

gta04:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 hso0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 usb0
gta04:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=51 time=727 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=51 time=369 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=51 time=367 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=51 time=348 ms
64 bytes from 8.8.8.8: icmp_req=5 ttl=51 time=357 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 348.554/434.146/727.748/146.994 ms
gta04:~# ping www.gta04.org
PING www.gta04.org (83.151.26.121) 56(84) bytes of data.
64 bytes from goldelico.com (83.151.26.121): icmp_req=1 ttl=51 time=511 ms
64 bytes from goldelico.com (83.151.26.121): icmp_req=2 ttl=51 time=451 ms
^C64 bytes from goldelico.com (83.151.26.121): icmp_req=3 ttl=51 time=362 ms

--- www.gta04.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 362.165/441.710/511.329/61.304 ms
gta04:~# ifconfig 
hso0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:31.105.92.216  P-t-P:31.105.92.216  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1486  Metric:1
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:3152 (3.0 KiB)  TX bytes:3093 (3.0 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:26 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2331 (2.2 KiB)  TX bytes:2331 (2.2 KiB)

usb0      Link encap:Ethernet  HWaddr 3a:bc:ab:e4:96:d0  
          inet addr:192.168.0.202  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::38bc:abff:fee4:96d0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:410 errors:0 dropped:18 overruns:0 frame:0
          TX packets:283 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:32429 (31.6 KiB)  TX bytes:32540 (31.7 KiB)

(Here I did some web browsing on the phone, to generate a notable
increase in the RX data count, and to check that that mostly came
through hso0.)

gta04:~# ifconfig 
hso0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:31.105.92.216  P-t-P:31.105.92.216  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1486  Metric:1
          RX packets:1642 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1638 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:1392308 (1.3 MiB)  TX bytes:207352 (202.4 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:232 errors:0 dropped:0 overruns:0 frame:0
          TX packets:232 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:24199 (23.6 KiB)  TX bytes:24199 (23.6 KiB)

usb0      Link encap:Ethernet  HWaddr 3a:bc:ab:e4:96:d0  
          inet addr:192.168.0.202  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::38bc:abff:fee4:96d0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:425 errors:0 dropped:18 overruns:0 frame:0
          TX packets:295 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:33260 (32.4 KiB)  TX bytes:35092 (34.2 KiB)

(Clearly, yes, the data did come through hso0.)

gta04:~# 

So it appears that everything is fundamentally working, there's just
something wrong when I try to activate the service through connman.

I wonder if that even matters in practice?  Are there any downsides of
doing "ofono/test/activate-context" instead of
"connman/test/test-connman connect ..."?

Regards,
        Neil


More information about the Gta04-owner mailing list