Ethernet Shield W5100 does not connect to the Blynk server via Switch, only with router

I had a similar problem with a WS5100 Ethernet shield for Arduino. It works fine plugged into the router or a Netgear 5/8 port switch, but if I connect it to a D-link 24 port switch it doesn’t work.
If you google the problem you’ll see that lots of people have reported similar issues with different makes of switches. It seems that many flavours of Arduino Ethernet are very fussy in this way.
You should probably look at an ESP8266 or NodeMCU with built-in Wi-Fi and ditch the Arduino altogether.

Pete.

1 Like

Both are commented on

Yes, see this now :slight_smile: … the formatting…
Still for some reason no connection, as it cannot get an IP from DHCP… is it a passive switch?

I remember reading that many of these these clone or older ethernet adapters don’t actually have an embedded MAC… thus one of the “fixes” was to assign a MAC in the sketch. I wonder if MAC issues will cause data loss when passing data through a switch? @Jurandir if you can find one, try just a simple old school hub.

@Gunner: seems to be already on check list :wink: I would try another switch (but I do have few of them lying around :stuck_out_tongue_winking_eye: )

@marvin7 When I was still fighting with my W5100, I had limited success (even through a switch) by changing around the MAC… sometimes grabbing one from another device, sometimes making one up.

But alas… the stability was sooo bad that I finally just “fixed it:hammer: and switched to USB-link, since the Arduinos rarely left the workbench anyhow.

Now everything has a super stable Blynk.config() followed by Blynk.connect() communication link :wink:

@Gunner Have you resolved the DHCP error while connecting to network switch?

I didn’t use DHCP much, most of my network is Static. But when I did use the bleeping shield, it sometimes worked, sometimes didn’t (but always over a switch as my router is further away from my workbench).

It finally failed more often then not, so I scrapped it and am now a firm holdout in the USB-Link camp :slight_smile:

If you want to fix it please refer to my post response link below.

I meant that literally… I desoldered anything useful and tossed the rest. Even your posted solution will not be able to bring it back :wink:

Researching here on my problem, I came to suspect that the L2 switches do not work with the Ethernet Shield W5100 because of their characteristics of doing frame switching only via hardware, which happens differently in L3 type routers and switches, which in addition To do frame switching, can also do packet switching, and also via hardware.

Maybe that’s the explanation!
If anyone can complement my reasoning, I will be grateful!

I decided to buy an 8-port router and complete my project, but the question is why a W5100 Ethernet Shield does not work with a switch, but it works with a router (remembering that I bought 02 and none of them worked)

I do not know, what the problem is in your case, but I never had an issue with W5100. Had it connected on top of Uno to a couple of different locations, ALWAYS through some switch, and it always worked. Now it is not used, but still useable (I think… :P) :confused: Some bad “clones” or what? My is a clone too, it’s just the “good one”

Yours was made on a Tuesday afternoon, right after a restful three day weekend :stuck_out_tongue_winking_eye:

he, he… It’s not “signed”, but it must be the case!

hi guys, i have the same problem…when connect Arduino directly at router it’s ok, all perfect…but when i use an ethernet switch and connect the same board with the same sketch, it’s impossible to connect at the server.
How can i fix?

Don’t use switch or find a quality shield that works… no other magical fixes available…

I think you might be on to something there. My W5100 shield works okay when plugged-in to a Netgear GS605 or GS608 switch, which are described as “Layer 3 Light” - whatever that means, but doesn’t work when plugged-in to a D-Link DGS-102D switch which is Layer 2.

Pete.

Sorry @Gunner, I know it’s 265 days since the last reply, but I think an explanation could help, not just for the W5100, but connection problems in general. And @PeteKnight kinda gave me a go-ahead :wink:

First of all, there is no “one solution” that’s applicable. Different hardware, different settings, different firmware, different boards etc makes the total possible configurations probably in the unsigned long long range.

First of all is to understand the difference between a router and a switch, what they do and don’t.

  • A switch works in the Data link layer of the OSI model. Also called Layer 2 since it’s the second layer. For short I’ll use “L2”. Communication in the L2 segment between nodes are done using MAC-addressing. The PDU (Protocol data unit) in L2 is the frame. When a node wants to send a packet to an unknown node (IP) on the same network, it sends out a broadcast message. The node with the corresponding IP answers with its MAC-address, which is then used for addressing. Mapping IP’s to MAC’s is done with the Address Resolution Protocol (ARP).

.

  • A router (Residential gateway might be a better definition) works in the Network layer, or Layer 3. When a computer wants to communicate with something outside its own subnet, or can’t determine a destination address, the data is sent to the default gateway, i.e. the router. Routing is done between two network addresses (IP). The PDU in L3 is packet.
    .
    Depending on the hardware, it could be set to Gateway mode where NAT is enabled or Router mode where NAT is disabled. NAT must be enabled!
    .

The initial problem for the poster with a switch behind the router might have worked if subnet mask, default gateway and DNS server was specified. Without those, the poor thing doesn’t know with whom to communicate. Due to the (possible) absence of a hardwired MAC, manually setting it would be a good idea.

The lack of DHCP response could be attributed to an old/simple router (Residential gateway might be a better definition). I’ve read that some (old) routers can’t assign more then one DHCP-lease per port. So if two computers are connected switch->router, I guess the first booted gets the lease.

Using one default gw, one subnet and no VLAN (unless you really know what you’re doing), I can’t see why the W5100 shouldn’t work connected thru a switch. Doing it myself ATM just to be sure! :slight_smile:

Good explanation, would have been better in a current FAQ topic, but leaving it here for now.

But I am still closing this drawn out multi-participant topic. If anyone reading this still has relevant issues, please create a new topic with explicit details about your issue… not just a “Me Too” :wink: Thank you.