So… I’m going to start my ramblings by talking a bit about my trek through configuring a damn Raspberry Pi to work the way I wanted to. Specifically, I wanted to be able to SSH into the damn thing whenever I may so desire, regardless of what device I have with me or what networks I create…
Note: throughout this post I’ll be considering a complete lack of peripherals: keyboard, mouse, screen, etc. Anything other than the SD card and a WiFi dongle.
That means making a hotspot out of the Pi itself
Fortunately, I had one of the few adapters known to be able to host a network, so I started playing around… from around 00:00 in the night to about 6am. It wasn’t working right.
In the end, I now have a functional default behavior on the Pi: create a password-protected APN with
and 1
hostapd
to which I can connect, and configure the 1
udhcpd
for any existing networks.1
wpa_supplicant
This way, whenever I’m going somewhere new, I can just get the Pi out, connect to it with WiFi, configure a network, and then go online with both my laptop and Pi at the same time. It’s a very good backup and boot for working with a Pi anywhere without keyboard and mouse and a screen and whatnot.
I’ll update in the morning with a link to the guide I followed.
Some tips I can give to people…
-
If you’re configuring a static IP to use with
and1
hostapd
do NOT allow hot swap for the interface (found at1
udhcpd
). It will mess things up, especially at boot.1
/etc/network/interfaces
-
Do NOT attempt to do anything crazy, or confuse ad-hoc networks with APNs, routers, and so forth. The guide that I followed was meant to pipe an ethernet connection into a wifi one, but for the most part, excepting the
routing, everything was the same. All I needed was the networks. I have found, however, guides (reached via1
iptables
type google queries) that teach you how to create a local, rasp-only ad-hoc network. In simpler terms, a virtual network, a simulation, and nothing more since it cannot reach any other device than the Pi, through any interface whatsoever. Which is fine. It is an ad-hoc network, and it might be useful in some cases. But it isn’t what I wanted.1
raspberry pi create wifi ad-hoc network
-
Create some of your own boot scripts so that you may switch modes whenver you want. For example, I had something like:
to use to stop broadcasting its own network, and start looking for configured ones (be a consumer). Normally, if you try to run this through ssh, you might fail due to the connection being broken before setting the interfaces, for example. A simple fix is to use screen to deal with it, like so: 1
screen -bm bash other.sh
Well, I’ll update this in the morning with more juicy bits.