My first bit of advice about using a wifi dongle is don't. It doesn't work well and ties up the only usb port you have free, and using a usb hub just makes it harder to work. Better to use one of the two approved pci wifi cards.
As for the rfkill, what version of linux are you using? I am using AlexT's AlexT_Intel version of standard Yocto with development tools added and I don't have rfkill, so assume you are mixing distributions, which will cause problems, or have installed some other package.
As for the cable, does lsusb show the wifi dongle? and do you have all the modules?
Run modprobe -l |grep rtl and you should have the following
Connecting to an access point with a passkey has proven troublesome to me but alexT was able to do it with little problem, so maybe my setup.
AlexT recommends making a .conf file, example wifi.conf, make it executable, and just have one entry in it - rtl8192cu - and put it in /etc/modules-load.d
Alex also wrote a script and put it in /etc/init.d/restartwifi
while [ $TRY -le $TRIES ]; do
WLAN_ACTIVE=`ifconfig wlan0 |grep 'inet addr'`
echo "Activating Wi-Fi - try $TRY..."
if [ x"$WLAN_ACTIVE" = x"" ]; then
echo "Interface wlan0 has no IP assigned - reactivating"
echo "Interface already active, skipping..."
Well, I'd say this seems to be a different case. In your one, I think we've established that there's some trouble with the dongle, either due to the dongle itself or the cable, or the radiowave environment at your lab - because it worked, but only really close to the AP. That may have caused other issues related to the interface activation at boot - and I think Zigenz hasn't yet come to that point anyway.
My experience with using dongles isn't that bad and while it indeed takes the USB port, if you don't need it for anything else, it's just fine. If you want to do some webcam data capturing or work with other periferals, then indeed a mPCIe-based WiFe adapter would be a better choice.
Now, to the issue itself, Zigenz, I assume you've ensured that your specific WiFi chipset is supported by the rtl8192cu module and you have the correct firmware loaded (even of the driver is teh same, you might need a different firmware for your specific model), so that rfkill error is indeed a bit interesting. I haven't seen anything like that with my board, I've used it with two different dongles (though the driver for one of those was utterly unstable, experimental one). Which rfkill subcommands have you tried? I don't have a board at hand to check, but on Edison that would've been something like "rfkill unblock wifi". What do you get after running this?