2

What I would like to accomplish One is a dedicated pair of RPi's using Wi-Fi Direct (p2p), one GO (group owner) and the other its client. The GO is not to be an access point, as neither RPi needs to connect elsewhere; they only talk to each other.

I have read through these questions and answers: Setting up Wifi direct (wifi p2p) and DHCP server, Howto migrate from networking to systemd-networkd with dynamic failover, and Configure Rpi as router - error when starting network and DHCP interfaces and many other posts here and elsewhere. But my lack of in-depth networking knowledge and skills is a problem.

Current state for both RPi: fresh Buster install using with sudo bash -c 'apt update && apt full-upgrade && reboot' as suggested in Setting up Wifi direct (wifi p2p) and DHCP server. However, the script that's laid-out is for communication between an RPi and SmartPhone, rather than a second RPi - which is where my knowledge deficit takes over.

Goal: eth0 remains accessible for both devices on my local network (192.168.1.024-IP is static or DHCP assignment), with the wireless connection on a separate network (e.g. 192.168.4.1 & 192.168.4.2). I have read elsewhere that it is possible for the RPi to have eth0 and wlan0 on separate networks.

I understand that the GO needs to be a DHCP server for its wlan, and that the client will be assigned its wireless IP by the GO. Further, I believe the GO also needs to manage the routes for that wireless network.

For now, the two devices sit next to each other (for convenience). With wpa_cli and wpa_gui, I have run through numerous configurations without achieving my goal. I have seen numerous messages between the devices indicating they "see" each other, but have not been able to get them to successfully ping each other. So, suggestions for setting-up such a paired system would be greatly appreciated and would likely contribute to getting a bit more sleep...

Thanks in advance!

Edit - Adding contents of wpa_supplicant-wlan0.config and /etc/system/network configuration files.

p2p GO: wpa_supplicant-wlan0.conf:

ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

eapol_version=1

device_name=DIRECT-RPi3-NanCam device_type=1-0050F204-1 p2p_go_intent=15 p2p_go_ht40=1

network={ ssid="DIRECT-CA" psk="12345670" key_mgmt=WPA-PSK proto=RSN WPA }

/etc/systemd/network files: 04-wired.network: (Note: Works as expected)

[Match]
Name=e*

[Network] #Option using a DHCP server DHCP=yes

#Option using link-local ip addresses #LinkLocalAddressing=yes #MulticastDNS=yes

Option use static ip address (example, use your settings)

#Address=192.168.1.111/24 #Gateway=192.168.1.1 #DNS=192.168.1.1

08-wifi.network (note: no ip address assigned)

[Match]
Name=wl*
[Network]
#to use static IP (with your settings) toggle commenting the next 8 lines.
Address=192.168.4.61/24
DNS=192.168.4.1
[Route]
Gateway=192.168.4.1
Metric=20
#DHCP=yes
#[DHCP]
#RouteMetric=20

12-p2p-wlan0.network

[Match]
Name=p2p-*
[Network]
Address=192.168.4.1/24
DHCPServer=yes

p2p CL:

wpa_supplicant-wlan0.conf:

ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
eapol_version=1

device_name=DIRECT-RPi3-NanDisp device_type=1-0050F204-1 p2p_go_intent=15 p2p_go_ht40=1

network={ ssid="DIRECT-CA" psk="12345670" key_mgmt=WPA-PSK proto=RSN WPA }

/etc/systemd/network files: 04-wired.network: (Note: Works as expected)

[Match]
Name=e*

[Network] #Option using a DHCP server DHCP=yes

#Option using link-local ip addresses #LinkLocalAddressing=yes #MulticastDNS=yes

#Option use static ip address (example, use your settings) #Address=192.168.1.111/24 #Gateway=192.168.1.1 #DNS=192.168.1.1

08-wifi.network (note: no ip address assigned)

[Match]
Name=wl*
[Network]
#to use static IP (with your settings) toggle commenting the next 8 lines.
#Address=192.168.50.61/24
DNS=
[Route]
Gateway=192.168.4.1
DHCP=yes
[DHCP]
RouteMetric=20

12-p2p-wlan0.network

[Match]
Name=p2p-*

[Network] DHCP=yes

[DHCP] RouteMetric=20

Once again, thanks for helping.

NurseBob
  • 41
  • 1
  • 5

1 Answers1

2

Solved the connection issues with both Stretch & Buster. With Stretch reconfigured with systemd-networkd as described in Setting up Wifi direct (wifi p2p) and DHCP server. To connect an RPi client instead of the Android, I used a matching wpa_supplicant-wlan0.conf file and the command sequence followed in this TI reference: https://processors.wiki.ti.com/index.php/WiFi_Direct_Configuration_Scripts#Connect_in_Pin_.28PIN_Number.29_where_EVM_.231_is_defined_as_the_group_owner. Further, the client needs an entry in the /etc/systemd/network folder for it to receive a DHCP assigned address from the group owner.

My thanks to @Ingo for the networking pointers.

Finally, I was able to get an out-of-the-box Buster implentation working without altering the networking, though I had to do a manual ip assignment on the client to match the created address on the group owners p2p-wlan0-0 ip. I'll update this post when I have the final configuration determined.

NurseBob
  • 41
  • 1
  • 5