WiFi AP/Extender using an old RPi

Overview

SuitiePi was initially thrown together to fill-in a WiFi deadspot in our basement. It plugged into an existing Ethernet cabled to our guest network and basically serves as a WiFi Access Point for visitors and network extender for an unwired, hard-to-reach area of our home.


Migrated to new site spring 2021 - original site/recipe @ http://ventures.tpedersen.net/errata/raspberrypi/suitiepi

Hardware

As usual, our SuitiePi was pieced together using stuff laying around my shop. Originally deployed on a RPi 2 Mod B, but downgraded to our very first RPi 1 Mod B that was sitting around gathering dust - works great!

Specifically:

  • Raspberry Pi 1 Model B Rev 2, overclocked to 800
    (700 M
    Hz, 512MB, 2 USB ports + Ethernet)

  • Original EDIMAX USB WiFi adapter*
    (
    I had a bunch, new model will prob work fine)

  • Older RPI Power Supply (2 amp)

  • Really Old 8g Micro SD card FAILED in 2020 after approx 6 years of varied but constant use!
    Replaced by another really old Kingston 8g Micro SD (from 2015) because I like to live on the edge!


Software

Level of Difficulty & Prep Time

Simple project, no programming required.

Minimal RaspOS/Linux know-how required.

Possibly one hour's worth of work.

Step By Step

(Notes to myself for rebuilds)

Raspberry Pi OS Install

Here's a sing-a-along with RaspAP quick start @ raspap.com/#quick. Official RaspPi OS install info @ www.raspberrypi.org/help/quick-start-guide.../.
Seems to get easier each time I visit.

  1. Download RaspOS Lite via https://www.raspberrypi.org/software/operating-systems/#raspberry-pi-os-32-bit - Approx 400Mib zip, 5 min

  2. Flash SD card using Etcher.io (or similar) - Approx ~5 mins

  3. <Boot>

  4. On initial boot, RaspOS will resize FS . Initial login is pi/raspberry.
    Hit return if it's sitting for a long time - I had one that didn't prompt for login

  5. Update - Approx 5 mins

sudo apt-get update

sudo apt-get dist-upgrade

  1. Install your favorite editor

    sudo apt-get install joe

  2. Post install cleanup via raspi-config

    • System Options:

      • Change pi password

      • Set Hostname

    • Interface Options:

      • Enable SSH

    • Localisation Options (season to taste)

      • Locale = en_US.UTF-8, UTF-8

      • Set Timezone

      • Keyboard = US

      • WLAN (WiFi) Country code

    • Update Raspi-config tools

  1. Time for a Boot

sudo reboot

RaspAP Install

RaspAp Quick installer seems to be way to go on this one ... it's REALLY NICE!

I run the next part via SSH on the RPi hardware intended for SuitiePi services (for good luck!) ...
... In my case; RPi 1 Model B w/ EDIMAX wifi, connected to our guest network via Ethernet ...

One more minor tweak ... just to give the Pi 1 a little kick ... via raspi-config:
Performance Options/Overclock: I set the RPi 1 to "Modest" (800MHz, 0 overvolt).
<Reboot, of course!>


On with RaspAp installer:

I say:
curl -sL https://install.raspap.com | bash

It says (I use defaults wherever I can!):


888888ba .d888888 888888ba

88 8b d8 88 88 8b

a88aaaa8P' .d8888b. .d8888b. 88d888b. 88aaaaa88a a88aaaa8P

88 8b. 88 88 Y8ooooo. 88 88 88 88 88

88 88 88. .88 88 88. .88 88 88 88

dP dP 88888P8 88888P 88Y888P 88 88 dP

88

dP version 2.4.1


The Quick Installer will guide you through a few easy steps



RaspAP Install: Configure installation

Detected OS: Raspbian GNU/Linux 10 (buster)

Using GitHub repository: billz/raspap-webgui master branch

Install directory: /etc/raspap

Install to lighttpd root: /var/www/html? [Y/n]: Y

Installing to lighttpd directory: /var/www/html

Complete installation with these values? [Y/n]: Y

<Setting up, Creating, yada yada - busy for a while>

