{"id":63,"date":"2018-10-21T10:34:01","date_gmt":"2018-10-21T16:34:01","guid":{"rendered":"http:\/\/zzq.org\/?p=63"},"modified":"2022-12-11T21:51:39","modified_gmt":"2022-12-12T04:51:39","slug":"pi-as-a-wifi-repeater","status":"publish","type":"post","link":"https:\/\/zzq.org\/?p=63","title":{"rendered":"Pi as a WiFi Repeater"},"content":{"rendered":"<p>The Raspberry Pi is a wonderful platform, not only because it&#8217;s well supported, but that&#8217;s as a result of it&#8217;s price and flexibility. Lots of USB ports on the 2 and 3 models, HDMI, Ethernet, and now it also includes wireless and Bluetooth onboard.<\/p>\n<p>I have been meaning to experiment a build a wireless repeater using a Pi, and finally got a chance (and the courage) to attempt this feat. It wasn&#8217;t easy, and this is by no means a comprehensive guide, but rest assured that if you get it to work, you&#8217;ll understand why.<\/p>\n<p>I started with a Pi 3, 16GB Kingston micro SD card, and an external Atheros AR9271 based adapter from TP-Link and made for a TCL television. I got this from an infamous friend, <a class=\"ProfileHeaderCard-screennameLink u-linkComplex js-nav\" href=\"https:\/\/twitter.com\/d4rkm4tter\"><span class=\"username u-dir\" dir=\"ltr\">@<b class=\"u-linkComplex-target\">d4rkm4tter<\/b><\/span><\/a> of the #WifiCactus and it&#8217;s &#8220;high-gain&#8221; antenna gives it extra reach for connecting to distant APs.<\/p>\n<p>Raspbian Stretch was used, the full version because I&#8217;m not a full cli master, starting with the April 2018 image, then eventually using the October 2018 installer (which is nicer).<\/p>\n<p>My intention is to use the external USB adapter to associate with a remote AP and get a connection. This would be bridged by the Pi and dnsmasq with the built-in wireless adapter on the Pi. My testing shows that the 802.11n Atheros adapter with the external antenna does indeed have improved gain.<\/p>\n<p>I followed the guide found here: &lt;a href=&#8221;https:\/\/pimylifeup.com\/raspberry-pi-wifi-extender\/&#8221;&gt;PiMyLifeUp&lt;\/a&gt;<\/p>\n<p>All of this was very helpful, and the guide is extremely well written and intended for the Pi2\/3 owners. My only change to this guide, or difficulty with, was that I wanted to invert the adapter role, so changing &#8220;wlan0&#8221; to &#8220;wlan1&#8221; and vice-versa throughout was necessary.<\/p>\n<p>The packages called dnsmasq and hostpad are the real workers here, and to the heavy lifting, routing, and interfacing with the adapters. I had some success with just following this setup, but also found that it didn&#8217;t _just work_ so the tinkering and frustration curve began.<\/p>\n<p>One neat trick that I did learn from elsewhere is that hostpad can be run with a config file as an argument, which means that you&#8217;ll start the service with a verbose console feed, but it will let you know if the config file is working and whether the AP has started. When you see &#8220;AP-ENABLED&#8221; and few, if any errors, you&#8217;ll finally know you&#8217;re there.<\/p>\n<p>As of this writing, I&#8217;ve been running the AP for several days. Performance is weak for throughput, at less than 10Mbps, but the application this is meant for, or would be used in, is a location that has very poor cellular coverage for non-Verizon customers. This application of the Pi can be configured in a place or situation where _some_ connection is an improvement over _none_.<\/p>\n<p>Interestingly, the PW-4210D adapter does have a removable antenna, so the use of a parabolic, omnidirectional, or yagi antenna with an adapter is possible for a very long run. There are also more solid, cheaper wireless bridges available online, but if you&#8217;re a tinkerer like I am, and have the spare hardware, there&#8217;s something special in feeling like you&#8217;ve made a bucket of parts do something interesting.<\/p>\n<p>Go, do it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Raspberry Pi is a wonderful platform, not only because it&#8217;s well supported, but that&#8217;s as a result of it&#8217;s price and flexibility. Lots of USB ports on the 2 and 3 models, HDMI, Ethernet, and now it also includes wireless and Bluetooth onboard. I have been meaning to experiment a build a wireless repeater [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/zzq.org\/index.php?rest_route=\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zzq.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zzq.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zzq.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zzq.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=63"}],"version-history":[{"count":1,"href":"https:\/\/zzq.org\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/zzq.org\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/zzq.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zzq.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zzq.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}