I purchased a new generic USB Wifi dongle with external antenna to see if I could improve on the limitations of the Cubox's internal 2.4Ghz antenna. Much to my amazement it worked straight out of the box. However after a reboot, it failed to connect with "Invalid argument" error. After a number of failed attempts (around 6), Kodi crashes and restarts.
At this point, sometime - but not always - you can connect to wlan1, having to add the passkey again, and it connects.
One problem is that I cannot delete nor edit the connection until it has connected, so I can't connect to another SSID via wlan1.
The SSID is 11 characters log with no spaces, whereas the passkey is 19 characters with spaces (If that makes any difference).