## RTL8723BE WiFi Stable Under Linux

On the laptop I name ‘Klystron’, I have kernel version ‘‘, and the misfortune of a WiFi chip-set that uses the kernel module ‘‘ with its companion kernel modules. Fortunately, I believe that it finally, fully stable!

I think that the most important detail on my part to getting this kernel module stable, was to add the file ‘‘ to contain the following code:


options rtl8723be fwlps=0
options rtl8723be swlps=0




Yet, as a series of blog postings already shows, it was not so quick and easy to obtain stability. One reason I think that my WiFi was failing on me recently, was my persistence in trying to put the laptop to Sleep, aka “Suspend To RAM”. This was never fully supported, and after Resuming from this sort of suspend mode, the WiFi would always be unstable. The only way I had to remedy this, was to change my user-level configuration, never to put the laptop to Sleep again.

Even with the WiFi supposedly stable in this way, the malfunction remains, that for any duration of time I close the laptop lid, the WiFi temporarily cuts off, which I think is a problem with the antenna. My solution: Leave the laptop idling, with its lid open. The result: Days and days of steady connection. Some small amount of dust on the laptop keyboard.

But there seemed to have been another problem with my WiFi specifically. The modem-router which I rent from Bell seems to have a specific policy. It sets itself to be the DNS server for my LAN, which downloads the IP addresses from its DNS parent. The WiFi router seems to have a zero-tolerance policy, if any computers try to bypass it as my DNS server. And this problem can be so strict, that even to have my LAN machines act as server, will cause problems and stability issues, which mimic hardware WiFi disconnection issues.

In my ‘‘, I needed to set


wins support = no

dns proxy = yes




Otherwise, the member servers would fail to see each other as Samba-connected, and finally lose their connection altogether.

Further, I had scripted the idea into my configuration files, to prepend IP address 8.8.8.8 as an additional DNS server into ‘‘ on boot-up, just hoping to obtain wider connectivity. But then one additional problem with that was, that this public DNS server would suggest IPv6 addresses in addition to IPv4, and that even though my user-level settings for the network said to ignore IPv6 addresses, a malfunction in the kernel – which has not bee remedied – would cause the WiFi client to try to request the IPv6 addresses anyway. My user-level settings were being ignored.

Thus, I think that getting rid of the 8.8.8.8 was instrumental in achieving stability.  Since this router does not tolerate IPv6, and since it is now my only DNS server, there is no risk of IPv6 addresses ever getting mentioned on my LAN.

On that note: It is normal on a dual-stack machine, for each NIC to have an IPv4 as well as a local, “Link” IPv6 address. But I think that one aspect in which the behavior of Ethernet cards is different from WiFi, is that the Ethernet card will not try to use its IPv6 address, because that will recognize this is not a global address, which would need to be assigned by the router. It would only try to use its “link” IPv6, if it was to try to connect directly to another machine on my LAN. OTOH, It would seem that a WiFi chip-set will not recognize that its IPv6 is invalid, and will ask for “Global” IPv6 addresses.

This can be an embarrassment, if the router did not specify any, and if the router assumes that it is the only DNS server.

Dirk

## WiFi on Laptop named Klystron, RTL8723BE

One subject which I have commented on often, but which in recent months I have gotten little or no new information about, was the stability of the WiFi chip-set on my laptop ‘Klystron’, which is driven by the kernel modules known as ‘RTL8732BE’.

Here is an earlier posting on this subject.

Since that posting, there have been 2 firmware updates to that laptop specifically. One, to version 1.159, and the next, to version 1.160.

What I found was that firmware version 1.159 actually seemed to make the WiFi very unstable again – a regression. But firmware version 1.160 seemed to make it stable again.

In the meantime, I have a script in directory

/lib/systemd/system-sleep

which is intended to deal with A Different Problem that laptop has, which was, that after resuming from sleep, the laptop system clock would seem to jump ahead exactly 68 hours. I had changed that script as an experiment. But now I have changed it back again, to:


#!/bin/bash
#
# fixing https://bbs.archlinux.org/viewtopic.php?id=173487

