OLIMEX ESP32 EVB with Ethernet
• Smartphone OS (iOS or Android) + version
• Local Blynk server
• Blynk Library version 6.1
Good day!
I got a problem sending a command across a bridge between two OLIMEX ESP32 EVBs. ESP32 # 1
should turn the relay on and off on ESP32 # 2 every second. but nothing happens. Controlling the same relay from the phone via the button widget works fine. The controller is connected by twisted pair. All other controller functions work. Blynk server connection is connected.
If you send values across the bridge from the Arduino Mega, then everything works fine. The signal comes to both OLIMEX ESP32 EVBs. From here I concluded that the problem is precisely with sending from OLIMEX ESP32 EVB through the bridge.
Добрый день!
У меня появилась проблема с отправкой команды через мост между двумя OLIMEX ESP32 EVB. ESP32 №1
должна включать и выключать реле на ESP32 №2 каждую секунду. но ничего не происходит. Управление этим же реле с телефона через виджет “кнопка” работает отлично. Контроллера подключены витой парой. Все остальные функции контроллера работают. Связь с сервером блинк подключена.
Если отправлять значения через мост с Arduino Mega, то все работает отлично. Сигнал приходит на оба OLIMEX ESP32 EVB. Отсюда я сделал вывод что проблема именно с отправкой с OLIMEX ESP32 EVB через мост.
#define BLYNK_PRINT Serial
#include <ETH.h>
#include <BlynkSimpleEsp32.h>
#include <ESPmDNS.h>
#include <WiFiUdp.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "658675647";
WiFiUDP udpClient;
// Your WiFi credentials.
// Set password to "" for open networks.
// Bridge widget on virtual pin 1
WidgetBridge bridge1(V1);
// Timer for blynking
BlynkTimer timer;
static bool eth_connected = false;
static bool value = true;
void blynkAnotherDevice() // Here we will send HIGH or LOW once per second
{
// Send value to another device
if (value) {
bridge1.digitalWrite(33, HIGH); // Digital Pin 9 on the second board will be set HIGH
/////////////////////////////////////////////////////////////////////////////////////////
// Keep in mind that when performing virtualWrite with Bridge,
// second board will need to process the incoming command.
// It can be done by using this handler on the second board:
//
// BLYNK_WRITE(V5){
// int pinData = param.asInt(); // pinData variable will store value that came via Bridge
// }
//
/////////////////////////////////////////////////////////////////////////////////////////
} else {
bridge1.digitalWrite(33, LOW); // Digital Pin 9 on the second board will be set LOW
}
// Toggle value
value = !value;
}
BLYNK_CONNECTED() {
bridge1.setAuthToken("509857756"); // Place the AuthToken of the second hardware here
}
void setup()
{
// Debug console
Serial.begin(9600);
WiFi.onEvent(WiFiEvent);
ETH.begin();
Blynk.config(auth, IPAddress(10, 250, 4, 110), 8080);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
// Call blynkAnotherDevice every second
timer.setInterval(1000L, blynkAnotherDevice);
}
void WiFiEvent(WiFiEvent_t event)
{
switch (event) {
case SYSTEM_EVENT_ETH_START:
Serial.println("ETH Started");
//set eth hostname here
ETH.setHostname("esp32-ethernet");
break;
case SYSTEM_EVENT_ETH_CONNECTED:
Serial.println("ETH Connected");
break;
case SYSTEM_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 SYSTEM_EVENT_ETH_DISCONNECTED:
Serial.println("ETH Disconnected");
eth_connected = false;
break;
case SYSTEM_EVENT_ETH_STOP:
Serial.println("ETH Stopped");
eth_connected = false;
break;
default:
break;
}
}
void loop()
{
if (eth_connected) {
Blynk.run();
}
timer.run();
}
sorry for my english. translated via google translator