cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with exiting data mode

Posted on April 23, 2015 at 09:58

Hi,

I have a problem trying to exit data mode upon establishing the connection as the socket server. The problem is that the escape sequence is interpreted as yet another data chunk to be sent to the client. Increasing sockd_timeout variable didn't help. I tried with both default and custom escape sequences.

I am simply unable to leave data mode!

Some other things I noticed, which might be of help:

- while in command mode, if I enter the current valid custom escape sequance (reported by examining escape_seq variable), I am greeted with the message ''ERROR: command not found''. On the other hand, if I enter default ''AT+S.'' sequence, I get the message saying data mode is unavailable.

Is this behavior expected?

- When I try to shut down the socket server, either before entering data mode (which I cannot leave), or after client disconnects (thus forcing the module back into command mode), hard fault always ensues.

I am not sure what else to do. Any thoughts?

Thanks!

Marko

#socket-server #socket-server
3 REPLIES 3
Posted on April 23, 2015 at 15:47

Hi Marko,

if escape sequence is not interpreted, I expect timings are not properly used. I mean:

1 - escape sequence must be followed by timeout

2 - every characted of escape sequence must be sent without any timeout between them. Use copy/paste of the whole sequence, ''at+s.'' as default.

About other points:

- it's correct that escape sequence gives you ''command not found'' in command mode. escape sequence has no meaning in command mode;

it's correct that default escape sequence ''at+s.'' gives you ''data mode not available'' while in command mode, without clients;

- hardfault was a known issue in FW3.3. I'm sorry. Please update your SPWF module to release 3.4. Contact your local ST support for FW delivery.

Regards

jerry

Posted on April 24, 2015 at 16:26

Hi, thanks very much for your response!

I tried upping the baud rate for UART between the module and the MCU, it didn't help.

I am sending the escape sequence characters subsequently, without any timeout in between. Also, while testing, I don't send anything after finishing the escape sequence, so it shouldn't be a problem with timeout either. Please take a look at the picture below, I just took a screenshot while testing it:

http://i.imgur.com/GnPHqeZ.png

MCU with wifi module is the server, PC is the client. I am using TCP/IP builder terminal on PC (the window in the middle). Terminals on the sides are the following:

On the left is the terminal where you can see data MCU is sending to module (which the module forwards to PC).

On the right, you can see the terminal which displays data the module is sending to MCU (normal responses and async indications, or upon receiving data from the PC in data mode).

You should see how the escape sequence here is interpreted as ordinary data by the module. The communication between MCU and module is done using 256k baud rate.

Thanks again for your help!

EDIT: Problems solved!

New firmware solved the hard fault issue, and I realized I was sending <CR> as a part of the escape sequence, once I stopped doing that, everything worked as expected.

Thanks very much again!

Posted on April 24, 2015 at 22:59

Good!

I was sure that escape sequence was not correctly sent :p

Stay tuned!

jerry