Ok guys, the ol'e man has himself backed into a corner again. This time with a similar situation of sending the " character as part of a string. I've tried the \" and the compiler reports - sketch_feb16b:28: error: stray '\' in program. What I am trying to do is connect an 8266 wifi module to my router.
The AT command is: AT+CWJAP="SSID","KEY" then crlf.
I'm building off a sketch from Miguel at allaboutee.com who takes the approach of creating a sendData function with 3 parameters. 1 the command, 2 timeout, 3 boolean (for testing) to send AT commands to the 8266. He doesn't show this particular command being created, which I think is the most complex to be dealt with due to the quotes, which must be sent, as well as a comma have to be concatenated into a string that will be sent so as not to be seen as an extra parameter being added to the sendData function. I didn't think it would be as difficult as I've made it. I know I'm missing something but don't know what. Heres where I've gotten to:
sendData("AT+RST\r\n",2000,DEBUG); // reset module
sendData("AT+CWMODE=1\r\n",1000,DEBUG); // configure as station
sendData("AT+CIFSR\r\n",1000,DEBUG); // get ip address
sendData("AT+CIPMUX=1\r\n",1000,DEBUG); // configure for multiple connections
String idstring = ("ssid");
String keystring = ("key");
String connectstring = "AT+CWJAP=";
connectstring += idstring;
connectstring += ",";
connectstring += keystring;
connectstring += "\r\n";
So the whole connect string should be sent as AT+CWJAP="ssid","key(password)" \r\n
In this case if DEBUG is true, the response from the 8266 is sent back thru the UNO to the serial monitor. What I see coming back is: AT+CWJAP=myssid,mykey