Skip to content

[Ethernet] bunch of bugfix and improvements #2325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from

Conversation

Fede85
Copy link
Contributor

@Fede85 Fede85 commented Sep 25, 2014

Version 1.1 of the Ethernet library brings the following improvements:

  • support for W5500 and W5200 Wiznet chipsets
  • automatic detection of the Wiznet chipset
  • SPI speed set to 14MHz, maximum allowed by the W5100 chipset
  • generalized SPI_CS pin handling functions
  • added getMaxSockets() method
  • improved 3rd party compatibility using the SPI Extended API as a criterion of choice
  • removed redundant configurations and useless variable modifiers

@cmaglie
Copy link
Member

cmaglie commented Sep 26, 2014

@ArduinoBot build this please

@cmaglie cmaglie added this to the Release 1.5.9 milestone Oct 1, 2014
@cmaglie cmaglie added Library: Ethernet The Ethernet Arduino library feature request A request to make an enhancement (not a bug fix) Version: 1.5.x Waiting for feedback More information must be provided before we can proceed labels Oct 1, 2014
@cmaglie cmaglie self-assigned this Oct 1, 2014
@cmaglie
Copy link
Member

cmaglie commented Oct 1, 2014

/cc @BAG28

I see, on another thread, that you're searching for an Ethernet library with support for W5200, may you try this one? It should support W5100/5200/5500 with auto detection. I've tested it with a W5100 and W5500 but not with a W5200.

@embeddist
Copy link

@Fede85

I will check/test "ide-1.5.x-ethernet-W5500-2" and feedback you until this week.

@Fede85 Fede85 force-pushed the ide-1.5.x-ethernet-W5500-2 branch 2 times, most recently from ab0dfb0 to c23c597 Compare October 10, 2014 13:31
@BAG28
Copy link

BAG28 commented Oct 25, 2014

Hello, I dowloaded the whole SW today and checked the following with Example "Webserver"
Due + W5200 board 1 = assigned adress : most of times 0.0.0.0 sometimes erratic ones, in all cases no ethernet answer
Due + W5200 board 2 = no serial print answer
Due + W5100 = KO (assigned adress stick to 255.255.255.255, even after many resets)

Uno + W5100 = OK
Uno + W5200 board 1 = assigned adress : most of times 0.0.0.0 sometimes erratic ones, in all cases no ethernet answer
Uno + W5200 board 2 = assigned adress : always 0.0.0.0

Tries with Uno + W5200 board 2 and ethernet V2.0 found on internet is workin, so I think W5200 boards is working
For information
Uno + W5200 board 2 with SD Cardinfo is working fine.
Due + W5200 board 2 with SD Cardinfo is working fine.

All tests done in same(~) conditions : ethernet cable, USB port and dvt environment : arduino-PR-2325-BUILD-56
I hope this will help. Thanks for having involved me, even if I can't help much more.

@BAG28
Copy link

BAG28 commented Nov 10, 2014

Hi,
I'm still doing some trials.
I changed the ethernet cable, after seeing poor refresh of my DHCP server.
After many trials, reets and so on I got
Due + W5100 board is working fine reapeatable.
Same Sketch with Due + W5200 still not working
I observed that W5200 ship is heating-up on my two boards, and cannot touch it on board 1 after few seconds.
MAC adress is not seen on the network switch.
If I put some traces in W5200.cpp I can see that board is well detected.

@cmaglie
Copy link
Member

cmaglie commented Nov 13, 2014

@BAG28
thanks for the report! we got W5100 and W5500 working during our tests so, at least for them, we are now aligned with the results.

We didn't tried with a W5200 yet, after your test report we consider it not-working for now, unless someone else come up with a successful test.

@BAG28
Copy link

BAG28 commented Nov 13, 2014

Hi,
I am trying this version.
It is better : MAC adress is recognized by my switch. Some packets are issued by W5200 on the network. When trying to connect to the board, some packets are received but no connexion.
When scanning the network with "FING" sw on android phone, IP adress and MAC adress are correctly seen, but scan services gives no services (should see port 80).

I will pursue testing, maybe with DHCP given IP adress.
If you have some suggestions for testing, please let me know. If you need further information on my network layout, or other, please do not hesitate.

@BAG28
Copy link

BAG28 commented Nov 13, 2014

Hi again,
I did the test with DUE + Board 2, and I just tested on Uno + Board 1 : Same result.

@deonp
Copy link

deonp commented Feb 14, 2015

I believe the problem with the W5200 is because CH_BASE is 0x0400 for W5100 and 0x4000 for W5200 but both currently have a fixed 0x0400. I'll leave the implementation up to you @Fede85

@cmaglie cmaglie modified the milestones: Release 1.6.0, Release 1.6.1 Feb 18, 2015
@diverseg
Copy link

I agree with deonp, I believe the problem with the W5200 not working is because CH_BASE is 0x0400 for W5100 and 0x4000 for W5200.
but the .h file has it fixed
static const uint16_t CH_BASE = 0x0400;
I have a W5200 and will change this to 0x4000 and try this tonight.
if it works I'll look at a better solution.

@PaulStoffregen
Copy link
Contributor

Some time ago I created a modified Ethernet library that supports both W5100 & W5200 and automatically detects either. The code is here, if anyone's interested.

https://github.com/PaulStoffregen/Ethernet

One small gotcha I ran into with the W5200 chip is the reset signal really is required. I put it on pin 9. I found the W5200 can get out of sync if it hears other SPI communication and never recovers, never properly realigns by only the CS signal. If you don't use the reset signal, you can get lucky most of the time when other SPI chips aren't present. But unlike the W5100, reset before initializing the W5200 seems to be the only 100% reliable way to make the W5200 work.

@deonp
Copy link

deonp commented Apr 14, 2015

From memory there is also some issues with MAX_SOCK_NUM which is defined in Ethernet.h
The original MAX_SOCK_NUM was removed from the 5100.h file but there were two copies.
Therefore some changes are required to Ethernet / EthernetClient / EthernetUdp / EthernetServer objects as well to suit the 4 or 8 available sockets.

@cmaglie cmaglie force-pushed the ide-1.5.x-ethernet-W5500-2 branch 3 times, most recently from 69d0eb4 to c60d939 Compare May 12, 2015 14:54
@cmaglie
Copy link
Member

cmaglie commented May 12, 2015

@diverseg @deonp @BAG28
I've rebased the pull request and added the suggested fix for w5200.

@agdl
Copy link
Member

agdl commented Jul 12, 2016

This issue was moved to arduino-libraries/Ethernet#36

@agdl agdl closed this Jul 12, 2016
@agdl
Copy link
Member

agdl commented Jul 12, 2016

Sorry closed by mistake

@cmaglie cmaglie force-pushed the ide-1.5.x-ethernet-W5500-2 branch from 54e1e7c to 4f1b379 Compare December 1, 2016 19:40
@cmaglie cmaglie force-pushed the ide-1.5.x-ethernet-W5500-2 branch from 4f1b379 to a7cbf0b Compare December 1, 2016 19:42
@PaulStoffregen
Copy link
Contributor

I believe nearly all of this is now implemented in version 2.0.0, except getMaxSockets().

Going to close this old pull request.

@cmaglie cmaglie deleted the ide-1.5.x-ethernet-W5500-2 branch July 28, 2018 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request to make an enhancement (not a bug fix) Library: Ethernet The Ethernet Arduino library
Projects
None yet
Development

Successfully merging this pull request may close these issues.