Webhook getting bad results

when I run just the basic webhook activated by button sending to V20 the data is as follows. The one and zero is the button being pressed sending 1 then 0. I had it working when using ESP8266. what am I missing?

#define BLYNK_PRINT Serial
#define BLYNK_MAX_READBYTES 512

#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

char auth[] = "*************************************";

BLYNK_WRITE(V20)
{
  Serial.println("WebHook data:");
  Serial.println(param.asStr());
}

void setup()
{
  // Debug console
  Serial.begin(9600);
  Blynk.begin(auth);
}

void loop()
{
  Blynk.run();
}

NOTE : Blynk cloud has limitation for webhook widget - you are allowed to send only 1 request per second. You can change this on local server with webhooks.frequency.user.quota.limit. Please be very careful using webhooks, as many resources not capable to handle even 1 req/sec, so you may be banned on some of them. For example thingspeak allows to send 1 request per 15 seconds.

I am only sending the request once using Blynk example.

The first response is the button being pressed. (Webhook data: 1)
The second is the correct results. (Webhook data: Results)
The third is the button being released. (Webhook data: 0)

This is what the webhook is sending:
http://api.sunrise-sunset.org/json?lat=38.8935979&lng=-95.2765293&sunset=1&date=today&formatted=0

So what exactly doesn’t work than?

As you can see from the picture I get 3 results. I need to parse the results.

I should only get the results from the webhook get and not the button pressed and released value.

You have few options :

  1. check if this is 1 or 0 and skip.
  2. Move webhook trigger to another pin.

Poor way to solve Blynk Webhook software issue.

Also you I can not get the url to work when sent from hardware, only works when entered into webhook widget directly.

Blynk.virtualWrite(V0, "https://api.sunrise-sunset.org/json?lat=50.4495484&lng=30.5253873&date=2016-10-01");

The problem in the way you use webhook and not in webhook at all. Please read related documentation. It has all answers you need.

Dear Dmitriy;
i used webhook to send my sensor data to thingspeak also but it send the data 4 times and then server get offline.
Why?
i also send data one time in 30 seconds.

What server?

My cc3000 shield micro web-server disconnected from blynk after sending data 3 or 4 times

If this client code it not web-server but web client.

Dear,
I send sensors data on virtual pin and used webhook to send this data to thingspeak also, when it send data to thingspeak 3 or 4 times it get disconnected from blynk.
i also used 4 buttons to control 4 appliances but when i turn on all of 4 buttons then it did not get off.

#define BLYNK_PRINT Serial // Comment this out to disable prints and save space

// These are the interrupt and control pins for СС3000
#define ADAFRUIT_CC3000_IRQ 3
#define ADAFRUIT_CC3000_VBAT 5
#define ADAFRUIT_CC3000_CS 10

#include <SPI.h>
#include <Adafruit_CC3000.h>
#include <BlynkSimpleCC3000.h>
#include <SimpleTimer.h>
//------------------------
#include <string.h>
#include<stdlib.h>
#include “utility/debug.h”
#include “DHT.h”
#include <avr/wdt.h>

// temperature and humidity sensor
#define DHTPIN 7
#define DHTTYPE DHT22
int gas_status;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “ee25eeb01b334bb695c01da8c27a675d”;

// Your WiFi credentials.
// Choose wifi_sec from WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2
char ssid[] = “Shahbaz”;
char pass[] = “pakistan123”;
int wifi_sec = WLAN_SEC_WPA2;
SimpleTimer timer;
//-----------------------------------------------------
// Define variable and pins for sensors
const int sensorPin[] = {22, 24, 26, 28, 30 };
int Gassensor = 6;
// For temperature and humidity
DHT dht(DHTPIN, DHTTYPE);
//-------------------------------------------------------

void setup()
{
//------------------------------------------

for (byte idx = 0; idx < 5; idx++) {
pinMode(sensorPin[idx], INPUT);
}
//Configured this pin 6 as input for Gas sensor
pinMode(Gassensor, INPUT);
//----------------------------------------------------
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, wifi_sec);

// Setup a function to be called every 30 second
timer.setInterval(30000L, myTimerEvent);
}

void loop()
{

Blynk.run(); // Initiates Blynk

timer.run(); // Initiates SimpleTimer
}
// This function sends Arduino’s up time every second to Virtual Pin (5).
// In the app, Widget’s reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
// You can send any value at any time.
// Please don’t send more that 10 values per second.

// Get data from DHT 22 & transform to integers
//------------------------------------------------
float h = dht.readHumidity();
float t = dht.readTemperature();
//------------------------------------
//Get data from gas sensor
int g = digitalRead(Gassensor);
if(g==0)
{
gas_status = 1;
}
else
{
gas_status = 0;
}

//--------------------------------------------
//Get data from flame sensor
bool anySensor = false;
for (byte idx = 0; idx < 5; idx++) {
if (digitalRead(sensorPin[idx])) {
anySensor = true;
}
}
int fireState=anySensor;
//------------------------------------------------------
// print data collected by sensors on serial monitor
Serial.print("Temperature = ");
Serial.println(t);
Serial.print("Humidity = ");
Serial.println(h);
Serial.print("Gas Status = ");
Serial.println(gas_status);
Serial.print("FlameStatus = ");
Serial.println(fireState);
//-----------------------------------------------
int temperature = (int) t;
int humidity = (int) h;
String tem=String(temperature, DEC); //Thingspeak only data stream is string type
String hum=String(humidity, DEC); // Converting integer data to string
String gas=String(gas_status, DEC);
String flame=String(fireState, DEC);
Blynk.virtualWrite(V0, tem, hum, flame, gas);

}

please check the sketch above.

Please properly format sketch above. Otherwise it is difficult to read.