How to connect raspberry pi 2 to wifi network absolutely headless

Hello guys and happy holidays!!!

I took my raspberry pi with me on vacation and have struggled for the last hour to try to connect it to my friends wifi network. I only have a wifi adapter attached to it and the sd card of course.
A lot of answers point to connect to the pi via ssh but I’m unable to do so since I’m not connected to the network yet.

Is there a way to modify the wifi settings from the sd card in the config file or the preseed file? When I insert the sd card into my macbook the os is not mounted so I can’t access the etc/ folder. Please help.

AFAIK the only quick and dirty solution (if you don’t have access to the ext4 filesystem) to do this is via the installer and configuring your wifi settings there. Which would mean you have to do a clean install at would lose what you might have on the SD card

You’re a bit stuck really. By headless I assume you mean that not only do you not have access to a USB keyboard or input device, you also can’t connect it to a screen of any sort ? (If so what are you trying to use it for exactly…)

Your best bet is to temporarily use an Ethernet cable to connect to the network (or even a loopback connection to a laptop if there is no wired network) so that you can log in with SSH, then you can use ‘connmanctl’ to configure the wireless connection. Once configured you can disconnect the Ethernet cable.

i think it will also auto-connect to an open network, so if you’re really in a pinch you could modify the network to be open. then log into your router to find the dynamic IP (or you could just use a portscanner like nmap, i guess) and then do your thing with ssh.

a wired connection is probably easiest though.

Sorry, but connman is not configured to connect to an open wifi network by default in OSMC.