BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Connect to Google sheets

Hello,
Is there a way to use Blynk’s web hook capabilities without the ESP8266WIFI.h library? Is there a way with the WIFI.h library? I am using an ESP-01 and an arduino mega.

Thank you!

If you want to make webhook calls using “Blynk’ webhook capabilities” then it makes no difference what hardware you are using, and what Wi-Fi library you are running on that hardware. In fact, you don’t need any hardware at all.
The webhook widget makes its API calls via the Blynk server, so is hardware agnostic.

If you don’t want to use Blynk webhook facility and instead want to make API calls direct from the hardware via code then this bypasses Blynk altogether.
To do this with your hardware setup is tricky (or maybe impossible, I’m not really clear exactly what it is that you’re trying to do), as the ESP-01 is simply acting as a Wi-Fi modem and only understands AT commands, which are being passed to it in the background via the Blynk simple shield library.

Pete.

Thank you for responding Pete!
I am trying to get something similar to the Report widget on google sheets. I would like input values from the arduino to be displayed same as a Blynk report…if possible. I have a PushingBox account.

Bleow if what I have so far. The code uploads but the data only uploads if I press “Run Test” on the app.

#define BLYNK_PRINT Serial
// Allow for receiving messages up to 512 bytes long
//#define BLYNK_MAX_READBYTES 512

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include "DHT.h"
#define DHTPIN 2    // what digital pin we're connected to
                    //pin2 to D4 on esp board

// Uncomment whatever DHT sensor type you're using!
#define DHTTYPE DHT11  // DHT 11
//#define DHTTYPE DHT21  // DHT 21
//#define DHTTYPE DHT22  // DHT 22

DHT dht(DHTPIN,DHTTYPE);

const char WEBSITE[] = "api.pushingbox.com"; //pushingbox API server
const String devid = " "; 

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "";
char pass[] = "";

// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial3

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);
BlynkTimer timer;
BLYNK_WRITE(V0)
{
  float humidityData = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float celData = dht.readTemperature();
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float fehrData = dht.readTemperature(true);

  // Check if any reads failed and exit early (to try again).
  if (isnan(humidityData) || isnan(celData) || isnan(fehrData))
  {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Compute heat index in Celsius (isFahreheit = false)
  float hicData = dht.computeHeatIndex(celData, humidityData, false);
  // Compute heat index in Fahrenheit (the default)
  float hifData = dht.computeHeatIndex(fehrData, humidityData);

  //Print to Serial monitor or Terminal of your chocice at 115200 Baud
  Serial.print("Humidity: ");
  Serial.print(humidityData);
  Serial.print(" %\t");
  Serial.print("Temperature in Cel: ");
  Serial.print(celData);
  Serial.print(" *C ");
  Serial.print("Temperature in Fehr: ");
  Serial.print(fehrData);
  Serial.print(" *F\t");
  Serial.print("Heat index in Cel: ");
  Serial.print(hicData);
  Serial.print(" *C ");
  Serial.print("Heat index in Fehr: ");
  Serial.print(hifData);
  Serial.print(" *F\n");
    
  Serial.println("WebHook data:");
  Serial.println(param.asStr());
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
timer.setInterval(1000L, goSend);
  Blynk.virtualWrite(V0, "http://api.pushingbox.com/pushingbox?devid="mydevid"&humidityData=&celData=&fehrData=/pin");
  // You can perform HTTPS requests even if your hardware alone can't handle SSL
  // Blynk  can also fetch much bigger messages,
  // if hardware has enough RAM (set BLYNK_MAX_READBYTES to 4096)
  //Blynk.virtualWrite(V0, "https://api.sunrise-sunset.org/jsonlat=50.4495484&lng=30.5253873&date=2016-10-01");
}
void goSend()
{

}

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

Do I have to set BLYNK_MAX_READBYTES to 4096 to use webhook? I have an arduino mega.