Hi guys
I want to connect the ESP module to the router with a username and password and assign it an IP address and also specify a gateway for it to be connected to the internet at the same time.
Then I send a request to that IP by the mobile application and the module receives the data and returns the response to the application.
The first part is done, meaning the module was connected to the router and I specified the IP and gateway for it and sent a "post" request to the module using the application and the module received the sent data.
But I can't send a response to the application and return any data in response to the request.
do you wish to connect via the local network or the internet?
if the internet you will have to setup the router to 'port forward' requests from the internet to the particular IP address
Sending requests from the application to the module occurs on the internal network managed by the router in the IP range.
But the problem is not in sending the request, as I said: the post request is sent by the application to the module IP and the module receives it, but I cannot respond to the request sent by the application through the module.
See post #2
I don't understand what you mean.I am using code like below
Char* s="***";
Char* p="***";
Void setup(){
Wifi.begin(s,p);
Server.begin();
}
Void loop(){
Client=server.available();
While(!client.available())delay(1);
String r=client.readStringUntil('\r');
Serial.print(r);
}
Then the module connects to the router and Arduino gives me an IP for the module.
Then I send a "post" request to that IP through the application and send a data
Then Arduino receives and displays the sent data.
After this, I want to return some data in response to the application request, which doesn't work.
what exactly is the 'module'. I don't see any IP in the code.
You need to draw a diagram, as far as I can tell you have a router, module, Arduino, something you call 'me' and 'I' and an application I stopped after that, I have no idea what your setup is.
Diagram please. Is that all your code above? You are missing many error checks. Did you try the sample sketches for the same concept?
Post all the actual code -- properly indented/formatted, secrets redacted. If it's receiving the request, then the "pipe" is working, and printing through the client will send data back a response. It's likely some detail(s) that are wrong.
You can also try something simpler than your application and send the POST with curl to see what, if anything, is returned.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.