Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By mike_cymru
#61304 Hi
I have an issue with parsing AT commands which are passed to a declared function 'sendData' when the AT command argument passed includes strings. For example, when setting an Soft Access point, the password and SSID are both strings within the AT command. The function declaration (part) is:

Code: Select allString sendData(String command, const int timeout, boolean debug)


The arguments passed are (for example):
Code: Select allsendData("AT+CWSAP=2,"CG_BRST", "12345678",1,3", 100,1);


Clearly I think there will be issues with the double quotation characters bounding the command argument and indeed this gives rise to an 'ESP' error response which suggests parsing is necessary. Incidentally, I can successfully implement and verify this command using SimpleTermGold and an FTDI cable so can eliminate hardware issues when issuing this and other AT commands.
In anticipation, hope someone can shed light on this problem.
Many thanks.
User avatar
By mike_cymru
#61316 Thanks for your prompt reply. I applied the escape characters as suggested but get an 'Error' response from the ESP. Close inspection shows a space is inserted after the ',' delimiter between the SSID and Password arguments in the echoed commands: ...."CG_BRST_AP", "burstner"....displayed in the Arduino Serial Monitor. (yes I have changed the arguments from the initial post).

Using the SimpleTermGold FTDI application I can replicate this error with the ESP if indeed a single space is introduced at this point; if removed, no issue with the command. The Arduino code modified as per your suggestion is (clearly no space characters) :

Code: Select all  sendData("AT+CWSAP=2,\"CG_BRST_AP\", \"burstner\",1,3\r\n", 1000,1);


Can you suggest why the syntax of the echoed command is slightly different, producing thiserror?
Many thanks again.