esp-idf icon indicating copy to clipboard operation
esp-idf copied to clipboard

Support for WiFi direct (P2P) (IDFGH-4715)

Open DavidJRobertson opened this issue 4 years ago • 49 comments

There have been mentions a few years ago that wifi direct was on the to-do list, but it is still not implemented.

This is surprising because there are very clear reasons why developers would want to use wifi direct in an IOT project. Specifically, it would greatly improve the user experience of using wifi to connect to the ESP32 device from an Android phone without the need for network infrastructure or provisioning.

Right now the alternative is to either use bluetooth (which is low-bandwidth and has licensing/certification cost issues) or to use soft AP on the ESP32, which provides poor user experience due to the requirement for the smartphone wifi connection to be manually switched, interrupting the phone's normal network connection. At least on some Android devices, it is supported to connect to a normal AP and a wifi direct group at the same time.

I note that the upstream wpa_supplicant project includes support for wifi direct/p2p so I presume this could be made to work on the ESP32.

DavidJRobertson avatar Feb 10 '21 05:02 DavidJRobertson

Permit me to agree with what is said in this feature request. If application is mobile and range not short enough for bluetooth, the only way to share data with a device is creating soft AP. That means users will loose internet connectivity on their devices which is not acceptable... Unless there are other ways I don't know about. Please consider implementing this.

tanguy-penfen avatar Feb 12 '21 10:02 tanguy-penfen

@DavidJRobertson - Yes, this is on our TODO list, but it may not be available any time soon since our focus is currently on the protocols that are more important from security perspective (WPA3, PMF, DPP) or that cover more IoT/wireless scenarios (FTM, 11kv, 11r etc). However, depending on the demand we may consider to increase the priority of implementing this feature as well.

sagb2015 avatar Feb 28 '21 16:02 sagb2015

We have also been waiting for this feature for many years and it would bring a huge improvement in the experience already described very well by @DavidJRobertson.

We cannot imagine that this demand is not important for everyone who develops for IoT.

kaedros avatar May 25 '21 17:05 kaedros

This feature can help a lot for IoT usage. The network configuration using a smartphone app would be very simple as the network do not need to change. Changing networks on Android or iOS is painful. There are many factors that implies in the network refuses to change. Using wifi direct "kills" all that factors.

wagner-rebello avatar Jun 17 '21 12:06 wagner-rebello

@DavidJRobertson and @sagb2015 We are also on standby for this feature for a log time!

mauriciofarina avatar Jun 17 '21 14:06 mauriciofarina

It would be great

itamardv avatar Jun 21 '21 16:06 itamardv

Need this too. Now we are looking for another chip for our project but the ESP32 would be perfect if it only supported WiFi Direct / P2P

jensolsson avatar Jun 28 '21 21:06 jensolsson

I agree that it's not extremely important, but I support inclusion.

TeschRenan avatar Jul 12 '21 12:07 TeschRenan

Need this too. Now we are looking for another chip for our project but the ESP32 would be perfect if it only supported WiFi Direct / P2P

What is the another chip are you talking about? ...I would be happy to use an alternative if if provides both BT and wifi with wifi-direct.

beYunfei avatar Jul 23 '21 08:07 beYunfei

I too am looking for this feature. Hopefully, this feature can be impelmented soon.

wuujiann avatar Jul 30 '21 15:07 wuujiann

This feature would be decisive in our IoT products! As @wagner-rebello pointed out, developing an App that can connect via Wifi to an device without Wifi-Direct is really hard, and even if you manage to do that, the end result is not user friendly as @DavidJRobertson said. Looking forward to see this implemented in ESP-IDF!

palpopite avatar Nov 05 '21 23:11 palpopite

Any timeline for Wifi Direct for ESP32? We are considering using ESP32 for a new product but inability to provide WIFI direct is a big hinderance!

writetosumeet avatar Dec 05 '21 05:12 writetosumeet

We'd need WiFi Direct too. The lack of WiFi Direct support forces us to use another chip with the next version of our product.

maleiter avatar Dec 16 '21 14:12 maleiter

Does anyone try to use DPP, which is more official for IOT device provisioning. There are already some Android phones support this feature, and I think new Android phones is likely to support this feature, just like Android support WPS and P2P.

jack0c avatar Jan 06 '22 04:01 jack0c

Does anyone try to use DPP, which is more official for IOT device provisioning. There are already some Android phones support this feature, and I think new Android phones is likely to support this feature, just like Android support WPS and P2P.

As iOS don't support this technology and the same for old android phones (the majority in Brazil where our product is sold) i can't even try to lose time testing this.

ZantsuRocks avatar Jan 07 '22 18:01 ZantsuRocks

Does anyone try to use DPP, which is more official for IOT device provisioning. There are already some Android phones support this feature, and I think new Android phones is likely to support this feature, just like Android support WPS and P2P.

