I've been playing with my new Raspberry Pi 2, and Ubuntu Core as an OS looks very promising. One downside that I've found is that it doesn't support WiFi out of the box. Well, that's only partially true, since the kernel does have all the drivers & firmware blobs included. What's missing are the wpa_supplicant tools to authenticate. Ubuntu Core doesn't use apt-get anymore, but luckily dpkg is still there behind the scenes. Here is how to install the missing packages on your system partition and enable the RPi to connect to your WiFi network.
First download the missing deb files to your desktop and scp them over to your RPi:
wget http://ports.ubuntu.com/pool/main/w/wpasupplicant/wpasupplicant_0.7.3-6ubuntu2.3_armhf.deb
http://ports.ubuntu.com/pool/main/libn/libnl3/libnl-3-200_3.2.24-2_armhf.deb
http://ports.ubuntu.com/pool/main/libn/libnl3/libnl-genl-3-200_3.2.24-2_armhf.deb
http://ports.ubuntu.com/pool/main/p/pcsc-lite/libpcsclite1_1.8.11-3ubuntu1_armhf.deb
Then on the RPi remount the system partition read-write and install the packages:
sudo mount -o remount,rw /
sudo dpkg -i *.deb
Create a config file for your wlan0 interface:
cat <<EOF | sudo tee cat /etc/network/interfaces.d/wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa_ssid "<YOUR_WIFI_NAME>"
wpa_psk "<YOUR_PASSWORD>"
EOF
sudo chmod go-r /etc/network/interfaces.d/*
And finish up by remounting the root partition as read-only:
sudo mount -o remount,ro /
Have fun!
And, if you cannot scp (because you don't have a network connection, a la chicken and egg), you can use a PC to stuff the .deb packages in /writable/user-data/ubuntu/ on the SD card, and they will show up in /home/ubuntu/ when booting from the Pi.
ReplyDeleteYou sir, are my hero!!!!!!!
DeleteThanks for this, mate. Just a note though, the first file "wpasupplicant_0.7.3-6ubuntu2.3_armhf.deb" is no longer in this location linked. It's now "***2.4_armhf.deb."
DeleteThat works. An even worse hack for if you're on a mac and don't want to install ext4 drivers: copy the necessary .deb files to the fat32 boot partition, and they'll show up in /boot/uboot/ :-D
ReplyDeleteNice one - thanks for posting this.
ReplyDeleteWasn't sure which libraries needed installing.
Thanks, this was very valuable. Particularly that trick with dpkg. :-)
ReplyDeleteUnfortunately I am not having much luck...my device simply wont get an IP address.
ReplyDeleteScratch that. Needed to config my router. Works! Many thanks...
DeleteFor those ones having issues with ra-link firmware:
ReplyDeleteDownload this package: https://packages.debian.org/jessie/firmware-ralink
And install it using force flag: dpkg -i --force-all firmware-ralink_0.43_all.deb
After that my usb wifi dongle worked just fine.
Thnx! The ubuntu version of that package is http://ports.ubuntu.com/pool/main/l/linux-firmware/linux-firmware_1.145_all.deb, and it containst all firmware blobs for supported hardware. That including all the ralink & realtek wireless cards that everyone uses.
DeleteI don't currently have a snappy system handy, so I don't know if there are any prerequisites that need to be installed.
Thanks for this info.
ReplyDeleteI am running on BBB and get this error:
sudo dpkg -i *.deb
dpkg: unrecoverable fatal error, aborting:
unable to fill /var/lib/dpkg/updates/tmp.i with padding: No space left on device
Seem that /var/lib/dpkg is not monted on mmcblk0p4:
df -a | grep /var/lib
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/click/frameworks
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/apps
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/initramfs-tools
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/systemd/click
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/apparmor
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/dhcp
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/click/bin
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/dbus
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/systemd/snappy
tmpfs 254036 0 254036 0% /var/lib/sudo
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/misc
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/system-image
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/logrotate
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/extrausers
/dev/mmcblk0p4 5478368 3788096 1452936 73% /var/lib/cloud
Is there a work around?
Thanks Patrick
I failed to download the first pkg at various time in last two days. Any tips to overcome this. Thank you in advance.
ReplyDelete```
➜ Downloads wget http://ports.ubuntu.com/pool/main/w/wpasupplicant/wpasupplicant_0.7.3-6ubuntu2.3_armhf.deb
--2015-09-04 06:11:30-- http://ports.ubuntu.com/pool/main/w/wpasupplicant/wpasupplicant_0.7.3-6ubuntu2.3_armhf.deb
Resolving ports.ubuntu.com... 2001:67c:1360:8001:1::2, 91.189.88.151
Connecting to ports.ubuntu.com|2001:67c:1360:8001:1::2|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-09-04 06:11:31 ERROR 404: Not Found.
```
Looks like there is a new release of wpasupplicant. Can you try http://ports.ubuntu.com/pool/main/w/wpasupplicant/wpasupplicant_0.7.3-6ubuntu2.4_armhf.deb and see if that works?
DeleteLooks like the original poster didn't get back to you, but I was having the same problem. I tried the new URL you provided and was able to download the newer version of the file. Thanks!
DeleteHappy to help :-)
DeleteThis hack is not longer necessary.
ReplyDeleteSee https://developer.ubuntu.com/en/snappy/start/installation-tips/