Using wpa_supplicant via dbus in python - error

Dan Williams dcbw
Thu Aug 14 11:26:01 PDT 2008


On Thu, 2008-08-14 at 06:53 -0700, James Rayner wrote:
> Hi
> 
> I'm writing a client using python and the dbus interface. Having
> looked at the example and the wpa_supplicant code, I've got as far as
> being able to scan, add/remove networks and interfaces. However when I
> try to set anything for a new network, it complains at the .set():
> 
> dbus.exceptions.DBusException:
> fi.epitest.hostap.WPASupplicant.InvalidOptions: Did not receive
> correct message arguments.
> 
> As suggested to someone else on the list, passing as a dbus Byte array
> didn't help.
> 
> The code is here: http://pastebin.com/f122abeb8

You do need to pass a d-bus byte array, since SSIDs can contain embedded
NULLs and are not necessarily UTF-8.  I think you can just cast the SSID
value to a dbus.ByteArray() when setting the dictionary member.

Dan





More information about the Hostap mailing list