sequence of associating to a new WAP using PHP and DBus

don don at waldohealth.com
Fri Jul 2 18:23:16 EDT 2010


All -

This is coded using Derick Rethan's PHP interface library and WAPS version
0.6.9. I'm doing an embedded zendserver app on a small touchscreen device,
and we won't have enough room for Gnome or NetworkManager. The goal is to
be able to semi-automatically scan and have a tech select WAPs (and
eventually bluetiooth devices, POTS modems, etc.).

I'm getting closer but still have no joy. When I send this sequence to
wpa_supplicant's object path representing the selected WAP, the
addNetwork() method gives me back a BSSID path and the selectNetwork()
command gives me a '1' for success. However, an iwconfig gives me an
irrelevant 32byte binary string as the ESSID and it is 'not associated'
with any WAP.
It's also whacked and can't be re-associated without a -HUP.

 $result2 = $new->addNetwork("$ap_path",          
                new DbusDict(Dbus::VARIANT,
                        array(new DbusVariant('essid') 
                                    => newDbusVariant('WaldoTest'),
                              new DbusVariant('key_mgmt') 
                                    => newDbusVariant('WPA-PSK'),
                              new DbusVariant('mode') 
                                    => newDbusVariant('managed'),
                              new DbusVariant('psk') 
                                    => newDBusVariant(0x254 ... ee7) ) )
);

    $succeed = $new->selectNetwork($result2);

I've tried numerous variants including strings for PSKs and regular hash
keys, but I still get basically the same results. When I enter all the
values into the wpa_supplicant.conf file, it associates just fine. Almost
certainly, my issue is simple.... but... I haven't seen it. I've got -dd
running and giving me logs but I'm not seeing anything that makes sense
except 'SSID mismatch' and one of my WAPs seems to get blacklisted
occasionally. It seems obvious that my values are getting accepted but not
validated by the addNetwork(), but they are causing selectNetwork() to
choke.

My next plan is to try to see the properties associated with the BSSID
interface to see if I can understand what values it thinks it's gotten.
-- 
Don Wilde
Waldo Health, Inc.
http://www.waldohealth.com
o: +11 512-219-0302
c: +11 512-749-6447



More information about the HostAP mailing list