AT+CIPSEND gives error

mayurimk
Posts: 1
Joined: Tue Jun 20, 2017 1:19 am

AT+CIPSEND gives error

Postby mayurimk » Tue Jun 20, 2017 1:37 am

Code: Select all

AT+CWMODE?
+CWMODE:3

OK
AT+CWJAP_CUR="KULKARNI","rathana47"
WIFI CONNECTED
WIFI GOT IP

OK
AT+CIFSR
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"5e:cf:7f:36:d1:a1"
+CIFSR:STAIP,"192.168.1.9"
+CIFSR:STAMAC,"5c:cf:7f:36:d1:a1"

OK AT+CIPMUX=1

OK
AT+CIPSERVER=1,80

OK
0,CONNECT

+IPD,0,383:GET / HTTP/1.1
Host: 192.168.1.9
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,hi;q=0.6

1,CONNECT
2,CONNECT
1,CLOSED
2,CLOSED
AT+CIPSEND=0,5

OK

busy s...

Recv 5 bytes

SEND OK
AT+CIPCLOSE=0
0,CLOSED

OK
0,CONNECT

+IPD,0,348:GET /favicon.ico HTTP/1.1
Host: 192.168.1.9
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Accept: image/webp,image/*,*/*;q=0.8
Referer: http://192.168.1.9/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,hi;q=0.6

1,CONNECT
2,CONNECT



+IPD,1,409:GET / HTTP/1.1
Host: 192.168.1.9
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 5.0.2; XT1068 Build/LXB22.46-28) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,hi;q=0.6

1,CLOSED
2,CLOSED
1,CONNECT

+IPD,1, 409:GET / HTTP/1.1
Host: 192.168.1.9
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,hi;q=0.6

0,CLOSED
AT+CIPSEND=0,6
[b]link is not valid[/b] 

ERROR
AT+CIPSERVER=1,80   

ERROR
AT+CIPCLOSE=0
UNLINK

ERROR
1,CLOSED

AT+CIPSERVER=1,80
no change

OK
AT+CIPSEND=0,6
link is not valid

ERROR
AT+CIPCLOSE=0
UNLINK

ERROR




this is what happened when i first started this but even after AT+RESTORE and AT+RST
same thing happens when i send AT+CIPSEND=0,5

why is it showing link is not valid?
is any good tutorial are there please send the link

AndreiC
Posts: 10
Joined: Sat May 27, 2017 7:04 am

Re: AT+CIPSEND gives error

Postby AndreiC » Wed Jun 21, 2017 4:24 am

I didn't look too closely, but my initial observation is that you have a bad protocol error in your code.

For instance:
1,CONNECT

+IPD,1, 409:GET / HTTP/1.1
Host: 192.168.1.9
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,hi;q=0.6

0,CLOSED
AT+CIPSEND=0,6
link is not valid


We see the 1,CONNECT followed by a IPD,1 request for a page. This is a connect on connection 1 followed by a request on connection 1. Then connection 0 gets closed for some reason, and then you do a CIPSEND on connection 0.

Your request came in on connection 1 but you are sending on connection 0. Connection 0 is closed.

Are you parsing out the connection numbers on the messages? Are you reading the messages coming back at all?

Andrei

Her Majesty
Posts: 349
Joined: Mon Oct 27, 2014 11:09 am

Re: AT+CIPSEND gives error

Postby Her Majesty » Wed Jun 28, 2017 5:00 pm

"0,CLOSED" means the TCP connection ended, so you cannot send data any more.
You need to reconnect the TCP connection first.

Who is online

Users browsing this forum: No registered users and 2 guests