BaReinhard's Tech Blog

A blog of various technologies, largely based around the Raspberry Pi.

Follow me on GitHub Follow me on Instagram

Setup Car Wifi w/ Raspberry Pi 3 AP (No Internet, iOS only)

Happy Friday Everyone, here we are back again talking about the Raspberry Pi. Today I will be walking you through setting up an AP with the Raspberry Pi 3. Please note the following will only work on the Raspberry Pi 3

What will we need?

  • Raspberry Pi 3
  • microSD
  • keyboard, monitor for inital setup atleast to connect to wifi, or use ethernet and ssh in

What are we planning to do?

We are planning to setup the Raspberry Pi as an Access point without any internet connection. It will be a wifi network with no internet access.

What the hell!? Why would we want that?

Simply put, so that we can stream audio from our iOS device to our Raspberry Pi in reliable manner with better quality than A2DP Bluetooth. Even though we are “connected” to the network, it will not show at the top left of our device as it normally does. However, the Raspberry Pi still gives your iOS device an IP address and you are able to stream music via AirPlay.

The Computer Stuff

First setup your interfaces file:

sudo nano /etc/network/interfaces

Within the file setup a static ip and comment out the existing iface lines

auto lo
iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet static
    address 10.0.0.1
    netmask 255.255.255.0
sudo apt-get update
sudo apt-get install hostapd
sudo nano ~/hostapd-test.conf

add the following lines:

#change wlan0 to your wireless device
interface=wlan0
driver=nl80211
ssid=test
channel=1

Then test to ensure hostapd works:

sudo hostapd ~/hostapd-test.conf

Please be sure to edit your /etc/dhcpcd.conf file and add the following to the bottom:

denyinterfaces wlan0

Now that everything is working create the actual hostapd conf file:

sudo nano /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=BaReinhards_G8_WiFi
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=4doorgto
wpa_key_mgmt=WPA-PSK
#wpa_pairwise=TKIP      # You better do not use this weak encryption (only used by old client devic$
rsn_pairwise=CCMP
ieee80211n=1          # 802.11n support
wmm_enabled=1         # QoS support
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

Then change default for hostapd and add the daemon config file path after DAEMON_CONF=””

sudo nano /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"

sudo nano /etc/init.d/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"

Now we need to setup the dhcp server

sudo apt-get install isc-dhcp-server
sudo nano /etc/dhcp/dhcpd.conf

Add the following lines into your file:

ddns-update-style none;
ignore client-updates;
authoritative;
option local-wpad code 252 = text;
 
subnet
10.0.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers
10.0.0.1;
# --- Netmask
option subnet-mask
255.255.255.0;
# --- Broadcast Address
option broadcast-address
10.0.0.255;
# --- Domain name servers, tells the clients which DNS servers to use.
option domain-name-servers
10.0.0.1, 8.8.8.8, 8.8.4.4;
option time-offset
0;
range 10.0.0.3 10.0.0.13;
default-lease-time 1209600;
max-lease-time 1814400;
}

Then

sudo nano /etc/defaul/isc-dhcp-server

INTERFACES="wlan0"

Then of course install shairport-sync and enable it through systemctl Setup Sound Cards