Portable Volumio 2: Network Configuration

I would like to be able to use Volumio 2 in more than one place. At the moment it is happy to use wlan0 if it can’t find a wired ethernet connection, so that’s fine within range of my home LAN. Now, say I take my RPi out into my car, boot it up and it finds it can’t make a network connection. What I would like to then do is run ‘hostapd’ and ‘dnsmasq’ so that acts as an AP, and I can still control it with my phone.

The scripts in /etc/network are a bit convoluted for me, but this seems to be where the decision about whether a wired or a wlan0 connections is made. How do I get the RPi to realise that it can’t find a network connection, and thus call a script to start hostapd/dnsmasq? I could run a script from rc.local to check if an IP address has been assigned (assuming that I’m using dhcp), and if not then start an AP, but this seems a bit clumsy when the decision making has already occurred previously.

Any thoughts?

Edit: after a night’s sleep thoughts, I have decided that I was being way too complicated. Instead of the RPi acting as an AP, I will simply tether it to my phone acting as a hotspot. Now I just need to work out of to get the RPi to try more than one wireless network (home LAN and phone hotspot).

The complete setup would indeed be very complicated.
You could try to use the same SSID and password it might just work. If it doesn’t try and see if you can use the same IP range from your hotspot as you have in you LAN.

I have done something like this - configure a phone hotspot settings or a portable wifi hotspot device with the same SSID and WPA password as my home network. The devices (Volumio) looking for a connection find the hotspot and connect.

I read in the documentation the hotspot will turn on if Volumio cannot find the configured network. If so, you don’t have to do anything - the Pi should come up on when it can’t find your home network. I suspect the hotspot needs to be left “on” and have not tried this (yet) so there may be other gotchas (like what happens if you start in-range and then drive off). You could keep a cheap phone (one off contract and replaced) or tablet in car configured to connect to the Volumio player.