-->
Page 1 of 2

The module is doing strange things to the data sent !

PostPosted: Thu Oct 15, 2015 6:53 am
by rant
When i do this :

Code: Select allAT+CIPSEND=0,20
OK


and get the ">" sign , i then type to send this :
Code: Select allHTTP/1.1 200 OK\r\n


what i see on the terminal is this : (my http command is not seeing after the ">" )


Code: Select allOK
>
busy s...



but check what happens if i do this with length of 18 :

Code: Select allAT+CIPSEND=0,18
OK
> n
busy s...
Recv 18 bytes

SEND OK



(now i see part of the message after the ">" )

and for length 10 i get more letters from my command ! ( ?? )

Code: Select allAT+CIPSEND=0,10
OK
> 00 OK\r\n
busy s...
Recv 10 bytes
SEND OK




What is going on here ?????

Re: The module is doing strange things to the data sent !

PostPosted: Thu Oct 15, 2015 1:09 pm
by smorg
I think that is the correct behavior. Look at the examples from the SDK:
Code: Select allSend data:
AT+CIPSEND=4 // set date length which will be sent, such as 4 bytes
>DGFY // enter the data, no CR
Response :SEND OK
Note: If the number of bytes sent is bigger than the size defined (n), will reply busy, and after
sending n number of bytes, reply SEND OK.

You told the module to send 20 bytes, then gave it the string "HTTP/1.1 200 OK\r\n" (which has 19 characters), which were sent.
When you only specify 18 bytes, it will send the first 18 characters, returning the 19th, which is "n".

And if you try to send a newline combination "\r\n" will probably not be converted. I do not think "\" works as an escape sequence in CIPSEND, it is just sent as it is.

Re: The module is doing strange things to the data sent !

PostPosted: Thu Oct 15, 2015 5:00 pm
by martinayotte
Yes ! The AT shell command is not dealing with escape characters, so you need to be careful with that, especially if you are in a terminal such Minicom or TeraTerm, you can not send \r\n, you need to send Ctrl-M+Ctrl-J as they are the characters for CR+LF. The "\r\n" string sequence are escape in C/C++ from Arduino sketch as well as other scripting language such python.
BTW, with the following python command, we can clearly see that the request shown/discussed above has a length of 17 characters, not 20 netiher than 19, but 17 :
Code: Select allpython -c "print len(\"HTTP/1.1 200 OK\r\n\")"
17

Re: The module is doing strange things to the data sent !

PostPosted: Thu Oct 15, 2015 5:06 pm
by rant
Well but its not really sending the respond, please refer to my question from today, which are struggling for days and nights now.

viewtopic.php?f=6&t=6012