WiFi-Direct Device can't reconnect after first disconnect. Reconnect only works after restarting PC

Matthias Possenig 6 Reputation points
2022-07-29T09:04:16.533+00:00

I have a Qt Application that has an Integration of the C++/WinRT-Library so i can use WiFi-Direct (I used the Microsoft UWP WiFi-Direct sample for comparison). The goal is to connect the Application to my WiFi-Direct Device and establish a Socket Connection.

This all works fine. I can discover my device and connect to it. The Socket Connection is also no Problem. My Problem is that when i close the Application after my first successfull connection and start it again the connection always fails. I have tried to unpair my device and then pair again but that also doesn't work. The strange thing is that when i restart my PC and try again it works. But after the first disconnect i cannot establish a second connection.

Does anyone now if Windows stores WiFi-Direct Profiles that are deleted after a restart and where? Deleting the device from the Device-Manager didn't help. I also suspected the PnP-Manager to store a profile of my device or something like that but, when i delete the device from the Device-Manager the profile in the PnP-Manager also disappears. I think it could also be possible that the DHCP-Server that offers the IP-address is storing a profile or something similar but i didn't find anything in this regard.

Universal Windows Platform (UWP)
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,537 questions
Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,023 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Matthias Possenig 6 Reputation points
    2022-08-01T15:17:59.163+00:00

    Update to my problem!

    It seems that I have somehow fixed my issue but I'm not really sure, what really caused it. Today I made some adjustments to my Firmware without any big changes, mainly some code cleanup. After i flashed my new firmware I had no issues with connecting and reconnecting anymore. So it seems that the problem was caused by my Firmware and not the UWP-Sample.

    The only small problem that stays is that the connection build up between the pc and my device is very slow. The pairing and connection process always takes about 30 seconds or more. But i guess I can optimize that.

    1 person found this answer helpful.

  2. kolboi 0 Reputation points
    2023-03-10T19:44:24.3466667+00:00

    @Matthias Possenig Hello, I'm working on QT windows application, how to scan, connect and transfer data to a device supporting wifi direct. I saw the reference is pretty poor. As your experience, could you give me some guideline or docs for that, thank you in advance.

    0 comments No comments