Enable HttpOnly for session cookies (Recommended)? [Y/n]: Y

<yada yada>

Enable RaspAP control service (Recommended)? [Y/n]: Y

<yada yada>

Install ad blocking and enable list management? [Y/n]: Y

<nice, sure>

Install OpenVPN and enable client configuration? [Y/n]: n

<Will research and try OpenVPN next time>


RaspAP Config (relative to v2.5.2)
http://<IP suitiepi> returns login screen - Initial login is admin/secret.
Settings:

  • Dashboard: Nice!

  • Hotspot Settings

    • Basic: Set SSID, Mode & Channel (I use OSX Wireless Diagnostics to find best channel)

    • Security: WPA2, CCMP & set PSK

    • Advanced: Set MAX Clients & Set Country Code

    • Ad Blocking: Enable blocklists 1.92.168

  • DHCP Server Settings

    • Adjust IP Subnet (Start/Stop IP Address)

  • Ad Blocking: Give it a try!

  • Networking:

    • eth0 - DHCP (IP is reserved in our router)

    • wlan0 - I set static IP, gateways and DNS to 9.9.9.9 to avoid 1.1.1.1. (see below)

  • WiFi client: No change

  • Authentication: Set Admin UC/PW

  • Change Theme: Default is fine

  • Data Usage: Nice!

    • System: Nice


RaspAP Config


RaspAP Config (relative to v2.5.2)

Connect via browser @ http://<IP suitiepi>

Login Screen - Initial login is admin/secret.

Settings (remember to "Save Settings" when tweaking
in here):

  • Dashboard: Nice!

  • Hotspot Settings (I use 802.11n - 2.4GHz on old Pi w/ EDIMAX Wifi Adapter)

    • Basic: Set SSID, Mode & Channel (I use Mac OSX Wireless Diagnostics to find best channel)

    • Security: WPA2, CCMP & set PSK

    • Advanced: Set MAX Clients & Set Country Code

    • Ad Blocking: Enable blocklists

  • DHCP Server Settings

    • Adjust IP Subnet (Start/Stop IP Address & lease time)

    • I also change DNS Server 1 & 2 to 9.9.9.9 (quad9.net) and 8.8.8.8 (google dns)
      (the default, 1.1.1.1 is blocked by TDS, our ISP)

  • Ad Blocking: Give it a try! Enable blocklists

  • Networking:

    • eth0 Tab: DHCP (SmartiePi IP is reserved in our router)

    • wlan0 Tab: I set static IP, gateways and DNS to 9.9.9.9 in another attempt to avoid 1.1.1.1. (see Struggles below)

  • WiFi client: No change

  • Authentication: Set Admin UC/PW

  • Change Theme: Default is fine

  • Data Usage: Nice!

  • System: Nice

Trials, Tribulations and SuitiePi Struggles

This part is sort of a mess. The original SuitiePi was handbuilt raspbian w/ hostapd and kodi (for entertainment). Major struggles included hostapd on arm6 (old pi) and hostapd getting along with kodi. The savior to all of this was RaspAP and simply dedicating the RPi 1B to WiFi AP duties ... a respectible role for the old Pi!

This is basically a historical log of our SuitiePi mods. It has morphed and evolved over the years, various versions and capabilities. Even failures may be of interest to others ... It is what it is! Problems marked in RED, my solutions highlighted in BLUE


April 2021 - Migrated this recipe from http://ventures.tpedersen.net/errata/raspberrypi/suitiepi

  • Will test the recipe with latest RaspAP at some point ... but current one works fine, no rush


February 2021 - Ended up downgrading SuitiePi hardware to RPI 1 Model B so I could dedicate the RPi 2 to a Kodi project.

  • Basically swapped the sd card and Wifi USB dongle to older hardware, plugged in via 2.1amp USB charger and it came right up, runs reasonably well. iPhone shows speeds of round 20Mbps

  • Overclocked the Pi 1, just to give it a tad more juice.

    • via Raspi-Config/Performance set to:

Modest 800MHz ARM, 250MHz core, 400MHz SDRAM, 0 overvolt

