Hello,
I just received my Arduino Ethernet and tried some example sketches. Most of them worked, but all Ethernet related examples refused to work. To track down the problem I use the following sketch:
/*
* Prints a message on serial console
*/
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xF0, 0x59 };
//EthernetClient client;
void setup() {
// start the serial library:
Serial.begin(9600);
// print your local IP address:
Serial.println("Hello I'm your arduino");
Serial.println("Trying to get an IP Address...");
}
void loop() {
}
This sketch works until I activate the line //EthernetClient client; by removing the comment.
The sketch doesn't work anymore (no serial output).
It should get one by dhcp. But it doesn't matter because as soon as I use any ethernet related feature (notice I just want to instantiate client object) the program stops to work at all.
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xF0, 0x59 };
IPAddress ip(192,168,10,22);
EthernetClient client;
void setup() {
// start the serial library: Serial.begin(9600);
// print your local IP address: Serial.println("Hello I'm your arduino"); Serial.println("Trying to get an IP Address...");
Ethernet.begin(mac,ip);
}
void loop() {
}
Still no answer via serial console.
Edit1:
I narrowed the problem down to the wz5100 functions. As soon as one of Ethernetserver or Ethernetclient is used, the arduino stops working. If I only use Ethernet.begin(mac, ip) I can at least ping the arduino.
Edit2:
Problem seems to be the toolchain on my amd64 linux box. On my windows machine everythings ok now.
This is sad. I tried avr-gcc-4.5.3 and avr-gcc-4.3.6 both without success.
Does anybody know which combination of avr-gcc / avr-libc is working on amd64 linux ?
Hi,
I changed those lines but unfortunately it doesn't help.
I also tried the "blink" example this morning and found out it doesn't work on linux, too.
Can you post me your toolchain versions (avr-gcc, avr-libc) ?
Thanks
Update
Oh well, I think I bought a hell lot of problems with these µController things.
First the blink example can be "fixed" as described here Arduino - ArchWiki
Seems that the avr-toolchain is awfully broken. Not only avr-gcc and avr-libc also binutils is affected.
Now on to find out which combination works correctly
I was facing a similar problem here, but I am using a 32 bits workstation. To fix the issue I followed the steps of Reply #5 but it wasn't enough, so I have updated all the Ethernet utilities sources [1] and now it is working. I will do more tests but looks like it is fixed for me. I hope it can help you too.
Have you tried it with or without DHCP? I am still unable to connect to the internet using static IP, but I can connect to the internet with DHCP. I can ping the Arduino interface using both modes but can't access the internet with an static IP. I have tried passing the gateway and the subnet too, without success.
Well,
first of all with IDE on windows all modes work fine.
On Linux no mode works at all. It didn't even succeed the init of e.g. EthernetClient object.
I would like to add some a little comment. Looks like we have a bug at Ethernet class. Following another topic at this forum [1], I have found that Ethernet.begin method expect a different parameter than exposed at the documentation.
version 0022 Ethernet.begin(mac, ip, gateway, subnet);
version 1.0 Ethernet.begin(mac, ip, subnet, gateway);
Yes, I have just found it out. There is an updated documentation where we can look at this? I am new with arduino too, so I am not really sure where to get this updated documentation. Thanks a lot for your help.