Questions about wifi connection procedure

Thierry Boureille thierry.boureille at gmail.com
Sun Feb 12 18:14:08 PST 2012


Hi, 

I have few questions about wifi connection procedure. 

Previously, I was using the "ConnectService" method from "net.connman.Manager" 
interface as in test/connect-service example. From now, I understand that it's
necessary (at least recommended) to use an agent. However I've got some troubles during my tests.

I would like to elaborate a connection procedure from scratch, i.e. the cache folder
/var/lib/connman is empty on first connection attempt.

(I'm using 'mdbus' script to navigate in DBus introspection and to call some
methods(http://wiki.openmoko.org/wiki/OpenmokoFramework/mdbus))

I activate Ethernet and wifi with:
# mdbus -s net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty Powered True

the Access Point I want to connect is named "test-ssid", protected by a simple psk "test-password".
For the first test its SSID is not hidden:

I run test/simple-agent in one shell and in another one I do:

#mdbus -s net.connman /net/connman/service/wifi_0019d2cf8483_746573742d73736964_managed_psk net.connman.Service.Connect

I got the following error:
/net/connman/service/wifi_0019d2cf8483_746573742d73736964_managed_psk:Connect failed: net.connman.Error.Failed (Input/output error)

on agent side I see:
#./simple-agent Identity=test-ssid Passphrase=test-password

RequestInput (/net/connman/service/wifi_0019d2cf8483_746573742d73736964_managed_psk,dbus.Dictionary({dbus.String(u'Passphrase'):
dbus.Dictionary({dbus.String(u'Requirement'): dbus.String(u'Mandatory', variant_level=1), dbus.String(u'Type'): 
dbus.String(u'psk',variant_level=1)}, signature=dbus.Signature('sv'), variant_level=1)}, signature=dbus.Signature('sv')))

returning ({'Passphrase':'test-password', 'Identity': 'test-ssid'})

Despite DBus error return, Wifi is now connected, I check it by GetProperties or by a simple "ip addr"

>From this point I can Disconnect or Connect without error, even without running agent. 
I guess it's because needed data are in var/lib/connman/ cache folders.

Now I set the AP in hidden mode, and restart whole test from scratch
Now I need to use the "hidden" service to connect:

# mdbus -s net.connman /net/connman/service/wifi_0019d2cf8483_hidden_managed_psk net.connman.Service.Connect
I got  again : 
/net/connman/service/wifi_0019d2cf8483_hidden_managed_psk:Connect failed: net.connman.Error.Failed (Input/output error)

On agent side I see now:
RequestInput (/net/connman/service/wifi_0019d2cf8483_hidden_managed_psk,dbus.Dictionary({dbus.String(u'Name'):
dbus.Dictionary({dbus.String(u'Requirement'): dbus.String(u'mandatory', variant_level=1), dbus.String(u'Type'): 
dbus.String(u'string',variant_level=1), dbus.String(u'Alternates'):dbus.Array([dbus.String(u'SSID')], 
signature=dbus.Signature('s'),variant_level=1)}, signature=dbus.Signature('sv'), variant_level=1), 
dbus.String(u'Passphrase'):dbus.Dictionary({dbus.String(u'Requirement'):dbus.String(u'Mandatory', variant_level=1), 
dbus.String(u'Type'):dbus.String(u'psk', variant_level=1)},signature=dbus.Signature('sv'), variant_level=1), 
dbus.String(u'SSID'):dbus.Dictionary({dbus.String(u'Requirement'):dbus.String(u'alternate', variant_level=1), 
dbus.String(u'Type'):dbus.String(u'ssid', variant_level=1)},signature=dbus.Signature('sv'), variant_level=1)}, 
signature=dbus.Signature('sv')))

returning ({'Name':'test-ssid', 'Passphrase': 'test-password'})

I had to complete the simple-agent script, because it appeared the key 'Name' is needed
As in non-hidden mode, wifi is now connected despite I/O error message.
Please note also that in those tests I didn't provide a wifi configuration file, but I test 
it also and got the same results on first connection attempt.

Can you explain me what I'm doing wrong, because I think
'Connect failed:net.connman.Error.Failed (Input/output error)' is not a normal behaviour?
Did I miss something about method to connect to wifi ? 
Just in case, You will find attached connect.log and hidden.log for those two test. 

Finally, is it the same method for connections using certificates ? (I guess in this case configuration file is needed?)

Thanks in advance for help
Regards 
Thierry


-------------- next part --------------
A non-text attachment was scrubbed...
Name: connect.log
Type: text/x-log
Size: 89859 bytes
Desc: not available
URL: <http://lists.01.org/pipermail/connman/attachments/20120213/88e74e41/attachment.log>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hidden.log
Type: text/x-log
Size: 158531 bytes
Desc: not available
URL: <http://lists.01.org/pipermail/connman/attachments/20120213/88e74e41/attachment-0001.log>


More information about the connman mailing list