As iOS don't support this technology and the same for old android phones (the majority in Brazil where our product is sold) i can't even try to lose time testing this.

Yeah, nice thing about WiFi direct is that it is backwards compatible with WiFi devices that don't support it 'directly' (just appears as access point, so much the same as existing soft-AP provisioning approaches).

DavidJRobertson avatar Jan 07 '22 22:01 DavidJRobertson

Hi, are there any updates regarding WiFi Direct support for ESP32 ? Is there a way to maybe adapt ESP-NOW to allow for communication with Wifi-Direct enabled devices other than ESP32's (i.e. ESP32 to Android mobile device). This would be a game changer for us, otherwise we will have to look at other MCU options supporting this feature

adamoskaranikas avatar Mar 03 '22 17:03 adamoskaranikas

+1 on this -- current soft-AP implementation with Android is highly undesirable. The ability to directly send a video stream to a mobile device on the ESP32 platform would be transformational for our product.

benjamin-shapiro avatar Mar 12 '22 04:03 benjamin-shapiro

Hope this gets added ASAP. I agree that it's not more important than security, but platform-wise I think it would help users and developers quite a lot.

ArnyminerZ avatar Apr 06 '22 11:04 ArnyminerZ

Does anyone try to use DPP, which is more official for IOT device provisioning. There are already some Android phones support this feature, and I think new Android phones is likely to support this feature, just like Android support WPS and P2P.

@jack0c Just want to clarify that to use DPP the Access Point needs to support WPA3, right? That is a problem because may users are still using access point without WPA3 support.

AxelLin avatar Apr 19 '22 07:04 AxelLin

@DavidJRobertson - Yes, this is on our TODO list, but it may not be available any time soon since our focus is currently on the protocols that are more important from security perspective (WPA3, PMF, DPP) or that cover more IoT/wireless scenarios (FTM, 11kv, 11r etc). However, depending on the demand we may consider to increase the priority of implementing this feature as well.

@sagb2015 It has been a year since your reply. Is there any update for WiFi direct? (Many users are asking this feature). Can we expect v5.0 to include wifi direct support?

AxelLin avatar Apr 19 '22 07:04 AxelLin

Any news on the WIFI-Direct?

romatetemadze avatar May 03 '22 19:05 romatetemadze

Hi All, No we do not have support for WiFi-Direct yet, neither we are considering it for IDF 5.0. However, given the demand we would like to evaluate which chips you would like this features to be on. Given the memory size implication we may target limited subset of the features. WiFi-Direct is a very big feature to support.

sagb2015 avatar May 06 '22 07:05 sagb2015

@sagb2015 Do you have a rough estimated number of the memory that will be taken by WiFi-Direct?

AxelLin avatar May 06 '22 07:05 AxelLin

@sagb2015 any of the esp chips would work for us.

Kind regards Jens

jensolsson avatar May 06 '22 08:05 jensolsson

@sagb2015 I started playing with WiFi Direct a while ago, the goal was to make the ESP32 appear as a wifi direct device on an Android phone so I hand crafted a vendor IE with P2P info and used esp_wifi_set_vendor_ie to enable it. I finally got it to work so my esp32 device would show up under WiFi Direct in my Android phone. But it was of course not possible to connect to it yet.

I think the next steps would be to enable WPS and do some kind of p2p handshake in order to determine which of the devices will be master. But as it is possible to set a hint on Android to force it to be either master or not, i do not really know if this handshake is necessary or if it would just work if WPS would be enabled?

Is it really that complicated to get a basic WiFi Direct up and running?

Kind regards Jens

jensolsson avatar May 06 '22 22:05 jensolsson

This would be very valuable. As it stands now, the only implemented and broadly used peer to-peer connectivity is BLE with all its complexities. WiFi Direct would enable not only peer-to-peer communication with normal PC:s, and possibly with some other MCU:s and devices.

I really like ESP-NOW, but it is currently only possible to run on espressif hardware and it seems as if it requires driver-level changes on PC:s which just won't happen on a broader scale. Especially when WiFi Direct exists.

I think that it would be in Espressifs interests to open up this avenue of communication, there are so many use cases where you don't want to have to depend on some wonky WiFi router, hassle with passwords and expose yourself to the very well-developed WiFi hacking world to do some communication.

(And as BLE is implemented, the cat is sort of out of the vendor-lock-in bag anyway. )

nicklasb avatar Apr 29 '23 07:04 nicklasb

+1 Up! Great Feature request! Would be really useful

andresbrocco avatar Apr 29 '23 19:04 andresbrocco

+1

Lucas-Heitele avatar May 27 '23 00:05 Lucas-Heitele

Would love to have Wifi Direct on an ESP32. Would have been a game-changer for my current project. Still might be for the future of the project. Right now we are having to do a full Linux Single-board computer to get a worthwhile Wifi Direct.

johnnyb avatar Jun 19 '23 14:06 johnnyb