So I just received my Raspberry Pi 3 Model B in the mail and installed Ubuntu Snappy Core 16 in the recommended way. I performed the initial setup via HDMI and usb keyboard, ethernet, & DHCP. Then I created my ssh connection over ethernet and disconnected the monitor and keyboard. From there, I wanted to connect my device to WiFi and stumbled upon this post.
I like to try things without extra installations or workarounds, so I consulted Installation Tips as recommended above and saw that WPA_Supplicant was supposed to be pre-installed. With very little meddling and less effort than the Tips suggested, I found that you can configure the wifi by simply adding a config file consisting of four lines to the default location searched by wpa_supplicant and nothing else. Though it was asked a while ago about a Raspberry Pi 2 I see from recent comments that it might still be relevant and it was so simple I am inclined to share.
I know this answer looks long, but it is very simple and detailed with pictures. Anyone who has a basic knowledge of Terminal and was able to set up their raspberry Pi initially will be able to follow it.
Tl;Dr
- Setup your Rasberry Pi and establish a LAN connection via SSH
- Shutdown your Raspberry Pi with
sudo shutdown -P now
- Plug your SD card into a linux distro
- In a text editor add a config file called "wpa_supplicant.conf" to the /writable/system-data/etc/ folder on the Writable partition of the SD card
- I did this by creating the conf file on my desktop and then using
sudo cp
to move it to the correct directory
- The config file should be:
network={
ssid="Typhon Secure"
Use your network SSID
psk="*******"
Use your network Passkey
}
- Note: This works for Hidden Networks as well
- Eject your SD, plug it into your Pi, boot your Pi; it should connect to your WiFi
My tutorial begins from the point of having an ssh connection via ethernet, which can be achieved by following the instructions at Ubuntu Core Get Started Raspberry Pi 2/3.
Then type wpa_supplicant
and you will see that it does not need to be installed as it is pre-built into Snappy Core. As you'll see in the below images, just running wpa_supplicant
will return a lot of options, but notice the last line:
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf
What this tells you is first the Driver, then the Interface, then the location that it is looking for the interface file: -c/etc/wpa_supplicant.conf
Now that I knew where the configuration file needed to be, I shutdown the Raspberry Pi with sudo shutdown -P now
and once it shutdown; disconnected the power and inserted the SD into a linux box with Fedora. Somehow the file system shows differently so you'll find the location where wpa_supplicant.conf
needs to be location is at writable/system-data/etc
and the SD card mounted in /run/media/cregger/ for me, so you'll see my file path is /run/media/cregger/writable/system-data/etc/
.
I used nano to create a new file called "wpa_supplicant.conf" with the following four lines:
network={
ssid="Typhon Secure"
(My network SSID)
psk="*******"
(Obviously the asterisks represent my WiFi passkey)
}
Don't forget to terminate.
Note that this works for hidden networks with no extra configuration. My network has a hidden SSID and I changed nothing. It has WPA-PSK 2 security; pretty standard fare.
You'll notice that I saved it to the desktop. I then copied it to the proper location with terminal as it is owned by root.
Then eject your SD card from Linux, plug it back into your Raspberry Pi, plug your power source back into your Raspberry Pi; let it boot and it will seek your wifi.
You'll see in my case both Eth and Wlan have taken an IP
I can now ssh via either LAN or WLAN
I know this was long, but I hope it was helpful in helping you to keep from mucking up your FS and installing a bunch of needless applications.
Best Answer
Snapcraft is a set of tools bundled under the
snapcraft
command to easily create (craft) packages for multiple Linux distributions. These .snap packages generally contain self-contained apps, provide secure isolation and are installable either from the Ubuntu Software Store or manually via thesnap install <snap-name>.snap
command.In a nutshell, as a developer you would write code using your regular tools, and let Snapcraft take care of assembling it for distribution. Snapcraft also excels in enabling developers port their existing apps to any snap-enabled Linux platform.
Snapcraft:
snapcraft.yaml
file that specifies the parts and plugins required to create the packageThe 3-minute Snapcraft tour
Install Snapcraft on Ubuntu
You will need Ubuntu 16.04 LTS to use Snapcraft. Open a terminal with Ctrl+Alt+t and simply install Snapcraft with this command:
If you are using another distro, check out the alternative installation instructions >
Test-drive Snapcraft
The following example crafts a package that contains a service that allows you to paste and share. Once finished, you can install it manually on your snappy device for testing purposes or upload it to the Store for other users.
First of all we open a terminal and download the example from the examples repository:
Notice the
snapcraft.yaml
file in that directory, which specifies a service and the parts required to assemble the final .snap. You can optionally examine it with a text editor.Now run the
snapcraft
command on the terminal. This will cause all snapcraft subcommands to run in sequence to build the parts and put the results in the final .snap package. During development, you would normally run the steps separately until you are confident that the whole build and assembly works.On the output of the command you can see the steps snapcraft runs for you:
Notes:
gopaste_1.0_amd64.snap
(notice in my case I built it on my amd64 desktop, e.g. Raspberry Pi 2 packages would have the_armhf
architecture suffix).snapcraft pull
,snapcraft build
,snapcraft stage
orsnapcraft snap
snapcraft -h
for a quick overview of all commands available.And that's it for a quick glimpse of what Snapcraft can do! Learn more about Snapcraft >