You can chat about native SDK questions and issues here.

User avatar
By Fly.Right
#89146 First post to this site. Please let me know if this is not the proper place for this question. Thanks

Many hours of successful ESP8266 interface coding and testing however...
I cannot get the server (which is running on my W10 PC) to "accept" the connection or it does accept but the connection closes within about 1.5 seconds.
I am not using this with an Arduino. Rather a PIC MCU and via RX/TX at 9600,8,1,N.

extraneous cr and lf removed...
AT+GMR
AT version:1.3.0.0(Jul 14 2016 18:54:01)
SDK version:2.0.0(5a875ba)
Farylink Technology Co., Ltd. v1.0.0.2
May 11 2017 22:23:58

ATE1
AT+CWMODE_CUR=1
AT+CIPMUX=0
AT+CWJAP_CUR="##########","############"
the WiFi connects:
WIFI DISCONNECT
WIFI CONNECTED
WIFI GOT IP

the server is not running:
AT+CIPSTART="TCP","xxx.xxx.x.xxx",1000
ERROR
CLOSED

execute the above commands with the server running:
AT+CIPSTART="TCP","xxx.xxx.x.xxx",1000
CONNECT
about 1.5 seconds elapses
OK
CLOSED
So it would appear that the connection is made but rejected.

I wrote a python program that successfully opens a socket, transmits the data to the server and receives the server's reply.
s = socket.socket()
s.connect((HOST,HOST_PORT))
s.sendall(scan)
data = s.recv(4096)

Interestingly if you wait more than about 1.5 seconds after the send then the connection will close.
The python program is not accessing the server via WiFi and the python program and the server app are both executing from the same W10 PC.

I can open a UDP to the server IP and port with no problems and perform sends and receives but the server does not respond. The port stays open until I close it. I assume that it requires a TCP.

I am not a network specialist nor a Stack Programmer. I am about to try a WizNet WiFi module to see if there is something it will handle that the ESP8266 does not.

I can imagine some possibilities:
1. Outdated ESP8266 version (purchased April 2020)
2. WiFi security WPA2 PSK (WiFi router being used)
3. Another AT command missing prior to AT+CIPSTART
4. Don't know enough about TCP/IP
5. WiFi connection requires something that the Ethernet connection does not
6. The python library is handling some portion of the connection that the ESP8266 or I am not
7. Move #4 up to #1.
Your assistance is welcomed and appreciated.