Getting garbage in the debug with talkback app | ThingSpeak Apps | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Getting garbage in the debug with talkback app
No permission to create posts
September 2, 2015
1:54 pm
Avatar
revolk
New Member
Members
Forum Posts: 4
Member Since:
September 2, 2015
sp_UserOfflineSmall Offline

So, I'm trying to send data to my arduino using talkback app. I'm using an ESP8266 module.

But I'm only recieving garbage in the debug when the command gets in.
This is what i'm getting:

GET https://api.thingspeak.com/talkbacks//commands/execute?api_key=
wait...
-------RESPONSE TalkBack ----------
ÿG¨¡ÑÁzˉ+Ö®¬-mè±­…š’4««–Ö,Y]Ù?à}­å2EJUÕ+VÍ

I think my arduino is recieving the data, because the command disappears from the queue at the talkback app and send to a chart named "channel status updates" in my channel.

this is the part of the code that i'm using to recieve the talkback's command:

void checkTalkBack(){
char charIn;
// TCP connection
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += "184.106.153.149";
cmd += "\",80";
ser.println(cmd);

if(ser.find("Error")){
Serial.println("AT+CIPSTART error");
return;
}

// prepare GET string

String getStr = "GET https://api.thingspeak.com/talkbacks/" + talkBackID + "/commands/execute?api_key=" + talkBackAPIKey;
///getStr += apiKey;
///getStr +="&field1=";
///getStr += String(strTemp);
getStr += "

";

// send data length
cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
ser.println(cmd);
Serial.println(cmd);

if(ser.find(">")){
ser.print(getStr);
Serial.println(getStr);
}
else{
ser.println("AT+CIPCLOSE");
// alert user
Serial.println("AT+CIPCLOSE");
}

Serial.println("wait...");
delay(1000);
talkBackCommand="";
while (ser.available()) {

charIn = ser.read();
//Serial.print(charIn);
talkBackCommand += charIn;

}
Serial.println("-------RESPOSTA TalkBack ----------");
Serial.println(talkBackCommand);

After this , my code should've get the talkback 's command and turn on a LED , but it didnt work.

What i'm doing wrong?

September 2, 2015
5:50 pm
Avatar
funycheng
New Member
Members
Forum Posts: 4
Member Since:
August 29, 2015
sp_UserOfflineSmall Offline

Hi, revolk

At first, Check the Listpicker below in serial monitor on Arduino IDE.
Then, Try to change it sometimes.

I am also in a problem about Talkback App.
Well, for what will you do it by the execute (GET https://api.thingspeak.com/talkbacks/" + talkBackID + "/commands/execute?api_key=" + talkBackAPIKey) ?
Command will be removed after the time, is it ok for you?

Thank you.

September 2, 2015
6:21 pm
Avatar
revolk
New Member
Members
Forum Posts: 4
Member Since:
September 2, 2015
sp_UserOfflineSmall Offline

Hi, funnycheng

Well, i changed the options on the listpicker that you told me, but it didnt work.

Its ok to me, because i created a button on my website to create new commands every time i press it.

Thank you.

September 2, 2015
6:32 pm
Avatar
funycheng
New Member
Members
Forum Posts: 4
Member Since:
August 29, 2015
sp_UserOfflineSmall Offline

How about changing the baudrate in Arduino IDE?

September 2, 2015
9:44 pm
Avatar
revolk
New Member
Members
Forum Posts: 4
Member Since:
September 2, 2015
sp_UserOfflineSmall Offline

I tried, but i set the ESP8266 and the arduino uno to 9600 baudrate. So if i change it in the serial monitor, nothing appears or only garbage. This is weird because only the command i receive is garbage. I think i'm missing something in my code.

September 2, 2015
10:55 pm
Avatar
funycheng
New Member
Members
Forum Posts: 4
Member Since:
August 29, 2015
sp_UserOfflineSmall Offline

There are some versions about ESP8266.
About old version one, you must change the baudrate to 9600 bps at first time.
Did you do it like this anywhere?
AT+CIOBAUD=9600

Because the default about the baudrate may be 115200 bps.

Then, Check it again about( " ) in your code.

September 3, 2015
4:50 pm
Avatar
revolk
New Member
Members
Forum Posts: 4
Member Since:
September 2, 2015
sp_UserOfflineSmall Offline

My firmwere is set to 9600 bps.

One thing i forgot to say is that in the other part of my code i can send temperature data to my channel in thingspeak, so i dont think is baudrate problem.

September 3, 2015
5:51 pm
Avatar
akhila

MathWorks
Members
Forum Posts: 21
Member Since:
August 10, 2015
sp_UserOfflineSmall Offline

Hi Revolk,

One way to debug might be to check whether your TalkBack commands are being added/retrieved appropriately. Here is the documentation for getting a talkback command: http://thingspeak.mathworks.com/docs/talkback#get_command . Are you able to get your existing talkback command via a browser or any other HTTP tool?

Akhila

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
31 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

JudestAboth, concettazx4, lyndarf60, caseybo16, iodiree, emiliacz4

Administrators: Hans: 387, lee: 457