Resultados de
Hello!
I`ve got problems with reading last input of a channel field using AT commands, here follows the sketch I'm currently using:
/* String tx_data_r = "GET https://api.thingspeak.com/channels/CHANNEL/fields/4/last.txt?api_key=API_READ_KEY&results=1"; */
String tx_data_r = "GET https://api.thingspeak.com/channels/"; tx_data_r += "CHANNEL"; tx_data_r += "/"; tx_data_r += "fields"; tx_data_r += "/4/"; tx_data_r += "last.txt?api_key="; tx_data_r += "API_READ_KEY"; tx_data_r += "&results=1"; tx_data_r += "\r\n";
Serial.print("AT+CIPSEND="); delay(1000);
Serial.println(tx_data_r.length()); delay(1000);
Serial.println(tx_data_r); delay(1000);
This piece of code doesn`t return a valid response, however if I copy/paste https://api.thingspeak.com/channels/CHANNEL/fields/4/last.txt?api_key=API_READ_KEY&results=1" using a browser I get the right data.
One more thing, if instead of using a microcontroller I use an USB serial PC interface program directly connected to my RF module, with GET https://api.thingspeak.com/channels/CHANNEL/fields/4/last.txt?api_key=API_READ_KEY&results=1 along with other commands I get the right data too!
Can anybody tell me what's going on?
There are no problems with any read related commands.
If a working sketch is available it will be most welcome!
Tks in advance for any help!