Here we can all chat about fixing the AT+ command structure and the associated responses.

User avatar
By igrr
#2711
cpct wrote:I will indeed use it with a microcontroller (Tiva TM4C) and a state machine
...
You have any suggestions on the host side implementation?

I would use flex and bison to generate a parser for three kinds of replies: basic result codes, information responses, extended format result codes.
Then code command-response state machine by hand (as it is very simple).
Or use Ragel to generate the complete state machine that will include parsing and command-response handling. But ragel has some learning curve, so whether to use it depends on your project.
I have not used Ragel in my DCE code only because I thought using plain C would make it easier for others to contribute.
cpct wrote:I was wondering if it is technically possible to have a server mode and client connection working at the same time? Because in my application, I periodically need to update time over NTP. I could probably implement this by switching modes for short time.

You should be able to create both client and server connections at the same time, keeping the connection count limit in mind. You can have up to 5 "sockets", or contexts as i call them in documentation, aside from server (listening) sockets. There's no need to shut the server down to open a client connection.
If there's an issue with that, please report it, and I'll take a look.
User avatar
By terminator
#2717 Hey,
Im having problem with AT+CWMODE, please not that i used lua firmware before, so maybe thats reason of this error:
I modified wifi_commands.c to debug this error:
Code: Select allint opmode = argv[0].value.number;
DCE_DEBUGV("before wifi_set_opmode: %d", opmode);

wifi_set_opmode(opmode);
DCE_DEBUG("after wifi_set_opmode" );
dce_emit_basic_result_code(dce, DCE_RC_OK);

Code: Select allAT+IDBG?
+IDBG:0
AT+IDBG=1
OK
AT+CWMODE=1
target/esp8266/wifi_commands.c@45: before wifi_set_opmode: 1
ş


So in never returns from wifi_set_opmode, instead it prints few garbage characters.
Im having same problem with AT&F1,AT+IPR=115200.
Any idea how can i debug this further?
User avatar
By igrr
#2723
martinayotte wrote:2 - if I shutdown the server using AT+CIPCLOSE=6, but then I try to connect a new client, connection will be accomplish instead of been refused and after first crlf from this client a wdt-reset will occur.

I have taken a look at this issue, it's due to a "feature" of the espconn api. They don't give a way to stop server from listening :)
So reset is the only way around i guess, until i rewrite the whole tcp-udp commands directly on top of lwip.