0

I am using my new HP laptop with a clean installation of Ubuntu 18.04, named Bionic Beaver. Because the wifi-adapter wasn't detected, I followed the steps in this article: http://ubuntuhandbook.org/index.php/2018/08/no-wifi-adapter-found-hp-laptops-ubuntu-18-04/

And after that it worked fine. Here are those steps:

git clone https://github.com/lwfinger/rtlwifi_new.git

cd rtlwifi_new/ && git checkout origin/extended -b extended

sudo apt-get install linux-headers-generic build-essential git

sudo make install

sudo modprobe -r rtl8723de

sudo modprobe rtl8723de

It worked! It was weak, but with the following command it got stronger:

sudo modprobe -r rtl8723de && sleep 5 && sudo modprobe rtl8723de ant_sel=2

I was happy, and later I shut down the computer. Today, I started it up, and the wifi-adapter again was not detected. I still had the git repository, and the extended branch, so I ran the commands again, thinking I would have to make a script to run every time on start up.

but running the sudo modprobe rtl8723de command yields the following error:

modprobe: ERROR: could not insert 'rtl8723de': Exec format error

Based on a comment in this thread, which was not conclusively answered, I tried 'sudo make uninstall' comment from Pilot6

But it did not detect the wifi, and when I reinstalled, it was the same.

Why did my fix not 'stick'? And how can I 'reset' or get it to work again?


As directed in a comment, here are the results of running make:

make -C /lib/modules/4.18.0-16-generic/build M=/home/alex/rtlwifi_new modules make[1]: Entering directory '/usr/src/linux-headers-4.18.0-16-generic' Building modules, stage 2. MODPOST 19 modules make[1]: Leaving directory '/usr/src/linux-headers-4.18.0-16-generic'

Separating these commands has no effect on the output from sudo modprobe rtl8723de


Again as directed:

Results of : dpkg -l * 4.18 * | grep ii

ii linux-headers-4.18.0-15 4.18.0-15.16~18.04.1 all Header files related to Linux kernel version 4.18.0 ii linux-headers-4.18.0-15-generic 4.18.0-15.16~18.04.1 amd64 Linux kernel headers for version 4.18.0 on 64 bit x86 SMP ii linux-headers-4.18.0-16 4.18.0-16.17~18.04.1 all Header files related to Linux kernel version 4.18.0 ii linux-headers-4.18.0-16-generic 4.18.0-16.17~18.04.1 amd64 Linux kernel headers for version 4.18.0 on 64 bit x86 SMP ii linux-image-4.18.0-15-generic 4.18.0-15.16~18.04.1 amd64 Signed kernel image generic ii linux-image-4.18.0-16-generic 4.18.0-16.17~18.04.1 amd64 Signed kernel image generic ii linux-modules-4.18.0-15-generic 4.18.0-15.16~18.04.1 amd64 Linux kernel extra modules for version 4.18.0 on 64 bit x86 SMP ii linux-modules-4.18.0-16-generic 4.18.0-16.17~18.04.1 amd64 Linux kernel extra modules for version 4.18.0 on 64 bit x86 SMP ii linux-modules-extra-4.18.0-15-generic 4.18.0-15.16~18.04.1 amd64 Linux kernel extra modules for version 4.18.0 on 64 bit x86 SMP ii linux-modules-extra-4.18.0-16-generic 4.18.0-16.17~18.04.1 amd64 Linux kernel extra modules for version 4.18.0 on 64 bit x86 SMP

results of : modinfo rtl8723de | grep ver

filename: /lib/modules/4.18.0-16-generic/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8723de/rtl8723de.ko srcversion: 37BE84E7F4EC43A12099BF7 vermagic: 4.18.0-15-generic SMP mod_unload


This is a Make log file for DKMS:

DKMS make.log for rtlwifi_new-0.6 for kernel 4.18.0-16-generic (x86_64) vie mar 15 19:36:12 -05 2019 make: Entering directory '/usr/src/linux-headers-4.18.0-16-generic' scripts/Makefile.build:45: /var/lib/dkms/rtlwifi-new/0.6/build/Makefile: No such file or directory make[1]: *** No rule to make target '/var/lib/dkms/rtlwifi-new/0.6/build/Makefile'. Stop. Makefile:1534: recipe for target '_module_/var/lib/dkms/rtlwifi-new/0.6/build' failed make: *** [_module_/var/lib/dkms/rtlwifi-new/0.6/build] Error 2 make: Leaving directory '/usr/src/linux-headers-4.18.0-16-generic'

Alex
  • 135
  • Edit your question and show me dkms status. Also, break your sudo make install into two commands... make and sudo make install. Show me any text/errors after the make command. – heynnema Mar 15 '19 at 15:51
  • @heynnema after installing dkms and running dkms status, there is no output. I will update the question with results of the make command. – Alex Mar 15 '19 at 16:25
  • This may take a little time... so please be patient. Show me dpkg -l *4.18* | grep ii and modinfo rtl8723de | grep ver. Then, after editing your question with that output, try make clean then make then sudo make install and report back. – heynnema Mar 15 '19 at 17:36
  • @heynnema make clean, make and then make install resulted in success. I again needed to use the command sudo modprobe -r rtl8723de && sleep 5 && sudo modprobe rtl8723de ant_sel=2 in order for it to work at any distance. I am unsure how to continue with the question, on the one hand, my problem is solved, on the other I do want to know why this reset when I shut down, and how to 'make it stick'. Thank you for your patience with me! – Alex Mar 15 '19 at 20:45
  • Why not use dkms? sudo dkms add ~/rtlwifi_new && sudo dkms install rtlwifi-new/0.6 – Jeremy31 Mar 15 '19 at 21:08
  • 1
    @Alex yes, the next step is dkms. This will mean that you won't have to redo this every time you get a kernel update. I'll put together an answer that you can follow, and then accept, ok? – heynnema Mar 15 '19 at 22:30
  • @Jeremy31 dkms was exactly my next step... but I was waiting for it to work using the old school compile/install first. – heynnema Mar 15 '19 at 22:31
  • 1
    @Alex just for learning purposes... the problem that you had before was (as seen via the modinfo rtl8723de | grep ver command) that the filename and vermagic numbers don't match for the kernel. – heynnema Mar 15 '19 at 23:02

1 Answers1

1

To solve the current problem, we'll do this...

make clean                        # clean up leftovers
make                              # compile the software
sudo make install                 # install the software
sudo modprobe -r rtl8723de        # unload the driver
sudo modprobe rtl8723de ant_sel=2 # reload the driver with options

That was successful. However, doing it this way will require that you redo this every time the kernel gets updated via Software Updates. Boo.


Lets redo some of our steps, and use dkms, and make it so that it rebuilds itself when the kernel gets updated.

First, set the terminal back into the prior directory, and uninstall the current working driver...

cd ~/rtl8723de         # change directory
sudo modinfo rtl8723de # see the installed driver
sudo make uninstall    # uninstall the driver
sudo modinfo rtl8723de # make sure it's gone
cd                     # change to ~ directory

Now we install using dkms... using the unzipped folder, or the git clone folder...

If any of the following steps fail, then stop and report back.

sudo apt install dkms build-essential     # already done
cd ~/rtlwifi_new                          # enter the directory
sudo make clean                           # clean up from prior "make"
cd                                        # go to ~ directory
sudo cp -a ~/rtlwifi_new /usr/src/rtlwifi-new-0.6    # copy to /usr/src
sudo dkms add rtlwifi-new/0.6             # add the software to dkms
sudo dkms build rtlwifi-new/0.6           # build the software
sudo dkms install rtlwifi-new/0.6         # install the software
dkms status                               # review the status

Update #1:

Due to some naming problems, we have to clean things up a little before continuing. Do these commands first, then go back and do my original (modified) dkms installation instructions, shown immediately above. Pay special attention to hyphens vs underscores.

If any of the following steps fail, then stop and report back.

dkms status # note the name of the rtlwifi driver... probably rtlwifi_new
sudo dkms remove rtlwifi_new/0.6 --all # remove from dkms
sudo rm -r /usr/src/rtlwifi_new-0.6 # delete directory
ls -al /var/lib/dkms # make sure there are no rtlwifi directories left

Update #2:

Once we get the dkms driver properly installed, we need to create a configuration file to select the correct wireless antenna.

sudo -H gedit /etc/modprobe.d/rtl8723de.conf

enter the following line...

options rtl8723de ant_sel=2

save file and quit gedit

reboot and check wireless operation

Update #3:

Success!

heynnema
  • 70,711
  • Ok, I am reporting back. While copying rtlwifi_new-master, it informs me that no such file or directory exists. Looking around, the repository is rtlwifi_new and inside there are (among other things) directories for the drivers (rtl8723de, among others) and some files called rtlwifi (.ko, .mod.c, .mod.o, and .o). It doesn't seem like you wanted me to copy a directory, or you would have included an -r flag, right? I will try copying some things. As always, thank you. – Alex Mar 15 '19 at 23:30
  • @Alex yes, depending on how you got the software, via git clone, or download the .zip file, it looks like the folder names are different. So change the cp command and lose the -master part, and it should work fine. Don't try and proceed with these commands if mine fail... talk to me first. – heynnema Mar 15 '19 at 23:47
  • @Alex see slight edit to dkms instructions – heynnema Mar 16 '19 at 00:00
  • ok! The copy worked fine without the -master tail, the dkms add worked and created the symlink to that folder. With the dkms build command, I got the error: Bad return status for module build on kernel: 4.18.0-16-generic (x86_64) It gives me the log to consult, I will look and copy over to here. – Alex Mar 16 '19 at 00:09
  • 1
    @Alex I had slightly changed the instruction whilst you were probably doing them... so for now... in terminal, cd /usr/src/rtlwifi_new-0.6, sudo make clean, then cd, then retry the dkms build command. Show me the log if it fails. Report back. – heynnema Mar 16 '19 at 00:15
  • I got the same error, above is the log file output. The UI here on stack exchange is telling me that I am making too many comments! But I am very grateful for your help. – Alex Mar 16 '19 at 00:41
  • 1
    @Alex it's really difficult to read the log when placed into comments. Can you please delete that comment, and then copy/paste the log as an edit to your question, and use the {} icon to format the text if required. We're going to have to debug someone else's code... argh... let me know when you're done with the log edit... did you do the sudo make clean in the /usr/src/rtl... directory? – heynnema Mar 16 '19 at 00:50
  • Done! Yes, I did do the sudo make clean, and in the right directory. If it helps, I think you must be a super hero. – Alex Mar 16 '19 at 01:00
  • @Alex ok... I think I see what's wrong... grrr. It'll take a little while for me to write an update to my instructions... and it's dinner time here... tell me... where is your git folder... on your ~/Desktop, or elsewhere? Show me ls -al /var/lib/dkms and ls -al /usr/src and dkms status. Also edit that output into your question, not the comments, and then let me know it's there. I'll get back to this after dinner, ok? – heynnema Mar 16 '19 at 01:14
  • please, enjoy your family. I too have pushed this beyond office hours. I appreciate your help, tomorrow I will edit my answer and we can start fresh at your convenience then, on Monday or whenever :)

    The git folder is in my home (~).

    – Alex Mar 16 '19 at 01:19
  • 1
    @Alex OK, dinner is down the hatch... I've added Update #1 to my answer. Do it first, then backtrack and redo my (modified) dkms installation instructions. If this conversation gets moved to chat by the moderators, make sure to start comments to me with "@heynnema" (no quotes) or I'll certainly miss them. – heynnema Mar 16 '19 at 03:09