It now runs between 45c and 50c. CPU shows 100% during heavy use (150% via RaspAP status page!). Should be good enough for my purposes - very limited use, no need for speed. ~20Mbps up/down via 802.11n 2.4GHz

December 2020 - Needed an itsy, bitsy browser on the basement TV. Will see if Pi2 has enough horsepower to play exercise videos too ...

  • SuitiePi V2: All of above RaspAP stuff PLUS chromium kiosk from step by step @ https://die-antwort.eu/techblog/2017-12-setup-raspberry-pi-for-kiosk-mode/ (if that doesn't work: pimylifeup.com/raspberry-pi-kiosk/)

  • Notes as I go ... will incorporate changes into above recipe

    • Raspberry Pi OS Lite

      • Dowloaded 2020-12-02-raspios-buster-armhf-lite.zip

      • A few Raspi-Config changes, they rearranged some options

    • RaspAP

      • Installed 2.5.2 version, step by step above seemed fine

      • Still no internet access after install/config - details are below (Sept 2020 issue also)

        • Had to AGAIN modify /var/www/html/includes/defaults.php
          changed ...

'RASPI_ACCESS_CHECK_IP' => '1.1.1.1',

'RASPI_ACCESS_CHECK_DNS' => 'one.one.one.one',

to ...

'RASPI_ACCESS_CHECK_IP' => '9.9.9.9',

'RASPI_ACCESS_CHECK_DNS' => 'dns.quad9.net',

sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox

      • Install Web Browser

sudo apt-get install --no-install-recommends chromium-browser

      • Configure Openbox by editing /etc/xdg/openbox/autostart

# TPed was here - The following cut/pasted for kiosk pi#
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp
# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chro
chromium-browser --disable-infobars --kiosk 'http://ventures.tpedersen.net/errata/raspberrypi/<start page>'


September 2020 - Rebuild due to Micro SD failure

  • RaspAP Install recipe worked fine .... BUT no internet access?!? Due to a Change in RaspAP?!

    • https://github.com/billz/raspap-webgui/pull/620 added internet check

    • Default check was see if cloudflare dns server was alive - 1.1.1.1

    • Our ISP blocks 1.1.1.1, so pings fail and RaspAP would never marked internet up!

    • The Fix was to change 1.1.1.1 to something that works - I used quad9 (9.9.9.9)

      1. Found Access Check option in /var/www/html/includes/defaults.php
        changed ...

'RASPI_ACCESS_CHECK_IP' => '1.1.1.1',
'RASPI_ACCESS_CHECK_DNS' => 'one.one.one.one',
to ...
'RASPI_ACCESS_CHECK_IP' => '9.9.9.9',
'RASPI_ACCESS_CHECK_DNS' => 'dns.quad9.net',

June 2020 - Attempted/Gave up on RPiPlay! SuitiePi is back to RaspAP on old RPI v1 Model B. Used a $25 Roku to smarten old TV!

  • RPiPlay - Attempted to add screen Mirroring (Airplay) capabilities to SuitiePi. Guests could cast to TV in basement suite

    • Build executable using README.md Via SSH (remember to sudo!)

sudo apt-get update

sudo apt-get dist-upgrade

Install editor - no like nano.
sudo apt-get install joe
<reboot>

sudo apt-get install git
git clone https://github.com/FD-/RPiPlay.git
cd RPiPlay
sudo apt-get install cmake
sudo apt-get install libavahi-compat-libdnssd-dev
sudo apt-get install libssl-dev
mkdir build
cd build
cmake ..
make

    • Run/Test

      • Test using fully qualified executable
        /home/pi/RPiPlay/build/rpiplay -n AppleTV -a hdmi

      • Connect with iphone using Screen Sharing on pull-up control/gadget screen *not* airplay share icon! ... Works pretty well!

      • Argh! AppleTV wont play movies! Message box:
        Cannot Play Movie
        The Connected display is
        not authorized to play
        protected movies

May 2020 - Attempted Super SuitiePi using dietpi, hostapd and kodi for more entertainment! ... FAIL, remnants below


