Slackware ARM on a Raspberry Pi
Setting up a wireless network connection on Slackware ARM on a Raspberry Pi
This SARPi project will enable you to setup and configure a wireless network connection using Slackware ARM on a Raspberry Pi 1, 2 or 3. This project would suit users in locations where connecting to the network via an Ethernet cable is inconvenient or simply not an option, or if you just want to connect wirelessly as an alternative.
This project will take you through finding out the make/model/version of a wireless USB adapter if it is unknown, finding out which driver(s) will be required to run a wireless USB adapter, configuring and setting up a wireless USB adapter on a Raspberry Pi 1, 2 or 3 and/or configuring and setting up the on-board wireless network interface card (WNIC) on a Raspberry Pi 3, installing drivers for a wireless USB adapter (if required - because Slackware ARM might already have them), loading the driver modules, downloading and installing the 'wicd' network manager for Linux, and configuring 'wicd' to connect to a wireless network (WLAN).
The Raspberry Pi 3 comes with an on-board wireless network adapter (WNIC), so an additional plug-in wireless USB adapter is not a prerequisite on this device. Although the range and performance of the on-board wireless WNIC on the Raspberry Pi 3 is generally somewhat lesser than that of some alternative 'plug-in' wireless USB adapters, you may benefit from doing some experimenting based on your own personal circumstances. If the wireless router or access point is only a few meters away from your Raspberry Pi then there's no need to worry about it. However, you will require a wireless USB adapter for the Raspberry Pi 1 and 2 as neither of these devices come with an on-board wireless network interface card (WNIC). Be aware that results can vary from one wireless USB adapter to another, even when utilising the same chipset. The way of determining which wireless USB adapter is best suited for your purposes is through the process of experimenting until you find the one which is most successful.
The reason why we cannot say "Use the 'XxXxX' wireless USB adapter for the best results!" is because there are so many variables and permutations involved in setting up a wireless connection that we couldn't possibly endorse one over the other without testing and comparing results for each and every situation. Imagine what a task that would be! :-P
Wireless, WLAN, Wi-Fi, explained
In networking terminology, 'wireless' is a term used to describe a computer that has no physical wired (e.g. Ethernet cable) connection to the network but is connected via radio waves to maintain communications. A wireless local area network (WLAN) is a term that describes two or more devices which are linked by using wireless networking methods. Wireless networking utilizes specific equipment such as wireless network interface cards (WNIC), access points (AP), and routers, in place of cables for connectivity. Many people (experts and professionals included) refer to wireless networking as 'Wi-Fi'. However, Wi-Fi® is just one of many trademarked brand names of the Wi-Fi Alliance which includes popular wireless networking technologies that use radio waves to provide high-speed Internet and network connections. 'Wi-Fi' is simply a trademarked phrase that conforms to IEEE 802.11 standards and it's worth noting that not all wireless networking technology is 'Wi-Fi certified™'. A popular misconception is that the term Wi-Fi is short for 'wireless fidelity' (due to similarities with the term 'Hi-Fi', which refers to the high-quality reproduction of sound by audiophiles and home audio enthusiasts, and has nothing what-so-ever to do with Wi-Fi) and seems to be an easy and common mistake to make.
What you will need for this project
• A Raspberry Pi 1, 2, or 3 Model A/B running Slackware ARM.
• A wireless USB adapter, similar to these or these (NB: only if you're not using the RPi3 on-board WNIC).
• An understanding of your wireless usb adapter make/model/chipset (if applicable - see above note).
• Linux drivers for your wireless usb adapter (if required - Slackware ARM may already include them).
• The wicd network manager for Slackware ARM Linux package.
Slackware ARM includes drivers for many wireless devices but cannot practically accommodate them all. If you have a wireless USB adapter that is not already supported then all hope is not lost! Most wireless USB adapters are supported under Linux so it's just a case of searching for drivers on the manufacturer's website, or elsewhere on the Internet.
For the purpose of this tutorial we are running Slackware ARM -current on a Raspberry Pi 3 with the hostname 'drie'. Your setup doesn't have to be identical as this SARPi project covers all currently available versions of Slackware ARM. Please bear in mind throughout that we will be giving examples that contain specific results which will be, more than likely, different to yours and we will also be using different hardware than you. The examples are meant only as a guide where you need to substitute any relevant information/details/results for your own, where applicable.
First of all, it's a good idea to make sure your Slackware ARM system is fully up to date by running 'slackpkg' and 'rpi-update'. If you haven't already, you should do this now before continuing with this project. A system reboot may be required.
We will be working from the command line, but you can choose to work from a terminal in your preferred desktop environment (KDE, Xfce, etc.), whatever suits you. It really makes no difference to the end result.
Secondly, consider your setup and how you are going to connect wirelessly. This tutorial covers two options;
1. Using a wireless USB adapter (a.k.a. 'wi-fi dongle' or 'USB dongle') which you plug in to a USB port on a Raspberry Pi 1, 2 or 3.
2. Using the on-board wireless network interface card (WNIC) on a Raspberry Pi 3.
• If you are planning to use the on-board WNIC on a Raspberry Pi 3 then Slackware ARM already includes the drivers for this device (thanks to MoZes), so there's no need to go searching for them. In this case you can just power on your Raspberry Pi 3, log in as 'root' user, and skip to the 'Configuring your wireless network interface card (WNIC)' section from here.
• If you're going to be using your own wireless USB adapter on a Raspberry Pi 3, or you have a Raspberry Pi 1 or 2, then you should plug in this wireless USB adapter before powering on the Raspberry Pi. As you'll be using a wireless USB adapter then you're also going to need Linux drivers for it. A little research may be required in order to find out which drivers are needed to run your wireless USB adapter, if you don't already know or have them. In this case power on your Raspberry Pi (with the wireless USB adapter plugged in), log in as 'root' user, and continue with this tutorial.
How to find out the make/model/version of (anonymous) wireless USB adapters
For example, if you have acquired a wireless USB adapter without any software CD/DVD or information/knowledge of which make/model/chipset it is then you might be feeling quite bemused about how to go about locating the driver(s) for it, or what to look for. Don't worry (yet) because there are ways and means of finding out. There are quite a few USB devices around these days which do not have any markings to indicate the manufacturer or brand, or model/version, or which chipset the device utilises.
At FatDog.NL, we recently purchased three wireless USB adapters like this from eBay which arrived in cellophane bags with no indication of who made them or which model they were, with only a 'CE Mark' sticker on them (which we jokingly said meant "Cud-be Enything"). This is a prime example of a USB device which carries no information about what it is.
However, in this situation you can use the 'lsusb' command and it should give you some information about what the device is. We plugged one of our incognito wireless USB devices into a Raspberry Pi and ran the 'lsusb' command. Here's the results:
So, our wireless USB adapter has been identified as a 'Ralink RT5370' on 'Bus ID 001' and has been designated as 'Device 005'. We've added the oversized arrow pointing towards it in the screenshot to make it obvious because, depending on how many USB devices you have connected, this could be quite a large and potentially confusing list. Now we can easily find out if we need drivers for it, or if Slackware already supports this device.
Sometimes you do not get any direct details or this much information but there is usually always some piece of information given that you can use. Such as the 'Bus 001 Device 005: ID 148f:5370' - which has '5370' on the end of it in our case. You'd be very unfortunate not to get something back from the 'lsusb' command which you can use in order to hunt down the specifications of any USB device you have connected in this manner.
Incidentally, the 'lsusb' command not only works for wireless USB adapters but also for most other USB devices you'll connect. You might want to try that sometime with any USB devices you have laying around.
Another way of doing this would be to power on your Raspberry Pi without a wireless USB adapter plugged in, and after logging in as 'root' user, run the 'dmesg | tail' (piped) commands. Then connect your wireless USB adapter to the Raspberry Pi and you should see some relevant information appear on the screen. We believe using the 'lsusb' command method is easier.
If you do find yourself with a USB device that cannot easily be identified, which may be an issue on occasion, try using 'lsusb -v' which gives a more verbose result. Then there's 'lsusb -vv' if you require a greater verbose output. Ultimately, you could use the actual Universal Serial Bus ID to get shedloads of info with the 'lsusb -vv -s 001' command. If all that fails, it might be worth plugging the device in to a Windows/Ubuntu system to see if it's recognised on there and/or software drivers are automatically downloaded for it.
You could potentially waste a lot of time with some anomalous wireless devices and if such a device has been given to you (e.g. because someone else couldn't manage to get it working) then it might make more sense to throw it away and obtain one which has better support. At the end of the day it's your time and effort and only you can decide if it's worth it, or not. ;-)
How to find out which Linux driver is needed for a wireless USB adapter
Once you have identified your wireless USB adapter it's a case of running the 'lsusb -t' command, and (if it's supported) Slackware ARM will list which driver is used for the device. The 'lsusb -t' command basically dumps the physical USB device hierarchy as a tree. In the screenshot below, on USB Port 2, you can see 'Dev 5' (a.k.a. Device 005) shows 'Driver=rt2800usb' and this is the Linux driver which Slackware ARM will use for our wireless USB device. Yours may be different here.
When you know the Device ID, you can then use 'lsusb -D /dev/bus/usb/001/<device_id>' to exclusively display information about that USB device. This extra data can be very useful for understanding the exact specifications. The following screenshot is the information on our 'Ralink RT5370' wireless USB adapter.
If no driver is shown, then it's time to do some research and rummaging around on the Internet. You'll need to locate the driver(s) yourself, then download and install them. It's always a good idea to look at the manufacturers website first, as most companies do provide Linux drivers for their hardware these days. Then there's the official Linux Wireless wiki which is the main source of documentation for the Linux wireless (IEEE-802.11) subsystem and a truly fantastic resource. If another Linux distribution, such as Raspbian or Ubuntu, supports the wireless device in question you could always borrow the drivers from there. It's not uncommon for one distribution to have compiled drivers for a particular piece of hardware when others haven't. Drivers are drivers and when they work on one Linux distribution they can usually be transplanted seemlessly onto another, so that's always worth investigating.
As a fallback, when all other avenues of investigation have been non-productive or unsuccessful, you can try using Google to find out which Linux driver is required to run your wireless USB device. A lot of users choose route this as their first option anyway.
Where are Linux drivers located on my Slackware ARM system?
Linux drivers on Slackware ARM are located in the '/lib/modules/$(uname -r)/kernel/drivers' directory. Where 'uname -r' is the kernel version you currently have installed. This is just another way of saying '3.10.18' or '4.2.6', but used this way you will always get to the correct directory no matter what. For instance, if you have upgraded your system and not removed old kernel '/lib/modules' files, etc. there could be several directories which contain similar files, but your system should only be using one of them. Within the drivers directory there are dozens of folders containing drivers for hardware devices on your Slackware ARM system, of which networking, and wireless, are included. Wireless drivers can be found in the '/lib/modules/$(uname -r)/kernel/drivers/net/wireless' directory. See the example below if you're not quite sure what 'uname -r' means or how it works.
The kernel version on our Slackware ARM system is '4.4.24-v7-arm', which is the kernel provided by the SARPi3 installer. Yours will most probably be different.
How do I compile and install wireless device drivers myself for Slackware ARM?
It's standard practice to include all documentation within any software, not just Linux. You should refer to that documentation. Yes, some RTFM is required, as with all things in Slackware, and Linux in general. Usually it's a case of running 3 commands; ./configure, make, and make install, but not invariably. It's always best to read the documentation that accompanies the software. If no documentation is included than you really have to ask "How valid/reliable/legitimate/authentic/bona fide is this software?"
How do I load my wireless device drivers on Slackware ARM?
Once you have installed your wireless USB adapter drivers you need to load the driver 'module' into the kernel so it can be used. The trick here is knowing the exact name of the driver module in question. At this stage of the tutorial it should be more than clear to you which driver is required to run your wireless USB adapter.
So, to load a module into the kernel you use the 'modprobe' command. In our case we would do it like this:
If you make a mistake and load the wrong module, use the 'rmmod' command to remove it.
To inspect the contents of any module use the 'modinfo' command.
NB: Here you would substitute 'rt2800usb' for the name of the driver module for your own wireless USB adapter. Unless your device features the same or similar chipset that requires the rt2800usb module to run it, then it will be the same, obviously.
If you would like to know more details about managing driver modules, refer to the 'man' (manual documentation) pages within Slackware ARM by using the commands; man modprobe, man rmmod, man modinfo, etc.
Configuring your wireless network interface card (WNIC)
So, with your wireless network interface card (WNIC) drivers installed and loaded it's time to make your Slackware ARM system capable, and ready, to connect to a wireless network (WLAN). First you should make sure that the drivers are loaded correctly. So type the following command:
If you're using the on-board WNIC on a Raspberry Pi 3 then it should look something like this:
If you're using a wireless USB adapter on a Raspberry Pi 1, 2, or 3, then, bearing in mind the driver modules for your own wireless USB device will probably be different, it should look something like this:
Now, you might be aware that the network interface card (NIC) on your Raspberry Pi is named 'eth0' by your Slackware ARM system. It could also be 'eth1' or 'eth2' depending how you have things setup. However, the wireless network interface card (WNIC) will be named 'wlan0', or 'wlan1', or 'wlan2', and so forth. This is how you tell the difference between them and manage them as seperate items. So, check if the wireless interface exists by typing the following command:
You should see something similar to the following:
If you do not see the interface listed then something went wrong. You need to go back and check your configuration again.
If you can see the 'wlan0' interface then you need to fire it up (i.e. enable it). Type the following:
Now your 'wlan0' interface should be active and you can check this by typing the following command:
You should see either; a wall of text scrolling down your screen with various available wireless connections (i.e. access points), or just your own. If you are in a location with many WLANs within range then it's not surprising that you will detect them. However, as long as your own is listed within the results that's all you're concerned with. Here's our example output from the command:
So, if you can see that there's at least your own WLAN within that list (look for the ESSID:"name/identity" of your wireless network) you are well on your way to setting up a wireless connection.
Connecting to a wireless network (WLAN)
Here is where you might find that Slackware isn't as straight-forward as some other Linux distributions when it comes to wireless networking, and also that wireless networking is a little more complex than its standard wired (i.e. Ethernet) sibling. It may take a little more time and effort to achieve, but it's far from 'too difficult' or 'too hard', by any stretch of the imagination. Slackware includes a heterogeneous collection of wireless networking tools which enables you to configure a wireless network interface card on a fundamental level. However, due to the diversity and variability of each and every wireless network, interface card, and method(s) by which they are connected, why make things even more bewildering than they could be? There are such things as "a network manager for Linux" available which will make your effort(s) that much easier, and save you time (and hopefully save you from pulling your hair out). Yes, configuring a wireless network/connection in Linux can be a pain in the neck at times. Perhaps, only for the first time you do it though. Once you become familiar with the intricacies of the process it's much easier, like everything else in life.
The network manager software you're going to download is 'Wicked'. No seriously, that's it's name, 'wicd' - pronounced "wicked". :D
You will find 'wicd' in the '/extras/wicd' directory of any Slackware 14.x DVD or available to download from the Internet. Incidentally, Slackware ARM isn't distributed on DVD because most ARM devices do not have a DVD ROM drive, so there's not much point. However, you're going to download the Slackware ARM 'wicd' package. You can get it from ftp.arm.slackware.com/slackwarearm/slackwarearm-14.2/extra/wicd/ (make sure to download the .txz package file) or via the command line, like this:
root@vuur:/tmp# wget http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.2/extra/wicd/wicd-1.7.4-arm-3.txz
Then you need to install the 'wicd' package with the following command:
Once you have installed 'wicd' you need to start it. Type the following command:
Ok. Without going into too much detail about 'wicd', because there is literally LOADS of things we could get into, it's basically a program which enables you to connect to a wireless network (WLAN) easily. There's 'wicd-client' for a desktop environment, and 'wicd-curses' for command line. You're going to be using the latter. So, type the following command:
You should be presented with the Wicd Curses Interface screen, as shown below. Please note that the networks (WLANs) shown in the screenshot are within range of our location. You will only see networks which are within range of your location.
On the list of available networks you should see your own WLAN listed under wireless networks. Our WLAN is called 'FATDOG_WLAN' as you can see in this example. You will also see that there is an existing wired network connection (via an Ethernet cable) which is how we are connected on our Raspberry Pi. If you are connected the same way then you should see your own wired connection here.
Using the up and down cursor keys, move the highlight so it's over your own wireless network (WLAN) name and press the right cursor key.
Now you should be in the configuration screen for your wireless network, as shown below.
In this configuration screen there are only a few settings you need to change.
• Move the highlight down to 'Use DHCP Hostname' and press the space_bar which will put an 'X' in the field, then move down one more line and give your Raspberry Pi a name (DHCP Hostname) which will be identifiable on the wireless network (WLAN). We have chosen to name ours 'drie-wireless'.
• Move the highlight down to 'Automatically connect to this network' and press the space_bar which will put an 'X' in the field, which does exactly what is says.
• Move the highlight down to 'Key' and type the password for your wireless network (WLAN). We've entered '1234567890' as our example password. You need to put your own password in here.
Leave everything else as it is, unless you really do want to change these settings and specify your own.
Now press the 'F10' key (or the 'SHIFT' and 'S' keys together) to save your settings and exit back to the main 'wicd-curses' interface.
If you are using 'wicd-curses' in a terminal window from a desktop environment, the 'F10' key may already be assigned to carry out another function. So, in that case use the 'SHIFT' and 'S' keys combination to save your settings. ;-)
The last thing to do is to make sure the highlight is over your wireless network connection (WLAN) and press 'SHIFT' and 'C' keys together. This will connect your system to the selected wireless network connection (WLAN).
If you've entered your password and done everything else correctly, after a moment of handshaking between the two devices, you should see that you are connected to your wireless network (WLAN) with a green bar across the screen and an '>' sign next to the signal strength. This shows that it's connected successfully. If so, you should disconnect your Ethernet cable to test that your wireless connection is working as expected, and because it's not required when you have wireless running.
The next time you reboot your system, Slackware ARM will automatically connect wirelessly to your router/access point. At any time you can run 'wicd-curses' to reconnect should you need to do so, or to connect to another wireless network. Just do the same as you've done in this tutorial to connect with another wireless network (WLAN). It's quite easy once you know how. Isn't it? ;-)
That's it! You're all done. If you have followed this tutorial and have successfully managed to connect your Raspberry Pi to your wireless network (WLAN) then contratulations are in order. Well done indeed!
Thanks and credits
Thank you for taking the time to go through this SARPi project. We hope that it has been useful and perhaps somewhat educational along the way.
Many thanks also to the Slackware Team for their constant work and efforts, especially Stuart Winter (a.k.a. MoZes) who mainly manages and maintains Slackware ARM. Without these guys we wouldn't have such a wonderful operating system to use. <3