Ethernet Featherwing Inconsistent Behavior

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tyler123
 
Posts: 16
Joined: Thu Jul 01, 2021 9:54 am

Ethernet Featherwing Inconsistent Behavior

Post by tyler123 »

Hello!

I'm having an issue with the Ethernet Featherwing (mounted to a Huzzah32). This issue has occurred repeatedly on many Featherwings, many Huzzahs, several ethernet cables, and several routers.

Many times when I boot the board up, it connects perfectly fine. Sometimes however, it never connects to my router and it always has the same LED blinking pattern on the Ethernet LEDs. The lights are off, then the green light holds on for a few moments, then it turns off and the orange light quickly blinks on and back off. This pattern repeats as long as I leave the board powered on. When I power cycle the board, it typically connects as normal. Nothing that I do in my code affects this. If I add a delay in the very beginning of the setup section, the board either acts normally or the blinking lights occur immediately, even before Ethernet.init(pin). This leads me to believe it's an issue with the W5500 itself and nothing to do with my code.

I'm still troubleshooting but I was hoping somebody could point me in the right direction. Here are some thoughts that I have:
- is there a way in code to ask the W5500 to retry its connection process?
- can I reset the W5500 module or the whole shield through code?
- Ideally I don't want to solder a connection from a digital out pin to the W5500 reset pin, but if I did, is there an example wiring diagram for this? Do I just pull it low and then back to high after a delay?
- should the W5500 be resetting on power cycle or is this something that has to be manually done? I found this relevant thread viewtopic.php?t=20142&start=15

Any help is appreciated, thanks!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Ethernet Featherwing Inconsistent Behavior

Post by adafruit_support_mike »

Try calling .softReset() and see if that helps:

https://github.com/arduino-libraries/Et ... #L200-L217

User avatar
tyler123
 
Posts: 16
Joined: Thu Jul 01, 2021 9:54 am

Re: Ethernet Featherwing Inconsistent Behavior

Post by tyler123 »

Hey Mike - thanks for the feedback!

I didn't have any luck with the softReset() function. I called it using w5100.init() because softReset() is a private function and w5100.init() calls it. It doesn't seem to have any impact. I've included the code at the bottom of this post.

I have identified that this problem only occurs when the Huzzah32 is powered by certain power supplies. The following supplies work:
- standard wall warts
- this specific 12v to 5v transformer https://daygreen.com/products/12v-24v-t ... ler-type-2
- laptop USB power

The following supplies cause the issue to occur 25-50% of the time:
- a nice meanwell 12v to 5v transformer https://www.trcelectronics.com/View/Mea ... 0G-5.shtml
- a meanwell 5v supply
- another 5v supply from Amazon (I believe Alitove brand)

The obvious solution would be to switch to a supply that works and that is our backup plan for now. But I'd love to know why this is happening and if there's anything we can do to make the meanwell transformer (RSD-30G-5) work as I've already purchased and designed around this.

I noticed that it seems like the "smarter" the supply is the less likely it is to work. My first guess was that the Huzzahs aren't drawing enough power and it's causing some type of idle state to occur. I tested this by powering ~20 SK6812 LEDs from the same supply and it doesn't seem to help. I'm worried they have some type of initial current draw or voltage spike protection that's making the Huzzah/shield act strangely.

Another thought is I know the W5100 chip requires it's reset pin to assert low for a certain number of seconds. Some people fixed similar issues with a simple RC circuit between reset and ground (https://aws1.discourse-cdn.com/arduino/ ... 90x415.jpg). Does the W5500 require a similar circuit and does the Huzzah32 have any circuitry like this?

Do you have any thoughts?

Code: Select all

#include <Arduino.h>
#include "Ethernet.h"
#include "utility\w5100.h"
#include <EthernetUdp.h>
#define UDP_TX_PACKET_MAX_SIZE 200

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x21}; IPAddress ip(192, 168, 0, 21); int pcPort1 = 2100; int pcPort2 = 0021;

IPAddress pcIp(192, 168, 0, 200);
char ipString[16];
unsigned int localPort = 8888;

int cyclePrevMillis = 0;
int ipPrevMillis = 0;

EthernetUDP Udp;

void setup() {
  Ethernet.init(33);  // ESP32 with Adafruit Featherwing Ethernet
  Ethernet.begin(mac, ip);  
  
  while (Ethernet.hardwareStatus() == EthernetNoHardware) {
    delay(500);
  }
  while (Ethernet.linkStatus() == LinkOFF) {
    delay(500);
  }

  Udp.begin(localPort);
  ip = Ethernet.localIP();
  sprintf(ipString, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);

  delay(1000);
}

void loop() {
  int ipCurrMillis = millis();
  int diffMillis = ipCurrMillis - ipPrevMillis;
  if (diffMillis>10000)
  {
    W5100.init();
    ipPrevMillis = ipCurrMillis;
    delay(1000);
  }
  delay(100);
}

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Ethernet Featherwing Inconsistent Behavior

Post by adafruit_support_mike »

tyler123 wrote: Tue Nov 01, 2022 4:00 pm I noticed that it seems like the "smarter" the supply is the less likely it is to work.
Some power supplies, especially switching supplies, do need a minimum load to operate correctly. You can check that with another (separately powered) microcontroller tracking the Huzzah32's input power. Taking readings once per second should be enough to identify any major dip in the power.
tyler123 wrote: Tue Nov 01, 2022 4:00 pm Another thought is I know the W5100 chip requires it's reset pin to assert low for a certain number of seconds. Some people fixed similar issues with a simple RC circuit between reset and ground (https://aws1.discourse-cdn.com/arduino/ ... 90x415.jpg). Does the W5500 require a similar circuit and does the Huzzah32 have any circuitry like this?
I don't know of any requirements for the W5500 that aren't handled by the library, but the chip's reset pin is broken out to the end of the FeatherWing if you want to connect it to a GPIO pin so you can toggle it as needed:

https://learn.adafruit.com/adafruit-wiz ... ts-1873819

User avatar
User_UMjT7KxnxP8YN8
 
Posts: 323
Joined: Tue Jul 17, 2018 1:28 pm

Re: Ethernet Featherwing Inconsistent Behavior

Post by User_UMjT7KxnxP8YN8 »

You could try this improved version of the W5500 Ethernet library. It includes many bug fixes as well as new features .

https://github.com/SapientHetero/Ethernet

User avatar
tyler123
 
Posts: 16
Joined: Thu Jul 01, 2021 9:54 am

Re: Ethernet Featherwing Inconsistent Behavior

Post by tyler123 »

I'm sorry I didn't come back and reply to this sooner. Thank you for the support and advice! I never ended up having time to experiment with the reset pin or measuring the input voltage but I have a feeling those would have been very helpful troubleshooting steps.

For anybody who stumbles upon this in the future, I ended up taking the path of least resistance and replacing the transformers with the following:
https://www.amazon.com/BINZET-Converter ... B00J3MHTYG

No more issues!

User avatar
User_UMjT7KxnxP8YN8
 
Posts: 323
Joined: Tue Jul 17, 2018 1:28 pm

Re: Ethernet Featherwing Inconsistent Behavior

Post by User_UMjT7KxnxP8YN8 »

Could you please post a pic showing the location(s) of the transformer(s) you replaced?

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”