Software

  • Dietpi.com - My Favorite! Download latest RPI version (Donate!)

  • Etcher.io - Much easier way to flash OS images to SD

  • Hostapd (Wifi Access Point) provided in DietPi Optimized Software

  • TV/Entertainment services via Kodi option in DietPi Optimized Software

Step-by Step

  • Download latest DietPi and Etcher. Follow DietPi Quickstart Guide
    // used DietPi_RPi-ARMv6-Buster.7z (~110MB Download) //

  • Config DietPi using keyboard and monitor

  • Install editor - no like nano. apt-get install joe

  • Quick Kludge/Fix - Dietpi added network check that is a real pain ... attempts to ping 1.1.1.1, which appears to be blocked by our ISP (tds), stops updates and dietpi config/software in its tracks

    • Edit /boot/dietpi.txt - Code block looks like this:

# General connection and DNS testing

# - IP to ping when checking network connectivity. Default: 1.1.1.1 (Cloudflare DNS, should be very fast world-wide)

# TPed Mod - TDS blocks 1.1.1.1, I have to use similar - quad9.net

CONFIG_CHECK_CONNECTION_IP=9.9.9.9

# - Domain to ping when checking DNS resolver. Default: one.one.one.one (Cloudflare DNS domain, see above)

CONFIG_CHECK_DNS_DOMAIN=quad9.net

  • via Dietpi-Software

    • install following - all under Software Optimized

      • Media Systems - Kodi

      • Wifi Hotspot (hostapd)

      • System Stats/Management - RPi-Monitor (web interface system status

    • Install: Go >> Start installation for selected software

    • Dietpi-config

      • Hostapd via Network Adapters

        • SSID+password

        • Country

        • Channel (scan for best using Mac Wireless Diagnostics)

        • DON'T FORGET to APPLY (save changes and restart networking)

      • Normal dietpi tweaks

        • Audio -> onboard HDMI (rpi-bcm2835-auto)

        • Language/Regional -> US Local, Timezone & keyboard for me

        • Security Options -> change passwords & set hostname

        • Auto Start -> Kodi

  • Shutdown and move to final Subnet/Resting place

    • Switch to SSH access for rest of setup at this point

  • Manual Tweaks

    • Connected PanelPi (Rpi0) to Hostapd,

      • Edit /etc/dhcp/dhcpd.conf to pre-assign IP so I can find that little Pi ...

# TPed Add - Reserve IP for our PanelPi

host panelpi {
hardware Polish up ethernet xx:xx:xx:xx:xx:x;
fixed-address 192.168.xx.xx;
}

      • Added static route to upstream router and can now access Rpi0 via SuitiePi AP subnet

    • Had to edit /etc/hostapd/hostapd.conf to get hostapd_cli working CLI for hostapd status and such)

      • Added ctrl_interface and group - can't recall where I found this. ctrl_Interface is path to hostapd.pid, not sure what group is ... but it works!

# TPed Add - enable hostapd_cli client

ctrl_interface=/run/hostapd
ctrl_interface_group=0

    • Season RPi-Monitor display to taste - edit /etc/rpimonitor/data.conf

      • Uncomment wlan.conf line - we want to see wlan activity

      • Comment dhtll.conf line - some sort of temp sensor. Adds "Living Room" page - drove me nuts!

    • Good Time to Boot and check work so far

      • RPi-Monitor should work to both SuitePi and PanelPi

      • journalctl -u hostapd should also show PanelPi mac address authenticated & associated

      • hostapd_cli list_sta will also show active mac addresses

  • RPiPlay: Sing-a-Long @ https://github.com/FD-/RPiPlay

    • Looks like cc compile opportunity, install some development stuff via dietpi-software (software-additional)

      • Build-Essentials, Git-Client and UnRar

      • <reboot, of course!>

    • Building (as root)

git clone https://github.com/FD-/RPiPlay.git

apt-get install cmake
apt-get install libavahi-compat-libdnssd-dev
cd RPiPlay
mkdir build
cd build
cmake ..

CRAP! No ilclient in dietpi? This is nuts! Switching back to Raspbian for a while. Dietpi seems to be more trouble than its worth!


