Show your full sketch, the default blynk example sketch for Ethernet boards shows that SSID and PW is not required if you include the correct libraries.
/*************************************************************
This example shows how to use Arduino Ethernet shield (W5100)
to connect your project to Blynk.
NOTE: Pins 10, 11, 12 and 13 are reserved for Ethernet module.
DON'T use them in your sketch directly!
WARNING: If you have an SD card, you may need to disable it
by setting pin 4 to HIGH. Read more here:
https://www.arduino.cc/en/Main/ArduinoEthernetShield
This is a simple demo of sending and receiving some data.
Be sure to check out other examples!
*************************************************************/
/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPL2s7k3GZJa"
#define BLYNK_TEMPLATE_NAME "Quickstart Template"
#define BLYNK_AUTH_TOKEN "k3ZAnuJkDWs4LX5HSW5ZfebZEpGPvC44"
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#define W5100_CS 10
#define SDCARD_CS 4
BlynkTimer timer;
// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
// Set incoming value from pin V0 to a variable
int value = param.asInt();
// Update state
Blynk.virtualWrite(V1, value);
}
// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
// Change Web Link Button message to "Congratulations!"
Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
Blynk.setProperty(V3, "onImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}
// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V2, millis() / 1000);
}
void setup()
{
// Debug console
Serial.begin(115200);
pinMode(SDCARD_CS, OUTPUT);
digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card
Blynk.begin(BLYNK_AUTH_TOKEN);
// You can also specify server:
//Blynk.begin(BLYNK_AUTH_TOKEN, "blynk.cloud", 80);
//Blynk.begin(BLYNK_AUTH_TOKEN, IPAddress(192,168,1,100), 8080);
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent);
}
void loop()
{
Blynk.run();
timer.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}
However it seems to crash at Blynk.begin(auth);
Here is the serial console output:
Wifi Event
ETH Started
Wifi Event
ETH Connected
Wifi Event
ETH MAC: B0:A7:32:07:0E:07, IPv4: 192.168.50.34, FULL_DUPLEX, 100Mbps
dht init
Going to Blynk begin
[2683] Getting IP...
8��BX�t(Uզոlƚ�mթ�
This is my full code
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID ""
#define BLYNK_TEMPLATE_NAME "Weather Station WT32 ESP01"
#define BLYNK_AUTH_TOKEN ""
#include <ETH.h>
#include <BH1750.h>
#include <BMP085.h>
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include "Arduino.h"
#include "DHT.h"
#include <Wire.h>
float temperature; // parameters
float humidity;
float pressure;
float mbar;
float uv;
float visible;
float ir;
#define BH1750_DEFAULT_I2CADDR 0x23// because ADD is left floating
BH1750 myBH1750;
BMP085 myBarometer; // initialise pressure sensor
#define ALTITUDE 1655.0 // Altitude of SparkFun's HQ in Boulder, CO. in meters
char auth[] = BLYNK_AUTH_TOKEN; // replace this with your auth token
char ssid[] = ""; // replace this with your wifi name (SSID)
char pass[] = ""; // replace this with your wifi password
#define DHTPIN 5 // dht sensor is connected to D5
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE); // initialise dht sensor
BlynkTimer timer;
static bool eth_connected = false;
void WiFiEvent(WiFiEvent_t event)
{
Serial.println("Wifi Event");
switch (event) {
case ARDUINO_EVENT_ETH_START:
Serial.println("ETH Started");
//set eth hostname here
ETH.setHostname("esp32-ethernet");
break;
case ARDUINO_EVENT_ETH_CONNECTED:
Serial.println("ETH Connected");
break;
case ARDUINO_EVENT_ETH_GOT_IP:
Serial.print("ETH MAC: ");
Serial.print(ETH.macAddress());
Serial.print(", IPv4: ");
Serial.print(ETH.localIP());
if (ETH.fullDuplex()) {
Serial.print(", FULL_DUPLEX");
}
Serial.print(", ");
Serial.print(ETH.linkSpeed());
Serial.println("Mbps");
eth_connected = true;
break;
case ARDUINO_EVENT_ETH_DISCONNECTED:
Serial.println("ETH Disconnected");
eth_connected = false;
break;
case ARDUINO_EVENT_ETH_STOP:
Serial.println("ETH Stopped");
eth_connected = false;
break;
default:
break;
}
}
int LED = 2;
void sendSensor() // function to read sensor values and send them to Blynk
{
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000);
humidity = dht.readHumidity();
temperature = dht.readTemperature();
if (isnan(humidity) || isnan(temperature))
{
Serial.println("Failed to read from DHT sensor!");
return;
}
Serial.println("dht temparature: "+String(temperature,2));
pressure = myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP()); // read pressure value in pascals
mbar = pressure / 100; // convert millibar to pascals
float lightLevel = myBH1750.readLightLevel(); //start measurment -> wait for result -> read result -> retrun result or 4294967295 if communication error is occurred
visible = lightLevel;
Serial.println("sending temp to Blynk temparature: "+String(temperature,2));
Serial.println("sending temp to Blynk mbar: "+String(mbar,2));
Serial.println("sending temp to Blynk uv: "+String(uv, 2));
Serial.println("sending temp to Blynk ir: "+String(ir, 2));
Serial.println("sending temp to Blynk visible: "+String(visible, 2));
Blynk.virtualWrite(V0, temperature); // send all the values to their respective virtual pins
Blynk.virtualWrite(V1, humidity);
Blynk.virtualWrite(V2, mbar);
Blynk.virtualWrite(V3, visible);
Blynk.virtualWrite(V4, ir);
Blynk.virtualWrite(V5, uv);
digitalWrite(LED, LOW); // turn the LED off
}
void setup()
{
Serial.begin(9600);
pinMode(LED, OUTPUT);
WiFi.onEvent(WiFiEvent);
ETH.begin();
Serial.println("dht init");
dht.begin();
delay(1000);
Serial.println("Going to Blynk begin");
Blynk.begin(auth);
Serial.println("Blynk ready");
timer.setInterval(15000L, sendSensor); // sendSensor function will run every 1000 milliseconds
}
void loop()
{
if (eth_connected)
{
Blynk.run();
}
timer.run();
}
I really don’t understand why you aren’t starting-off with a simplified version of @Luke_Clavey’s working sketch for the WT32-ETH01. Something like this…
If you now return to Luke’s sketch and copy the lines that have the “for Blynk.Air OTA” comment next to them you’ll be able to do OTA (or more correctly Over Ethernet) updates to your device(s) vroom Blynk.Air