I'm having frequent problems with wlan0 on the Odroid U2. I'm using the Realtek RTL8191SU-based 'wifi module 2' from the Odroid store, so assume it's compatible.

I can bring up & associate wlan0 most times when typing commands directly on the command line - so I know this setup works. But when I try to use a bash script or a Python script, I frequently get errors, but often at different stages.

For example, I've just run a script where commands like 'killall wpa_supplicant', 'dhclient -r wlan0' and others all went swimmingly. But when I issued: 'wpa_supplicant -B -Dwext -iwlan0 -c/etc/wifi/myap.conf', I was treated to streams of syslog messages starting with:

Message from syslogd@kali at Apr 13 08:14:34 ...
kernel:[ 514.260096] Internal error: Oops - bad mode: 0 [#1] SMP

Message from syslogd@kali at Apr 13 08:14:34 ...
kernel:[ 514.888133] Process wpa_supplicant (pid: 2811, stack limit = 0xeb7542f8)

Message from syslogd@kali at Apr 13 08:14:34 ...
kernel:[ 514.894810] Stack: (0xeb755cf8 to 0xeb756000)

Followed by an awful lot more just spewing out numbers that mean nothing to me! At that point, I'm still connected okay over the serial connection, but all networking is b0rked. Issuing an 'ifconfig' just hangs the machine.

As I said, issuing these commands by hand from the command line works okay. Am I simply trying to do this too fast? When issuing the commands via the Python script, I'm using subprocess with stdout=PIPE and followed by a subprocess.communicate() which, I believe, means that the script should wait for each subproc to terminate before continuing.

All help appreciated.