case "$1" in pre) date +%s > /tmp/suspend.log ;; post) was=cat /tmp/suspend.log now=date +%s # time shifts for 68 hours if [$now -gt expr $was + 244800 ]; then date -s "date -R --date="68 hours ago"" fi /bin/sh -c "sleep 20; /etc/init.d/nmbd restart; /etc/init.d/smbd restart" & ;; *) ;; esac  I often did suspect that problems which I had specifically associated with the kernel module, may not in fact stem from the kernel module. On my LAN, I use a router which is not owned by me, but rather by my ISP, and that router has numerous settings – as well as its own Firmware flashing – under the control of my ISP rather than under my direct control. This router is still useful to me, because I subscribe to “Bell Fibe” and get to watch TV through it, in 1920x1080i resolution, which I could not do, if I was to try switching to a router owned by me. But many of the problems which Klystron has on my WiFi, may all be policy issues with this router. Since I cannot get deep into the router settings, I am left guessing as to what router policies the laptop may not be abiding by. But what this can do is lead to Samba problems specifically, which seem to mimic general WiFi connectivity issues, but which are not really examples of that. Dirk ## Linux Support for RTL8723BE Almost Perfect Now In This Posting, I was continuing a long thread of comments, which began by saying, Linux support for the Realtek WiFi Chipset, that is served by the (linux) RTL8723BE kernel module, was dodgy at first. I was also experiencing problems with this, which required certain patches on my part. At the same time, my kernel has been upgraded to version ‘4.4.0-30-generic’, on the affected laptop I name ‘Klystron’, which means that kernel-crackers have also been updating the in-tree kernel modules, including the modules RTL8723BE… What I find is that by now, the behavior of that WiFi-chipset is stable. There was only one problem with it, which I had lastly been reporting, which stated that after the laptop resumes from Suspended-to-RAM, i.e. from a low-power mode that stops it in mid-session and continues to supply very small amounts of current to the DRAM – still performing refresh-cycles – the newly-connected WiFi was experiencing problems again. Well I found that changing a script which I had written, which was located in the directory /lib/systemd/system-sleep To a newer version, still based on the same principles, gives improved performance:  #!/bin/bash # # fixing https://bbs.archlinux.org/viewtopic.php?id=173487 case "$1" in
pre)
date +%s > /tmp/suspend.log
;;
post)
was=cat /tmp/suspend.log
now=date +%s
# time shifts for 68 hours
if [ $now -gt expr$was + 244800 ]; then
date -s "date -R --date="68 hours ago""
fi
sleep 20; /etc/init.d/nmbd restart
;;
*)
;;
esac



The most important difference in the new script, is the unconditional execution of the script command “sleep 20“. My original intention was, that the script should wait for the network connection to be reestablished, before also restarting the ‘nmbd‘ daemon.

But, I observe that the behavior of the kernel, is not to create a new WiFi connection, until all the scripts located in ‘/lib/systemd/system-sleep‘, which run asynchronously, have exited. This means, that my WiFi also does not come back up, until this one script has finished, which will be more than 20 seconds after I Resume the laptop.

I do not believe strongly anymore, that the actual restart of the ‘nmbd‘ daemon accomplishes much.

But apparently, the simple fact that the WiFi connection waits for 20 seconds before being re-established, is what finally makes my WiFi stable – after a Resume From Standby !

This observation would also seem to confirm, that the last misbehavior of this chip-set was mainly due to the fact that it physically has two antennae attached, and that it makes a selection about which one to use, when the WiFi-connection is (re-)established. Apparently, the physical WiFi connection was not yet stable, ~half a second~ after the Resume. For which reason the Kernel Module has been choosing the weaker antenna, whereas after more than 20 seconds have elapsed, the correct antenna is chosen.

Dirk

## Klystron, Kernel Update a Success

The laptop which I name ‘Klystron’, received a Kernel Update on July 7. This brought its kernel version to 4.4.0-30-generic as far as I can tell.

Prior to this update, one of the problems the laptop was still experiencing, was due to its Realtek WiFi chip-set, and the kernel module ‘RTL8723BE’. It had a malfunction in how it was connecting to my WiFi, which should have set in twice again, since July 7, according to earlier observations I had made. This bug had become quite predictable.

But since the latest kernel update, this malfunction has not been taking place anymore.

So I would say, that this kernel update was a huge, welcome success.

A separate question I have not yet answered, was whether its Suspend Behavior has also been corrected. This will be slightly more complicated for me to test, because as the above posting suggests, I had adapted a script, which seems to correct it. If the problem had been resolved in the kernel update, my script would simply not do anything. And the end result would remain, that the problem is not apparent.

In order to see whether the kernel update actually resolved that issue, I would first need to disable my script, and then try a few Suspend Cycles, since this problem was also not taking place with 100% consistency.

I have not yet committed myself to doing that.

Dirk