May 22, 2025, 03:02:35 PM

Recent posts

#41
ESP32 / Re: ESP32-EVB becomes unrespon...
Last post by LubOlimex - May 06, 2025, 10:46:16 AM
Now I got 10W LED bulb, I will also test with USB instead of the 5V DC from the variable supply.

#42
ESP32 / Re: ESP32-EVB becomes unrespon...
Last post by LubOlimex - May 06, 2025, 10:24:47 AM
So far I can't replicate it but I am waiting to get LED bulb, only have regular incandescent bulb. Attached it to both relays. In this video it is attached to relay 1:

https://www.youtube.com/watch?v=kJwsUbcyFOY

My wires are longer.

I am using variable power supply for the ESP32-EVB, it draws around 1W.

This is my Arduino IDE code, I use Arduino 1.8.19 and latest ESP32 package for Arduino (3.2.0):

/*
    This sketch shows the Ethernet event usage

*/

// Important to be defined BEFORE including ETH.h for ETH.begin() to work.
// Example RMII LAN8720 (Olimex, etc.)
#ifndef ETH_PHY_MDC
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#if CONFIG_IDF_TARGET_ESP32
#define ETH_PHY_ADDR  0
#define ETH_PHY_MDC   23
#define ETH_PHY_MDIO  18
#define ETH_PHY_POWER -1
#define ETH_CLK_MODE  ETH_CLOCK_GPIO0_IN
#elif CONFIG_IDF_TARGET_ESP32P4
#define ETH_PHY_ADDR  0
#define ETH_PHY_MDC   31
#define ETH_PHY_MDIO  52
#define ETH_PHY_POWER 51
#define ETH_CLK_MODE  EMAC_CLK_EXT_IN
#endif
#endif

#define RELAY1 32
#define RELAY2 33
#define BUTTON 34

#include <ETH.h>

static bool eth_connected = false;

// WARNING: onEvent is called from a separate FreeRTOS task (thread)!
void onEvent(arduino_event_id_t event) {
  switch (event) {
    case ARDUINO_EVENT_ETH_START:
      Serial.println("ETH Started");
      // The hostname must be set after the interface is started, but needs
      // to be set before DHCP, so set it from the event handler thread.
      ETH.setHostname("esp32-ethernet");
      break;
    case ARDUINO_EVENT_ETH_CONNECTED: Serial.println("ETH Connected"); break;
    case ARDUINO_EVENT_ETH_GOT_IP:
      Serial.println("ETH Got IP");
      Serial.println(ETH);
      eth_connected = true;
      break;
    case ARDUINO_EVENT_ETH_LOST_IP:
      Serial.println("ETH Lost IP");
      eth_connected = false;
      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;
  }
}

void testClient(const char *host, uint16_t port) {
  Serial.print("\nconnecting to ");
  Serial.println(host);

  NetworkClient client;
  if (!client.connect(host, port)) {
    Serial.println("connection failed");
    return;
  }
  client.printf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", host);
  while (client.connected() && !client.available());
  while (client.available()) {
    Serial.write(client.read());
  }

  Serial.println("closing connection\n");
  client.stop();
}

void setup() {
  Serial.begin(115200);
  Network.onEvent(onEvent);
  ETH.begin();
  pinMode (BUTTON, INPUT);
  pinMode (RELAY1, OUTPUT);
  pinMode (RELAY2, OUTPUT);
}

void loop() {
  if (eth_connected) {
    testClient("google.com", 80);
    while (!digitalRead (BUTTON));
    digitalWrite (RELAY1, HIGH);
    digitalWrite (RELAY2, LOW);
    delay (1000);
    digitalWrite (RELAY1, LOW);
    digitalWrite (RELAY2, HIGH);
    delay (1000);
}
  delay(1000);
}
#43
ESP32 / Re: ESP32-EVB becomes unrespon...
Last post by Biblbub - May 06, 2025, 09:01:45 AM
I initially tested with these LED light bulbs: https://manuals.plus/m/e8c22ed756cd0095734a658d5bff9f7aeb5089dcd9e156197a70f3c7d48e967c.pdf

"OSRAM LED BASE CLASSIC A" - 6,5 W - model number AC03079

As requested, I also switched bulbs and replaced the OSRAM with IKEA LED1934G3 bulbs: https://www.ikea.com/de/en/p/tradfri-led-bulb-e27-250-lumen-smart-wireless-dimmable-warm-white-globe-40439254/ they have 2,7W.

I have the same problem with the IKEA bulbs as with the OSRAM bulbs
#44
ESP32 / Re: multiple ESP32-POE2 (new) ...
Last post by LubOlimex - May 06, 2025, 08:49:00 AM
Maybe it can be a problem or bug in the older libraries in ESP32 for Arduino IDE?

