6

I have a raspberry pi Zero with a 4 port USB hub attached to it (via pins on the back). The WiFi dongles that I'm using are twin Edimax EW-7811UN models. What I'm trying to use it for is Internet Connection Sharing. Where I connect to an AP with one dongle and route the traffic to the second dongle which acts as an AP. This set-up mostly works though there is one nagging problem. After a short period of time internet connectivity stops. For instance, when my phone is associated with the AP it displays "Connected. No Internet". The strange part is when I disconnect from the AP and then reconnect the internet connection works again for a short period of time then stops working. This can be done consistently.

I have tried the power saving fix which can sometimes plague these modules by creating a custom .config file as described here I've tried running hostapd in -dd mode but there are no significant log entries to note when the connection drops out. The log looks the same as it did when internet connection is present and when it somehow disconnects. I've even increased the logging output in the hostadp.conf file to see if that would give me something to work with to no avail. I initially thought this was somehow related to iptables so i installed iptables-persistent but this did not help. I also tried to use a completely different WiFi module from a different manufacturer. This did not help and the problem was still there with identical properties.

I'd really like to figure out why the internet connection goes down after a few minutes but then magically reconnects if I cycle my association to the AP. I'd love to be able to troubleshoot this myself but I have no idea which tools/command line options to use to do so. An out and out answer from someone on how to fix this would , of course, be great too!

6
  • A general query (I am not familiar with the configuration you are describing) - are you sure that the two dongles - being in such close proximity are not interfering with each other too much and that the power supply to the RPi Zero and/or the Hub is sufficient? For the former I'd be tempted to use short (1m at most) USB extension leads {beyond 5m you'd really want active extension leads (which contain an in-line hub, so need some power as well) to overcome the timing limits that impose that limit for USB 2.0} on at least one of the WiFI dongles to space it out.
    – SlySven
    Feb 25, 2017 at 21:30
  • 1
    This setup worked as intended under rasbian wheezy. The problem started when I upgraded/had to upgrade to jessie. The location of the dongles and power draw were never an issue in the past. Also, as a side note regarding the power issue, I also wondered if there were other "updates" to the rasbian os that would cause a power problem. So, I tried this on a RPI 2 B+ and the issue persisted. I'm having trouble finding the right tool/log entry/whatever to properly diagnose what exactly goes on when the internet connection drops out. Feb 25, 2017 at 21:59
  • 1
    Weeelll, I'm a sysV init hold-out myself and none of my PCs/RPis use the modern, shiny, and down-right monolithic (to put it politely) creation that is systemd that just about every Linux system either forces or defaults (including Debian/Raspbian "Jessie") to using these days. It might be instructive to install the sysvinit-core and possibly the systemd-shim packages and try to go back to the same sysV init that the old "Wheezy" would use by default, then you will have the same mosaic of daemon control systems (and their log files) as before...
    – SlySven
    Feb 26, 2017 at 18:41
  • I'm googling your suggestion, could you please provide a more detailed explanation on how to do this? Do I just have to install these packages or is there further configuration required? If so could you possibly recommend a tutorial Feb 26, 2017 at 18:47
  • {Deleted/Edited and reposted to fix an important error}: I am not so sure how to switch from systemd to sys init as I made sure that it did not get installed on dist-upgrade by inserting a file (which I called local-pin-init but the name is not important) into /etc/apt/preferences.d/ {read up on this with man apt_preferences} containing: Package: systemd-sysv\nPin: release o=Raspbian\nPin: -1\n {I've used \n as I cannot put new lines in a comment!} - I think "Raspbian" is the word to use here but I'm copying the file from my Debian PC so YMMV...!
    – SlySven
    Feb 27, 2017 at 16:06

2 Answers 2

2

Frankly speaking, I'd just go back to wheezy if that was working for you. If your RPi sits in a local network and is not exposed to the Internet via NAT or similar, there's no reason to upgrade at any cost. Security-wise it's no worse than using a router you have bought a few years back.

Having said that, there are several paths you might want to explore. First, I would try to download old wheezy firmware for your WiFi adapters and try to use that. It's possible that new Jessie drivers will work with old Wheezy firmware.

Second, since you have already tried playing with driver parameters, you might as well dig to the bottom here. Run modinfo rt8192cu | grep parm (or whatever your WiFi driver is) and note which parameters it has. Try setting these to sensible/safe values, reboot and retry.

Finally, you might want to run sudo iwevent in a terminal while running the AP. Hopefully something will appear in the log when the disconnect happens, getting you one step closer to the solution.

3
  • 1
    This issue persists with other WiFi modules from different manufacturers leading me to believe that the answer lies somewhere else ? Please correct me if I'm wrong. Also, if the other modules are using the same driver the parameters of the driver are not very well documented (rtl8192cu) , from what I've found. Feb 28, 2017 at 17:54
  • @chaoticslacker When you say different manufacturers, do you mean "other than Edimax" or "other than Realtek"? I would be really surprised if SlySven were right about systemd being the culprit, I still believe it's the drivers. BTW, you're right about driver parameters being poorly documented, playing with those is mostly guesswork. Feb 28, 2017 at 18:02
  • Yes other than the Edimax EW-7811UN I have tried the tp-link TL-WN722N. Feb 28, 2017 at 18:13
0

So as it turns out, recompiling hostapd to work with the edimax dongles or using the hostapd provided by edimax, as described in many other tutorials and posts all over the internet, only works when the dongle that is providing an internet connection is connected to an open access point or the internet connection is supplied by an ethernet link. The only dongles that work without issue in this type of configuration can be found here: pirate box wifi dongle compatibility. After securing Ralink RT5370 based USB-devices there were no further issues. Thanks to everyone for their assistance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.