User avatar
Swampy42
Posts: 15
Joined: Sat Sep 02, 2017 9:19 pm
Location: Kempten (Germany)
Contact: Website

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Sun Nov 04, 2018 2:36 pm

Tested and It worked! :o

Did you fork this repository from chunkeey?

Thank you very much :D
Linux is like wigwam: no Gates, no Windows and Apache inside.

fiisch
Posts: 2
Joined: Sat Nov 03, 2018 10:58 pm

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Thu Nov 08, 2018 10:33 pm

You're welcome! :-)

Yes, I forked from chunkeey, but was too lazy for a pull request...

User avatar
Swampy42
Posts: 15
Joined: Sat Sep 02, 2017 9:19 pm
Location: Kempten (Germany)
Contact: Website

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Sat Nov 17, 2018 11:54 am

The script from drmullins is not working for me now:

Code: Select all

/root/rtl8192su/r92su/main.c:1333:25: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .change_virtual_intf = r92su_change_virtual_intf,
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
/root/rtl8192su/r92su/main.c:1333:25: note: (near initialization for ‘r92su_cfg80211_ops.change_virtual_intf’)
/root/rtl8192su/r92su/main.c: In function ‘r92su_if_setup’:
/root/rtl8192su/r92su/main.c:1741:6: error: ‘struct net_device’ has no member named ‘destructor’; did you mean ‘priv_destructor’?
  ndev->destructor = free_netdev;
      ^~
cc1: some warnings being treated as errors
scripts/Makefile.build:328: die Regel für Ziel „/root/rtl8192su/r92su/main.o“ scheiterte
make[2]: *** [/root/rtl8192su/r92su/main.o] Fehler 1
Makefile:1527: die Regel für Ziel „_module_/root/rtl8192su/r92su“ scheiterte
make[1]: *** [_module_/root/rtl8192su/r92su] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-headers-4.14.79+“ wird verlassen
Makefile.r92su:24: die Regel für Ziel „all“ scheiterte
make: *** [all] Fehler 2
I changed the script for me like drmullins posted in:
https://github.com/raspberrypi/linux/issues/2185

Code: Select all

#!/bin/bash
# Install r92su kernel module replacing r8712u

apt-get update
apt-get install raspberrypi-kernel-headers
cd ~
git clone https://github.com/asig/rtl8192su.git
cd rtl8192su
make -f Makefile.r92su

UPDATES=/lib/modules/$(uname -r)/updates
if [ ! -d $UPDATES ] ; then
mkdir $UPDATES
echo creating $UPDATES
fi
cp r92su/r92su.ko $UPDATES

if [ ! -e /etc/modprobe.d/blacklist-r8712u.conf ] ; then
echo "blacklist r8712u" >/etc/modprobe.d/blacklist-r8712u.conf
fi

depmod
Linux is like wigwam: no Gates, no Windows and Apache inside.

Crazyhorse605
Posts: 1
Joined: Mon Nov 26, 2018 7:48 am

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Mon Nov 26, 2018 2:38 pm

Hi,

Thanks for all this work. I tried it on the older kernel, 4.14.79 and the connection continusly dropped.
Updated to 4.14.82 and the makefile does not work. I have :
sudo make -f Makefile.r92su
make -C /lib/modules/4.14.82-v7+/build M=/home/pi/rtl8192su/r92su CONFIG_R92SU=m CONFIG_R92SU_WPC=y EXTRA_CFLAGS="-DDEBUG -DCONFIG_R92SU=m -DCONFIG_R92SU_WPC=y"
make[1]: *** /lib/modules/4.14.82-v7+/build: No such file or directory. Stop.
Makefile.r92su:24: recipe for target 'all' failed
make: *** [all] Error 2

I cannot see anything like in the other directory and have run all calls in the example file above.

User avatar
Swampy42
Posts: 15
Joined: Sat Sep 02, 2017 9:19 pm
Location: Kempten (Germany)
Contact: Website

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Sat Dec 01, 2018 10:52 am

Hello Crazyhorse605,

Remove the rtl8192su folder in home, before you try it.
I also had the problem, but I can't remember whether this was reason.
Linux is like wigwam: no Gates, no Windows and Apache inside.

MrEngman
Posts: 3850
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Sat Dec 01, 2018 1:49 pm

Crazyhorse605 wrote:
Mon Nov 26, 2018 2:38 pm
Hi,

Thanks for all this work. I tried it on the older kernel, 4.14.79 and the connection continusly dropped.
Updated to 4.14.82 and the makefile does not work. I have :
sudo make -f Makefile.r92su
make -C /lib/modules/4.14.82-v7+/build M=/home/pi/rtl8192su/r92su CONFIG_R92SU=m CONFIG_R92SU_WPC=y EXTRA_CFLAGS="-DDEBUG -DCONFIG_R92SU=m -DCONFIG_R92SU_WPC=y"
make[1]: *** /lib/modules/4.14.82-v7+/build: No such file or directory. Stop.
Makefile.r92su:24: recipe for target 'all' failed
make: *** [all] Error 2

I cannot see anything like in the other directory and have run all calls in the example file above.
/lib/modules/4.14.82-v7+/build is a symlink to the kernel source/headers directory.

You can create the link using command like

Code: Select all

sudo ln -s /home/pi/src/linux /lib/modules/$(uname -r)/build
Change /home/pi/src/linux to the directory where your Linux source/headers are.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
Swampy42
Posts: 15
Joined: Sat Sep 02, 2017 9:19 pm
Location: Kempten (Germany)
Contact: Website

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Fri May 31, 2019 4:48 pm

New problems with kernel 4.19.42 while executing the script:

Code: Select all

