WebHook to Ubidots crash my sketch

I used WebHook to post data to ThingSpeak with success and now I’m trying to use Ubidots instead of ThingSpeak.
I’m able to post data with success to Ubidots but after that my Arduino Mega crash and restart.
This is my WebHook

URL 
http://things.ubidots.com/api/v1.6/devices/myreef2/?token=xxxxxxxxxxxxxxxxxxxxxx
Method 
POST
CONTENT/TYPE
application/json
BODY
/pin/

where /pin/ are attached to my sketch:

  String myPin = "{";
  myPin = myPin + "\"t_amb\":" + String(myAnalogs[0].value);
  myPin = myPin + ",";
  myPin = myPin + "\"u_amb\":" + String(myAnalogs[1].value);
  myPin = myPin + ",";
  myPin = myPin + "\"t_vas\":" + String(myAnalogs[2].value);
  myPin = myPin + ",";
  myPin = myPin + "\"t_sum\":" + String(myAnalogs[3].value);    
  myPin = myPin + ",";
  myPin = myPin + "\"t_vas_2\":" + String(myAnalogs[4].value);    
  myPin = myPin + ",";      
  myPin = myPin + "\"l_rab\":" + String(myAnalogs[5].value);
  myPin = myPin + ",";
  myPin = myPin + "\"l_dum\":" + String(myAnalogs[6].value);
  myPin = myPin + ",";
  myPin = myPin + "\"l_aqu\":" + String(myAnalogs[7].value);     
  myPin = myPin + "}";
  Blynk.virtualWrite(V53, myPin);

So… why my Mega crash? Any idea?

Bump!

I don’t see here any WebHook. Why you think webhook related? Title seems to me misleading.

V53 is my WebHook widget… same as V51 that I use for ThingSpeak

No suggestions?

I think you just have very big HTTP request. And arduino crashes because of this. Try to remove, let’s say, half of parameters. Does Arduino still crashes? Webhook can’t crash MEGA as it is executed on server side.

Good idea!
… the stranage fact is that I don’t manage the replies from Ubidots, so… why my Mega crash on the ubidots HTTP replies?

Hm… That’s good point. I forgot we have responses from webhook :slight_smile:. What response message does ubidot have?

This is the Ubidots reply to my POST:

payload: "{"hum": [{"status_code": 201}]}"
url: "http://things.ubidots.com/api/v1.6/devices/my-wio/?token=0qL4yeE0drPsAkNJTc5i6KT3fhElCT"
method: "POST"


content-type: "application/json"
transfer-encoding: "chunked"
connection: "close"
vary: "Accept-Encoding, Accept, Cookie"
allow: "POST, OPTIONS"
statusCode: 200
responseUrl: "http://things.ubidots.com/api/v1.6/devices/my-wio/?token=xxxxxxxxxxxxxxxxxxxxxxxx"

Please try to add webhook handler to your sketch and put some serial output there. Still the same?

Yes, of course… but how I can read back the webhook out?

BLYNK_WRITE(V0){
  String webhookdata = param.asStr();
  Serial.println(webhookdata);
}

http://docs.blynk.cc/#widgets-other-webhook

Well… okay… in the “same old way”… I understood! I will try ASAP.

This is my serial output:

[146876] Buffer overflow
[146876] Buffer overflow
[146876] Buffer overflow
[146890] Buffer overflow
[146917] Buffer overflow
[146945] Buffer overflow
[146971] Buffer overflow
[146998] Buffer overflow
[147025] Buffer overflow
[147052] Buffer overflow
[147080] Buffer overflow
[147106] Buffer overflow
[147133] Buffer overflow
[147161] Buffer overflow
[147187] Buffer overflow
[147215] Buffer overflow
[147241] Buffer overflow
[147268] Buffer overflow
[147296] Buffer overflow
[147322] Buffer overflow
[147350] Buffer overflow

Please try to increase

#define BLYNK_MAX_READBYTES 1024

to let’s say 4096.

… problem still remain …:unamused:

… no ideas or some test to do?

@vshymanskyy any suggestions?