How to write a driver for TL-WN722N wifi adapter in Arduino?

I want to run the TL-WN722N v2 wifi adapter that is built with RTL8188EUS if I am not wrong, directly with Arduino.

my meaning of directly with Arduino is that connect 5V and GND from Arduino to the USB female port and Rx and Tx from the USB port to the GPIO pins of Arduino. (e.g. Tx to pin A0 and Rx to pin 3~)

I tried to write data (logical 0 and 1) to the USB port and read data from it but no matter what I write on it, it always returns logical 0 to Arduino. And now I know that this is not a way to communicate from Arduino with the USB and also with the NIC

How can I send the data to it and receive data from it?

please help me to do that. send me useful links, pictures, comments, codes, or anything that can help me in this way.

I tried to find an open-source driver for it that translates it to Arduino code but could not find anything except this "GitHub - abhijeet2096/TL-WN722N-V2: Drivers for TP-LINK TL-WN722N version 2 .Clean ported for kernel 4.4, 4.8, 4.10 ,4.13 ,4.14 & 4.15 from source which was at 4.3" on GitHub that I did not get into because there was not any main function.

A USB port does not have Rx and Tx; it has D+ and D- which is not the same.

You will need an Arduino that can act as a USB host or an additional host shield. After that it might be possible to write the code for communication with the dongle and eventually for communication with other devices; the link that you provided can act as a guide but it seems to be for PCs with plenty of memory, something that most Arduinos don't have.

USB sniffers might be a useful tool to analyse the communication between dongle and PC.

And that's all that I know.

Port the linux kernel to Atmega328, then compile the driver. Easy.

thank you a lot. how can I build a USB sniffer? do you have any useful links for that?

thanks but I didn't get your mean. can you explain it more and if it is possible tell me an example? might be easy but a little bit confusing for me as a newbie in this topic.

Is there some specific reason you need to use the TL-WN722N instead of the more conventional methods of connection an arduino to WiFi?

thanks for that link, I will read it as soon as possible.

yes, it is a predefined project by my university and if I could not do that, I get a low grade.

I think that wireshark can do it. You don't have to build it; alternatively search the web.

That is a very advanced project, hopefully you have a few months to complete it.

I must build something for it and that is a sniffer that is in the middle of pc and the wifi adapter with Arduino

I have 4 months to do this project.

Forget about arduino, use wireshark and a linux computer.
https://wiki.wireshark.org/CaptureSetup/USB

Just to be clear, the project is to interface the TL-WN722N to an arduino, and not to connect an arduino to a TL-WN722N through WiFi (with the TL-WN722N acting as an access point).

Does the university have access to the manufacturer's data for the RTL8188EUS? That tends to be extremely proprietary with wifi devices, but they may have allowed the university to have a copy for academic use.

You might be better off starting with the open-source drivers for that chip instead of trying to reverse-engineer the interface from the USB communication. At least that way someone else has done the really difficult part of decoding the actual command structure for the chip.

I can't this is a project by my university and it must use an Arduino or I must build custom hardware with a micro-controller for it

yes, exactly.

I live in Iran and I do not think the Realtek company gives any information to my university
and also my teacher didn't tell me anything about it.

I tried to find a open-source driver for the product (tl-wn722n) but could not to find anything useful.
can you help me in this way please?

I think that you're missing the point a little. You use wireshark (running on a PC) to analyse what is going on; once you know what is happening you can implement that. Combine the information that you collect (source code in the opening post as well as wireshark results) to design and create your Arduino implementation.

Exploring the path of using a Raspberry Pi might possibly make your life easier; I don't consider it to be much bigger than an Arduino.