make[1]: Verzeichnis „/usr/src/linux-headers-4.19.42+“ wird betreten
  CC [M]  /root/rtl8192su/r92su/michael.o
  CC [M]  /root/rtl8192su/r92su/aes_ccm.o
  CC [M]  /root/rtl8192su/r92su/eeprom.o
  CC [M]  /root/rtl8192su/r92su/event.o
  CC [M]  /root/rtl8192su/r92su/debug.o
  CC [M]  /root/rtl8192su/r92su/main.o
/root/rtl8192su/r92su/main.c: In function ‘r92su_bss_add_work’:
/root/rtl8192su/r92su/main.c:716:10: error: implicit declaration of function ‘ACCESS_ONCE’ [-Werror=implicit-function-declaration]
   node = ACCESS_ONCE(node->next);
          ^~~~~~~~~~~
/root/rtl8192su/r92su/main.c:716:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   node = ACCESS_ONCE(node->next);
        ^
/root/rtl8192su/r92su/main.c: In function ‘r92su_stop’:
/root/rtl8192su/r92su/main.c:1566:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   node = ACCESS_ONCE(node->next);
        ^
cc1: some warnings being treated as errors
scripts/Makefile.build:303: die Regel für Ziel „/root/rtl8192su/r92su/main.o“ scheiterte
make[2]: *** [/root/rtl8192su/r92su/main.o] Fehler 1
Makefile:1524: die Regel für Ziel „_module_/root/rtl8192su/r92su“ scheiterte
make[1]: *** [_module_/root/rtl8192su/r92su] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-headers-4.19.42+“ wird verlassen
Makefile.r92su:24: die Regel für Ziel „all“ scheiterte
make: *** [all] Fehler 2
creating /lib/modules/4.19.42+/updates
cp: der Aufruf von stat für 'r92su/r92su.ko' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
Linux is like wigwam: no Gates, no Windows and Apache inside.

luksen
Posts: 5
Joined: Fri Jan 09, 2015 1:03 pm

Re: Realtek wireless adapter not connecting in Stretch (Jessie OK)

Sat Sep 28, 2019 3:04 pm

Swampy42 wrote:
Fri May 31, 2019 4:48 pm
I am aware that this is an old topic, but the problem that rtl8191su chips do not work with the provided r8712u driver still persists, and since this thread is one of the first entries one gets on google it seems appropriate to post here.
Anyway, since my wifi usb dongle with rtl8191su chip stopped working after updating my pi to 4.19 and the repository linked in a previous post does not compile anymore (due to the driver not being updated to kernel version 4.19.y), I made a new fork and "fixed" the driver myself. I have only tested it for a few hours on kernel version 4.19.66 (which is the latest version at the time of writing this) but so far it seems to work (I have been connected to my pi over wifi for multiple hours without a disconnect).

My fork with the fix for kernel 4.19 can be found here. The script I use to build and load the module (not my work, this is from this thread by drmullins. I simply changed the repository.):

Code: Select all

#!/bin/bash
# Install r92su kernel module replacing r8712u

# Kernel version
KERNELVERSION=$(uname -r)

# Initial update
sudo apt-get update

# Install kernel headers
sudo apt-get install raspberrypi-kernel-headers

# Install git
sudo apt-get install git

# Clone the rtl8192su repository if not already cloned
cd ~
if [ ! -d rtl8192su ] ; then
echo " cloning rtl8192su.git"
git clone https://github.com/luks3n/rtl8192su.git
else
echo " rtl8192su repository already cloned"
fi

echo $(pwd)
# Make kernel updates directory if not already made
UPDATES=/lib/modules/$KERNELVERSION/updates
if [ ! -d $UPDATES ] ; then
sudo mkdir $UPDATES
echo " creating $UPDATES"
else
echo " $UPDATES already exists"
fi

# Make r92su driver if not already in UPDATES and copy new driver into iy
cd rtl8192su
if [ ! -e $UPDATES/r92su.ko ] ; then
echo " Making r92su.ko driver"
make -f Makefile.r92su
if [ -e r92su/r92su.ko ] ; then
echo " copying r92su.ko"
sudo cp r92su/r92su.ko $UPDATES
else
echo " error creating r92su.ko"
read -p "Error - exit" GO
fi
else
echo " r92su.ko already copied to $UPDATES"
fi

# Blacklist r8712u if not previously black listed
if [ ! -e /etc/modprobe.d/blacklist-r8712u.conf ] ; then
temp_file=$(mktemp)
echo "blacklist r8712u" >temp_file
sudo cp temp_file /etc/modprobe.d/blacklist-r8712u.conf
rm temp_file
echo " module r8712u blacklisted"
else
echo " module r8712u already blacklisted"
fi

# remove r8712u if loaded
lsmod | grep r8712u >/dev/null
if [ $? == 0 ] ; then
echo " stopping networking service"
sudo systemctl stop networking
echo " removing module r8712u"
sudo modprobe -rv r8712u
echo " starting networking service"
sudo systemctl start networking
fi

# install module r92su.ko if available and not already loaded
if [ -e $UPDATES/r92su.ko ] ; then
lsmod | grep r92su >/dev/null
if [ $? == 1 ] ; then
echo " updating dependencies"
sudo depmod
echo " stopping networking service"
sudo systemctl stop networking
echo " inserting module r92su"
sudo modprobe -v r92su
echo " starting networking service"
sudo systemctl start networking
else
echo " module r92su already loaded"
fi
else
echo " module r92su.ko not in $UPDATES"
fi

# pause the exit
read -p " Exit ?" GO

I do not have any deep understanding of driver development let alone wifi drivers in particular, I basically just adjusted the aforementioned repository to compile on 4.19.

Return to “Raspbian”