A Hell Story of Linux Drivers
I’m in Bali and with me I have taken an old Dell Latitude 3540 freshly installed with Linux Mint (19.2). As I have not used Linux before, I did a quick test prior to setting off to check everything worked correctly. The test proved successful, but the PC has since been a nightmare.
After meeting the team at Dojo Bali, a coworking space in Canggu, I sat myself down to begin work. I successfully connected to the WiFi in the morning and setup my dev environment for the next month. I made great progress, however once I sat back down after lunch I found my WiFi no longer worked.
To debug the problem I first looked around to see if there was any disturbance or frustation with the people around me. Everyone seemed focused so was confident that the WiFi was still operating correctly.
I checked to see if I was connecting successfully to the network, however I was unable to list any networks at all. I looked further at the network settings and found it was not showing my wireless card.
With no internet connection available on my laptop, I resorted to searching for solutions on my phone and after running inxi
, a CLI for system information, I found my network card to be Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
.
After further exploration, I found that it was using the preinstalled driver r8169
. Not only is this the incorrect driver, but it is also unstable!
I needed to install the r8168
driver instead. Thankfully this old laptop includes an Ethernet port so after speaking to the staff, I learnt that the only place to access a wired connection is in the Skype rooms.
I borrowed an Ethernet cable and plugged myself in, I ran sudo apt-get install r8168-dkms
.
Not only did this fix the problem immediately, but as it was the dkms
version it rebuilds the module when a new kernel is installed. Seems good.
I continued working with no problems for the rest of the day and the following morning.
Sitting back down after the following lunch, the same problem began to occur. Except that this time inxi
shows that it is indeed using the correct r8168
driver.
So once again I jumped back into the Skype room that I was able to book for an hour. I could tell I was starting to bother the staff so I kept my fingers crossed this would be the last time with their cable.
I tried several things to rectify the problem:
- I reinstalled the same way by running
sudo apt-get install r8168-dkms
. - I ran all updates available through Linux Mint’s update manager.
- I manually installed the latest drivers instead of through the package manager. I found the drivers through this mirror as Realtek removed these drivers from their website some time ago. I was delighted to see that it was still being updated to support the latest kernels. Included is a bash script that removes the old version and does various cleanup too, neat.
- I blacklisted the
r8169
driver by runningsudo sh -c 'echo blacklist r8169 >> /etc/modprobe.d/blacklist.conf'
. Even though I confirmed it was no running I figured it did no harm.
No dice.
Thinking Outside the Box
After searching for solutions on my phone, bothering staff by borrowing their only spare Ethernet cable and booking Skype rooms, I needed to look outside the box. 2 solutions came to mind:
- Buy a Windows 10 bootable USB. I know Windows has come preinstalled with the most common drivers for years and years. Although expensive, I know I could make use of the license key on a family PC at some point. The main issues I could see was that there was no guarantee those drivers were preinstalled, my familiarity of Windows these days being low and that I would have to setup my dev environment all over again.
- When software fails, resort to other hardware. Buy a USB network card in hope that the drivers are preinstalled or well supported. This is a cheap option which would allow me to continue using my existing and familiar Unix dev environment.
I took to Reddit on my phone to ask for compatible USB network cards or where to look for compatibility. Turns out Reddit is blocked by the Indonesian government to prevent porn being accessible. Fun. My VPN solved this issue and I asked away. Turns out most modern ones should be fine.
I set off on my motorbike to Bali Techno Grosir Computer (BTGCOM). The store’s products were all behind the counter and with none in sight I asked what they had.
One. They had one. One left and only stock one model. I picked up the TP-Link WN821N for a grand total of 90,000 IDR, about £5. Thankfully the box boasted Linux support and I have used a TP-Link wireless N extender before and thought it was great.
I also picked up an Ethernet cable which I had to wait for as they manually cut the wire and added the connectors either end. I assumed these were manufactured pre-cut so this was amusing.
Back at the hotel, the USB wireless card worked well. In the coworking space, sort of. After wandering around the office I have managed to establish a connection. It doesn’t appear to be a very good connection. But it’s enough for me to get by. I have installed Zeal for offline documentation and believe I’ve found the seat in the building offering the best signal.
I could probably debug this further but I don’t believe it to be a valuable use of my time, nor do I want to risk completely messing the machine up.