2020-08-05 01:43 AM
Please find the goals and the issues below
Issue - I am able to this for 3 connections but for the fourth one, the P? command response doesn’t contain the ip address of client even if it is connected
Issue : I can reconnect the client for three times but for the fourth time, again the P? command response doesn’t contain the ip address of client even if it is connected
Please find the details below:
PK= 1,3000\r
P0=<Socket Number>\r
P1=0\r
P2=<Port Number>\r
P5=1\r
P0 = <Socket Number>\r
P?\r
I then parse the output of the P? command to get the client IP. If I receive a valid IP instead of 0.0.0.0, I start sending/receiving data
As mentioned in the es-wifi document, we can open upto 4 connections, so I start 4 servers using the above mentioned commands for P0 = 0, P0 = 1, P0=2, P0=3. When I check for a client using commands in B, I get the client IP for only the first three servers and not for the fourth even though a client is connected using Hercules to the fourth server ( It shows connected in Hercules)
I try to do the following
1) Start the server
2) Look for a client. When the P? command response has the Client IP, go to step 3
3) Send data
4) Disconnect the client and stop the server
I can repeat these steps three times, but when I restart the server for the fourth time, I receive the client IP address in P? command after the client is connected but send command fails. The send always fails in the fourth restart
Please let me know the reason of this issue, if it’s a limitation for multipe start server commands or there is any mistake in the approach
Also, please let me know if there is an alternate way to achieve the goals mentioned.