Realtek RTL8188SU WLAN Adapter unreliable connection

Hello all,

I am using Realtek RTL8188SU WLAN Adapter and writing to seek help, because I have connectivity problems. Every now and then the wireless disconnects and refuses to reconnect. I have read on other forums that this could be due to the driver (r8712u), and that I should get the Realtek driver. I downloaded from realtek.com, but I get the following message when I try to install:

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.16.7-35-desktop/build M=/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405  modules
make[1]: Entering directory '/usr/src/linux-3.16.7-35-obj/x86_64/desktop'
make[1]: Entering directory `/usr/src/linux-3.16.7-35-obj/x86_64/desktop'
  CC [M]  /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.o
In file included from /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:23:0:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/osdep_service.h: In function ‘_init_timer’:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/osdep_service.h:151:17: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
  ptimer->data = (u32)cntx;
                 ^
In file included from /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:23:0:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/osdep_service.h: In function ‘thread_enter’:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/osdep_service.h:393:2: error: implicit declaration of function ‘daemonize’ -Werror=implicit-function-declaration]
  daemonize("%s", "RTKTHREAD");
  ^
In file included from /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_ht.h:25:0,
                 from /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/drv_types.h:67,
                 from /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:24:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h: In function ‘get_da’:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:324:46: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
 #define GetAddr1Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 4))
                                              ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:350:9: note: in expansion of macro ‘GetAddr1Ptr’
    da = GetAddr1Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:324:28: warning: cast to pointer from integer of different size -Wint-to-pointer-cast]
 #define GetAddr1Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 4))
                            ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:350:9: note: in expansion of macro ‘GetAddr1Ptr’
    da = GetAddr1Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:324:46: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
 #define GetAddr1Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 4))
                                              ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:353:9: note: in expansion of macro ‘GetAddr1Ptr’
    da = GetAddr1Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:324:28: warning: cast to pointer from integer of different size -Wint-to-pointer-cast]
 #define GetAddr1Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 4))
                            ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:353:9: note: in expansion of macro ‘GetAddr1Ptr’
    da = GetAddr1Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:328:46: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
 #define GetAddr3Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 16))
                                              ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:356:9: note: in expansion of macro ‘GetAddr3Ptr’
    da = GetAddr3Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:328:28: warning: cast to pointer from integer of different size -Wint-to-pointer-cast]
 #define GetAddr3Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 16))
                            ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:356:9: note: in expansion of macro ‘GetAddr3Ptr’
    da = GetAddr3Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:328:46: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
 #define GetAddr3Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 16))
                                              ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:359:9: note: in expansion of macro ‘GetAddr3Ptr’
    da = GetAddr3Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:328:28: warning: cast to pointer from integer of different size -Wint-to-pointer-cast]
 #define GetAddr3Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 16))
                            ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:359:9: note: in expansion of macro ‘GetAddr3Ptr’
    da = GetAddr3Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h: In function ‘get_sa’:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:326:46: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
 #define GetAddr2Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 10))
                                              ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:374:9: note: in expansion of macro ‘GetAddr2Ptr’
    sa = GetAddr2Ptr(pframe);
         ^

........

........
   
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:403:9: note: in expansion of macro ‘GetAddr1Ptr’
    sa = GetAddr1Ptr(pframe);
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:324:28: warning: cast to pointer from integer of different size -Wint-to-pointer-cast]
 #define GetAddr1Ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 4))
                            ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/wifi.h:403:9: note: in expansion of macro ‘GetAddr1Ptr’
    sa = GetAddr1Ptr(pframe);
         ^
In file included from /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/drv_types.h:73:0,
                 from /home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:24:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_recv.h: In function ‘rxmem_to_recvframe’:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_recv.h:435:30: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
  return (union recv_frame*)(((uint)rxmem>>RXFRAME_ALIGN) <<RXFRAME_ALIGN) ;
                              ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_recv.h:435:9: warning: cast to pointer from integer of different size -Wint-to-pointer-cast]
  return (union recv_frame*)(((uint)rxmem>>RXFRAME_ALIGN) <<RXFRAME_ALIGN) ;
         ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c: In function ‘_init_cmd_priv’:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:93:75: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
  pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf  +  CMDBUFF_ALIGN_SZ - ( (uint)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
                                                                           ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:101:60: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
  pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf  +  4 - ( (uint)(pcmdpriv->rsp_allocated_buf) & 3);
                                                            ^
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c: In function ‘_init_evt_priv’:
/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:135:59: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
  pevtpriv->evt_buf = pevtpriv->evt_allocated_buf  +  4 - ((unsigned int)(pevtpriv->evt_allocated_buf) & 3);
                                                           ^
cc1: some warnings being treated as errors
/usr/src/linux-3.16.7-35/scripts/Makefile.build:273: recipe for target '/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.o' failed
make[4]: *** [/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.o] Error 1
/usr/src/linux-3.16.7-35/Makefile:1359: recipe for target '_module_/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405' failed
make[3]: *** [_module_/home/Andras/wireless/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405] Error 2
Makefile:195: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:24: recipe for target '__sub-make' failed
make[1]: *** [__sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-3.16.7-35-obj/x86_64/desktop'
Makefile:220: recipe for target 'modules' failed
make: *** [modules] Error 2

I also read that I should try the rtl8192su driver from https://github.com/chunkeey/rtl8192su but I could not compile that either.
Any suggestions how to compile the driver? Or should I do something different in order to have a reliable wireless connection.

Thanks.

Bus 001 Device 005: ID 0bda:8171 Realtek Semiconductor Corp. RTL8188SU 802.11n WLAN Adapter
    8.498407] r8712u: module is from the staging directory, the quality is unknown, you have been warned.
    8.499233] r8712u: Staging version
    8.499243] r8712u: register rtl8712_netdev_ops to netdev_ops
    8.499247] usb 1-1.6: r8712u: USB_SPEED_HIGH with 4 endpoints
    8.499782] usb 1-1.6: r8712u: Boot from EFUSE: Autoload OK
    8.880403] usb 1-1.6: r8712u: CustomerID = 0x0000
    8.880409] usb 1-1.6: r8712u: MAC Address from efuse = 00:e0:4c:a2:61:c4
    8.880412] usb 1-1.6: r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
    8.880560] usbcore: registered new interface driver r8712u