I try to use python dbus module to connect to WEP security WiFi
I fill the network configuration dictionary like as follows:
nw_config['wep_key0'] = binascii.unhexlify(mypassword)
mypassword is hex-string
when mypassword is set to '12345678' there will be no error, but when it comes in english letters such as a, b, c, d, e, f.
for instance:
nw_config['wep_key0'] = binascii.unhexlify('abcdef')
It will show the following error
UnicodeError: String parameters to be sent over D-Bus must be valid UTF-8 with no noncharacter code points
Just don't understand what difference between these two cases since they should all be valid hex-string?
Update : The code related to dbus
args = dbus.Dictionary(nw_config)
bus = dbus.SystemBus()
wpas_obj = bus.get_object(WPAS_DBUS_SERVICE, WPAS_DBUS_PATH)
wpas = dbus.Interface(wpas_obj, WPAS_DBUS_SERVICE)
if_obj = bus.get_object(WPAS_DBUS_SERVICE, path)
path = wpas.GetInterface(if_obj, WPAS_DBUS_IFACE)
network = iface.AddNetwork(args) # this line has problem