Maybe adding a delay before Ethernet initialization might fix it. The thing is that the ESP32 chip needs to be well powered before the Ethernet has started, because if the Ethernet starts before the clock coming from the ESP32, then the Ethernet will hang. Usually that is controlled by the Ethernet power pin (e.g. keep the Ethernet in reset via GPIO12 and then after some moments, say 1 second, release it and initialize it). But maybe this was not properly done in 1.0.6.
#45
ESP32 / Re: ESP32-EVB becomes unrespon...
Last post by LubOlimex - May 06, 2025, 08:44:28 AM
The setup looks alright. Looks like only the Ethernet hangs not the whole board. Orange and black relays are similar, but we will test in similar terms as you.

Can you tell me about the bulbs that you used? Type, brand, wattage?

Can you test with other type or wattage of of bulbs?
#46
ESP32 / Re: multiple ESP32-POE2 (new) ...
Last post by joopheuvel - May 05, 2025, 07:10:50 PM
Hi.
I assume you get that ethernet error, because when you select PSRAM,
also the pin assignments from the ETH controller are set for Wrover (or did
you define them in the sketch/code?).
For me the problem is that starting with POE power simply is unreliable. Sometimes it works, but also sometimes it doesn't. Does not seem to be SW related.
Strangly enough when I start with USB power (and a regular ethernet cable), it works 100% of the time.
And... when it does not start with POE power, when I press the reset button, the board always does start after that buttonpress. Looks more to me a POE power timing Reset_ESP32 issue?
Thx.
Joop
#47
ESP32 / Re: ESP32-EVB becomes unrespon...
Last post by Biblbub - May 05, 2025, 06:48:58 PM
Switching the relays, without load is not a problem at all:
https://streamable.com/5vh9u0

But when I try to switch the relays with a load, I get only a few tries:
https://streamable.com/w4ba0t

I have attached a USB connector to see the logs in putty and when I try to switch with a load, this is what I get:

[D][switch:012]: 'Solarsteuerung Schalter 2' Turning ON.
[D][switch:055]: 'Solarsteuerung Schalter 2': Sending state ON

[D][switch:016]: 'Solarsteuerung Schalter 2' Turning OFF.
[D][switch:055]: 'Solarsteuerung Schalter 2': Sending state OFF

[D][switch:012]: 'Solarsteuerung Schalter 1' Turning ON.
[D][switch:055]: 'Solarsteuerung Schalter 1': Sending state ON

[D][switch:016]: 'Solarsteuerung Schalter 1' Turning OFF.
[D][switch:055]: 'Solarsteuerung Schalter 1': Sending state OFF

[D][switch:012]: 'Solarsteuerung Schalter 2' Turning ON.
[D][switch:055]: 'Solarsteuerung Schalter 2': Sending state ON

[D][switch:012]: 'Solarsteuerung Schalter 1' Turning ON.
[D][switch:055]: 'Solarsteuerung Schalter 1': Sending state ON

[V][ethernet:411][sys_evt]: [Ethernet event] ETH disconnected (num=3)
[W][ethernet:274]: Connection via Ethernet lost! Re-connecting...
[W][component:157]: Component ethernet set Warning flag: waiting for IP configuration
[V][ethernet:472]: DHCP Client Status: 0
[W][api.connection:109]: Home Assistant 2025.4.4 (192.168.64.17): Network unavailable, disconnecting
[V][api:116]: Removing connection to Home Assistant 2025.4.4
[W][component:157]: Component api set Warning flag: unspecified
[W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:472]: DHCP Client Status: 0
[W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:472]: DHCP Client Status: 0

It lines up very well with what we see in the video
#48
ESP32 / Re: ESP32-EVB becomes unrespon...
Last post by Biblbub - May 05, 2025, 06:13:03 PM
Hi,

thank you for the reply, if we focus on issue 1:
I tested pretty straightforward with two lamps.
The setup:

The lamp on PIN32 Relay is ON:

The lamp on PIN33 is ON:

Both lamps are ON:


I followed your links and the relays on your board are orange, while mine are black, could this cause the problems?

I should be nowhere near the power usage I saw in you video with the drill.
#49
ESP32 / Re: multiple ESP32-POE2 (new) ...
Last post by LubOlimex - May 05, 2025, 04:45:27 PM
What I can say for sure is I get errors with Ethernet when:

- I use latest ESP32 release;
- I select ESP32-POE from the board selector;
- I disable PSRAM from the board options.

This leads to Ethernet problems with ESP32-POE2.

#50
ESP32 / Re: multiple ESP32-POE2 (new) ...
Last post by joopheuvel - May 05, 2025, 04:39:11 PM
Indeed, One of the things I tried as well, going to the latest ESP32 PlatformManager. When I do, I run into multiple issues of SD MMC not working, to Firebase giving compiler errors but can switch off oblviously) to some other libraries I need to rewrite (OTA and FirebaseStorage). Also, the new Firebase libraries have their stability issues as well. Anyway, I may need to go ahead and overcome/bypass all this to do a try with the latest platform manager. What extra's are implemented in the download with latest IDE platform manager (I see in boards.txt)  ? Does extra stability code get added?

" esp32-poe.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw "

Thanks.
Joop