March 2020 - back at it. SuitiePi has been working quite well, some periodic failings (unable to connect), but overall pretty good. Added a static host (rpi0) to help me reach some hardwired sensors our home

  • Switched to RPi model 2, Kodi takes more power & SuitiePi is now integral part of Smart home (good or bad?!).

  • no more shairport-sync for now, we'll see what Kodi can do

  • Rpi-Monitor added

  • Connected PanelPi (Rpi0) to Hostapd,

    • Edit /etc/dhcp/dhcpd.conf to pre-assign IP so I can find that little Pi ...

host panelpi {

hardware ethernet xx:xx:xx:xx:xx:x;
fixed-address 192.168.xx.xx;
}

    • Added static route to upstream router and can now access Rpi0 via SuitiePi AP subnet

Now to figure out Kodi:

Lots of struggles w/ EDIMAX adapter on Model B Pi ... switching to PI 2 for shortrun

WHOOPS - PI2 is missing - used for MoviePI @ my parents (play fam movies from google drive with VCR-Like Remote!)

Switched to Pi 3 for


Ghadzooks! This is complicated! Combination of arm6 vs arm7 and EDIMAX adapter may be too much for dietpi. Makes me grumpy, I had this working on Pi 2 w/EDIMAX adapter - wasn't that hard!! I forgot to take image of sd card - ARG!!


Notes (so I can retrace my steps)

  • Attempting to install over dietpi REALLY want to use a Pi Model B here if I can

  • Configures and comes up fine

  • Kernel Panic when first client connects - fully connects, pass auth completes

  • Switching to Raspian Lite (buster) - to eliminate diet pi

  • Must be Arm6 - Raspian Lite's Kernel Panic's and dies too!

  • Back to DietPi on a RPI 3

  • <I'm sooo confused! this one is a pain!>


Step by Step

// Attempting on Mod B w/ edimax & 8g SD //

- Download DietPi (of course)

- DietPi install (.5 - 45mins)

- Change a couple of passwords

- upgrades itself

// Approx 15 mins //

Dietpi Software/Dietpi Config

- Config cleanup

--- Performance/Overclocking/Safe 900MHz (2over)

--- Advanced/Update firmware

--- Language/Locale/Timezone/Keyboard

--- Security/Hostname

--- Network - turned off IPV6 (for heck of it)

<reboot>

Dietpi Software

-- WiFi Hotspot (Hostapd)

-- Rpi-Monitor

-- Remember to Start Installation


Links

- https://willhaley.com/blog/raspberry-pi-hotspot-ew7811un-rtl8188cus/

- https://cdn-learn.adafruit.com/downloads/pdf/setting-up-a-raspberry-pi-as-a-wifi-access-point.pdf


Odd things to figure out - Dietpi v6.19.7


Raspberry Pi Model B hostapd dies - Kernel Panic


# journalctl -u hostapd

-- Logs begin at Thu 2016-11-03 12:16:43 CDT, end at Sat 2018-12-15 08:03:09 CST

. --

Dec 15 08:01:30 SuitiePi systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...

Dec 15 08:01:31 SuitiePi hostapd[965]: Starting advanced IEEE 802.11 management:hostapdIllegal instruction

Dec 15 08:01:31 SuitiePi hostapd[965]: failed!

Dec 15 08:01:31 SuitiePi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.


------------------------------------


Uninstalled hostapd and FINALLY got regular wifi working (adapter was chronically DISABLED) ... interesting wlan0 state ... both networks showing - hostap was ..42.1/24 and normal net 192.168.11. :

root@SuitiePi:~# ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

valid_lft forever preferred_lft forever

inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

link/ether b8:27:eb:63:0d:47 brd ff:ff:ff:ff:ff:ff

3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

link/ether 74:da:38:8b:2e:0b brd ff:ff:ff:ff:ff:ff

inet 192.168.42.1/24 brd 192.168.42.255 scope global wlan0

valid_lft forever preferred_lft forever

inet 192.168.11.64/24 brd 192.168.11.255 scope global wlan0

valid_lft forever preferred_lft forever

inet6 fe80::76da:38ff:fe8b:2e0b/64 scope link

valid_lft forever preferred_lft forever