using esp32bbetween two laptop one side wifi other side usb to data transfer

Hi.my code have some problem.
I need help if possible.
This image shows what I am trying to do.

Arduinoproject.ino.txt (953 Bytes)

What problems are you having ?

Please post your code instead of attaching it

Please follow the advice on posting code given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

You are missing a } before void setup()

If you press CTRL+T, this will auto format the code, and you can see the indents of the functions.

#include “WiFi.h” #include “WiFiClient.h” #include “WiFiAP.h” const char *SSID=""; const char *password=""; WiFiServer server(9600); void ConnectToWiFi() { WiFi.mode(WIFI_STA); WiFi.begin(SSID,Password); Serial.print(“conneting to WiFi …”); Serial.println(SSID); unit8_t i=0; while (WiFi.status()!=WL_CONNECTED) { Serial.print(’.’); delay(500); if((++i%16)==0) { Serial.println(F(“still trying to connect”)); } } Serial.println(F(“Connected.My IP address is:”)); Serial.println(F(WiFi.LocalIP()); } void setup() { server.begin(); Serial.begin(9600); ConnectToWiFi(); } void loop() { WiFiClient client=server.available(); if(client) { Serial.println(“New Client…”); while(client.connected()) { if (client.available()) { char c=client.read(); Serial.write(c); } } if (Serial.available()>0) { Serial.write(“abc”); incomingByte==Serial.read(); Serial.print(“I received:”); Serial.print(incomingByte,DEC); } } }

Does your PC not do Carriage Returns ?

Please follow the advice on posting code given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

If the code exceeds the 9000 character inline limit then attach it to a post

majidazad:
Hi.my code have some problem.
I need help if possible.
This image shows what I am trying to do.

An easy way to do this is to use ESPNOW and not to use WiFi

See Getting Started with ESP-NOW (ESP32 with Arduino IDE) | Random Nerd Tutorials

Ok.That was intersting.but I have one esp32 that is connected to laptop with a usb and another laptop with WiFi.for this case how can i use espNOW?

Does the second one have to be connected to WiFi ?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.