Networking
Netwokring here is about how components establish contact with each other.
During Development
Requirements here are to be able to push code and test it easily.
- no plugging/unplugging required
- everything dynamic and automated. I'm not very good at keeping track of... well, anything.
Luckily, the raspberry pi zero has a wifi interface, so both shrimp, station, and my dev machine are on the same home
network. mDNS allows everyone to have a .local
hostname: shrimp.local
, shrimpstation.local
, and I can open the
station's webpage from my local web browser. Pure joy.
In Prod The Wild
This is where it gets more complicated. No home network to link everything. Here's how it's going to work:
Phone to Station
The station opens up a wireless access point (AP) for the phone to connect to. In order to make this possible while still being able to connect to the station from my workstation, it needs to still be a client to the home network, so it will be an AP from a virtual interface. Then it also need to connect to the shrimp with the ethernet connection. Summary:
- phone to:
- station: wifi client over station's access point
- station to:
- phone: wifi AP on interface uap0, the virtual wireless iface
- workstation: wifi client
AP+client setup
Starting point on raspberrypi forums (link).
Some more information on stack exchange(link/ backup)
mDNS Setup
mDNS needs to advertise the station both on the home network and its own AP network. By default it doesn't. Here's the avahi-daemon.conf doc.
Alternative: the Shrimp Deck
Phone / station wouldn't be a problem if the station had a screen.
A computer with a screen...
with a game controller...
I have a Steam Deck. This is a great use case for it!
Let's keep things simple and hooked to the home network, and worst case scenario, I can run both the station and it's web client on the deck while I'm out, so that there isn't even a need to try out a game engine... although I couldn't help but start comparing features.