You can use cnetworkmanager
for this.
Edit:
After some investigation it becomes clear that it is impossible to run two "user configuration providers" (an application listening at a certain dbus address) at the same time, and cnetworkmanager needs to act as such a "configuration provider" (at least until the connection is set up).
Now, what you can do is add the information for the connection to gconf under the /system/networking/connections
key (you can do that from the commandline or a script), and then use dbus or a command-line tool like cnetworkmanager or nmcli to connect to it. Maybe you'll also have to add the key to the user's keyring first (to avoid password popups).
But of course that won't work on a desktop that uses another NM-client than nm-applet (e.g. KDE). You would have to figure out how to provide a config for them too...
Edit 2:
It seems like it might be possible via org.freedesktop.NetworkManagerUserSettings
on the system DBus, but this is all poorly documented IMO...
You might want to read about configuration settings and the DBus interface spec.
And here is a relevant example (maybe you want to set up a user connection instead of a system connection though)
I suggest a few changes that might help. First, disable power saving in Network Manager. From the terminal:
sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/*
Then restart Network manager:
sudo service network-manager restart
Next, I suggest that you set your router to disable channel hopping, that is, use a fixed channel, either 1, 6 or 11, rather than automatic channel selection. Also, be certain the router is not set to use N speeds only; auto B, G and N is preferred. After making these changes, reboot the router.
Finally, if your router has 2.4 and also 5 gHz capabilities, I suggest giving them different names, something like zobi24 and zobi5. This will keep your router and wireless device from hopping from one band to the other.
Experiment to see which segment is more stable. I suspect it will be zobi24.
With respect to this:
info: failed: mwifiex_is_network_compatible: wpa_ie=0x0 wpa2_ie=0x30
WEP=d WPA=d WPA2=d EncMode=0x0 privacy=0x1
I recommend, again, that you check the settings in the router. WPA2-AES is preferred; not any WPA and WPA2 mixed mode and certainly not TKIP.
EDIT: To blacklist the internal device, please open a terminal and do:
sudo -i
echo "blacklist mwifiex_pcie" >> /etc/modprobe.d/blacklist.conf
modprobe -r mwifiex_pcie
exit
To reverse the process, edit the blacklist file:
sudo nano /etc/modprobe.d/blacklist.conf
Comment out the line you added by placing the symbol # at the beginning of the line like this:
#blacklist mwifiex_pcie
Save and close the text editor.
Finally, some of the USB adapters that you use actually load two conflicting drivers. Let's blacklist the least effective of the two:
sudo -i
echo "blacklist rtl8192cu" >> /etc/modprobe.d/blacklist.conf
exit
Best Answer
The issue is it recognises that the WiFi connection is trying to “hijack” the secure connection. It prevents this.
To avoid this, navigate to http://neverssl.com. This webpage will never use HTTPS and family, so it will always be “hijackable” by the WiFi.