I want to connect from an android phone to a RPI 3 over Wi-Fi direct.
I want to do it over Wi-Fi direct because the RPI will be a controller for one or more movable devices that will be used in buildings as well as out in the nature.
In buildings, it could just connect to the existing Wi-Fi, but in the nature there is no Wi-Fi. Therefore, the RPI would need to be its own AP, but then the phone controlling it could not be connected to the building's Wi-Fi at the same time. Also, it would get complicated with multiple RPIs, one would need to be the AP and the others would need to connect to it.
It would be cool if I just could power up the RPIs, withouth doing any configuration every time their setup changes, and connect to it regardless from where it's used.
So with Wi-FI direct being a requirement: How can I do this? Can someone provide me with an example (or a Link to an example)? Basically any hint that brings me closer to the target will help.
what i have so far
I've installed Arch Linux ARM on the PI using this guide:https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3
Then I've installed wpa_supplicant using "pacman -S wpa_supplicant"
Then I've created a small configuration for it under "/etc/wpa_supplicant/p2p.conf" that contains:
ctrl_interface=/var/run/wpa_supplicant
device_name=PI
update_config=1
then I've started wpa_supplicant using wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/p2p.conf
Then I've tested Wi-Fi direct using wpa_cli
and then p2p_find
which found my phone. So I assum driver-wise, everything's good.
I just need to figure out how to use wpa_supplicant to register a server-program running on my PI, and how find & connect to it from android.
Any ideas?