P2P/WiFi-Direct Support?

I’d love to start a P2P connection via balena, but there seem to be a couple missing pieces:

  1. wpa_supplicant introspection to make DBus exploration possible: https://github.com/balena-os/meta-balena/issues/214
  2. Enabling P2P in wpa_supplicant’s build.

P2P networks are nice for areas without a host AP and unless I’m missing something, there’s no way to use WiFi Direct w/o wpa_supplicant support.

Hi,

I will ask the OS team about the plans of getting this feature.

Regards!

@chachi Have you had a chance to look at Adhoc wifi network
for how to make an adhoc network?

Is there any particular reason you want to interact with wpa_supplicant directly?

@zubairlk Yes, I’ve used an ad-hoc network so far but it doesn’t meet my requirements. It’s not possible, to my knowledge, to have both an ad-hoc network and a regular AP Internet connection.

Hi @chachi, if you need to use hostapd or vanilla wpa_supplicant, then you need to unmanage the wifi interface from NetworkManager from a container and do the setup there.

With python-networkmanager you may do: import NetworkManager; NetworkManager.NetworkManager.GetDeviceByIpIface('wlan0').Managed = False.

Alternatively if you are using nmcli then you may do: nmcli dev set wlan0 managed no.

Then you may proceed with configuring wpa_supplicant accordingly. If you are using a multicontainer environment then you will need to make the container privileged and running in host networking mode.

Also you may possibly need driver/firmware support to use WiFi Direct.

1 Like

@majorz thanks for the tip. Is P2P enabled in the wpa_supplicant build of balenaOS by default?

As for drivers, I’m on the TX2. The Jetpack-installed for the TX2 system supports P2P connections, so I’d imagine the Balena version will, as well.

@chachi I probably should have clarified this a bit further. All the standard networking applications and tools should be working without any issues from a container, which includes wpa_supplicant. Depending on the base image you choose to run it from, the version installed will be different.

I am not sure whether the wpa_supplicant that is default for Debian includes P2P support for TX2 devices. There is some chance that you need to install or build the one that comes with Jetpack in a container, since I know some vendors are distributing a modified version of wpa_supplicant. But first please try the default one.

Also you may probably check a latest version of iwd, which is a project for Intel that targets to substitute wpa_supplicant. I would definitely recommend it.