small medium large xlarge

Back to: All Forums  Arduino
Generic-user-small
04 Dec 2011, 03:29
Mark Schlegel (7 posts)

I’m using a UNO with the standard ethernet shield with arduino version 0022 on Fedora 15. The problem I’m seeing is that I’ve downloaded the example code in msard-code.tgz and installed it. I then have tried the TimeServer.pde and the Email.pde as covered in the book. It starts to work for both but the serial console always fills with huge amounts of binary right after the println(“connected”) runs. For example, using the daytime example with time.nist.gov looks like this in the console:

Connecting…connected.

55899 11-12-04 02:45:55 00 0 0 597.8 UTC(NIST) * ava(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009))

*$ˆ)Ç¥ k‹&ðtÐvUcü‚¿cR¿÷ª»À¾×׳À’Þ̘@„Dc*‰X˜_KÁkÏ¡À&;X’a٥Ƃ

then I get tons more binary until I see a another daytime with the exact same time string. Usually I’ll get the same string three or so times and then the time stamp will be different and that one will repeat in the same way. So it’s like the connection is never dropped and the serial console gets filled with the daytime string, then binary, then the same daytime but then eventually the connection dropped and a fresh one is gotten from nist. Does this make any sense? This will continue forever until I press the reset button on the shield and pull the USB cable out.

BTW, I’m using the current arduino and arduino-core (version 0022) that’s in the Fedora package system but the latest is 0023 on the arduino.cc site, maybe there’s a problem in the Ethernet lib.

Note that I had to add the ‘gateway’ third argument to the Ethernet.begin() method because my network has an IPCOP gateway at 192.168.1.2

One more thing, I read on the Ethernet Shield http://arduino.cc/en/Main/ArduinoEthernetShield page this statement:

bq. Note that because the W5100 and SD card share the SPI bus, only one can be active at a time. If you are using both peripherals in your program, this should be taken care of by the corresponding libraries. If you’re not using one of the peripherals in your program, however, you’ll need to explicitly deselect it. To do this with the SD card, set pin 4 as an output and write a high to it. For the W5100, set digital pin 10 as a high output.

So is that my problem? The Ch 8 examples don’t show that you need digitalwrite(4, HIGH) but it’s true I’m not using the SD card but rather just the W5100

Maik_schmidt_avatar2_pragsmall
04 Dec 2011, 08:57
Maik Schmidt (122 posts)

Hi Mark!

Although it’s not very likely that this is the cause of the problem: did you set the right baud rate in the serial monitor? Did you only use the IDE’s serial monitor or did you also try an alternative one such as screen?

You said you have a W5100. Did you try pinMode(10, OUTPUT); digitalWrite(10, HIGH) as explained on the Arduino page? Did it have any effects?

Is it possible to connect the shield directly to the internet, that is without the gateway?

Cheers, Maik

Generic-user-small
04 Dec 2011, 16:07
Mark Schlegel (7 posts)

bq. did you set the right baud rate in the serial monitor?

My .arduino/preferences.txt says “serial.debug_rate=9600” and the code pde’s say the same for the Serial.begin() BAUD_RATE’s so that’s ok I think.

bq. Did you try pinMode(10, OUTPUT); digitalWrite(10, HIGH) as explained on the Arduino page?

I just now tried putting pinMode(10, OUTPUT); digitalWrite(10, HIGH) as the first two lines in the loop() for TimeServer.pde, I still get the binary junk in the console.

bq. Is it possible to connect the shield directly to the internet, that is without the gateway

Not really I’m on my home network and have to connect the LAN to the ISP with my firewall/router

Maik_schmidt_avatar2_pragsmall
04 Dec 2011, 17:50
Maik Schmidt (122 posts)

But you only have these problems when using the Ethernet shield, that is serial communication works as expected whenever you run sketches without the shield?

Generic-user-small
04 Dec 2011, 18:03
Mark Schlegel (7 posts)

Yeah, I was running an IR remote control sketch just fine with the console plus a few others. I was able to see the IR remote codes from my CD player remote and my TV card remote using the InfraredDumper sketch.

Could it be a weird insufficient power issue, I’m running the UNO and the ethernet shield just on the power coming in on the usb, do I need to plug some power into the power port?

Maik_schmidt_avatar2_pragsmall
04 Dec 2011, 18:07
Maik Schmidt (122 posts)

I don’t think it’s a problem with the power supply, because both the Arduino and the Ethernet shield only consume a very small amount of power. A standard USB port should be sufficient. If you have a DC adapter at hand you can give it a try, of course.

Have you double checked all connections, that is did you make sure that all pins of the ethernet shield fit nicely into the Arduino board? Have you tried another ethernet cable?

Generic-user-small
05 Dec 2011, 00:19
Mark Schlegel (7 posts)

I have the ethernet shield IP address in my dhcp on the LAN and I can ping and traceroute to it just fine. I’d think if the cable was bad the sketch wouldn’t upload at all and/or the ping wouldn’t work.

I’m getting the impression I have a broken shield.

BTW, is it important to set the subnet value in the Ethernet.begin(), your code didn’t but I’m wondering.

Generic-user-small
05 Dec 2011, 03:02
Mark Schlegel (7 posts)

Wow, I just found this thread:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1288813627/8

This sounds just like my problem with console corruption.

I’m using Fedora just like the person with the Ethernet shield problem there (he had Fedora 13 64bit, and I’m on Fedora 15 64bit). I’m not liking his workaround (changing linux distributions)

Maik_schmidt_avatar2_pragsmall
05 Dec 2011, 09:01
Maik Schmidt (122 posts)

That’s really a pity. Did you try the latest Arduino 1.0 release? Perhaps you have to slightly change your sketch, because the Ethernet library has changed. But if the console corruption has been fixed there, it might be worth it.

Generic-user-small
05 Dec 2011, 22:44
roman plevka (3 posts)

hi Mark, I have exactly the same problem.

using Fedora 15 x64, arduino 0022, Arduino Duemilanove. I’m facing the same weird output - this messy data stream makes my ethernet shield useless..

I was communicating with the seller and he sent me another shield with the arduino UNO board…and there was exactly the same issue… so I tried to download arduino 1.0 under windows 7 (64bit) and the problems are gone.

it’s weird, probably some kind of bug in the arduino soft build.

I registered here, to be able to communicate with you, maybe we can share our findings and experience.

Good luck! Roman (Slovakia)

Generic-user-small
05 Dec 2011, 23:45
roman plevka (3 posts)

Hello again Marc, good news, I just downloaded Arduino 1.0 for 64bit Fedora, and all ethernet shield code uploaded to my arduino via this version is working as designed!

finally the solution…I’ve been fighting with this issue for about a month.

http://arduino.googlecode.com/files/arduino-1.0-linux64.tgz

Generic-user-small
06 Dec 2011, 02:35
Mark Schlegel (7 posts)

Well, ok I got the version 1.0 installed using the ‘tarball’. So Roman, what do you do to get the 1.0 version to use the right USB device (/dev/ttyACM0 is the right one for Fedora’s usb serial port but the IDE says it doesn’t exist) —> nevermind, I made a link:

bq. cd /dev ln -s ttyACM0 ttyUSB0

So am I seeing things right in that the Arduino 1.0 IDE doesn’t build the old code in the msard-code.tgz file? For example when I try to build the TimeServer.pde from the book, the Client class constructor isn’t found:

bq. error: no matching function for call to ‘Client::Client(byte [4], const unsigned int&)’

By looking in hardware/arduino/cores/arduino/Client.h I see the trouble is that the signature for the class changed. (No constructor defined so it just uses the default ones: Client:Client() and Client:Client(const Client&) ). I guess going to 1.0 is a major update so they changed some APIs.

PS> another thing, don’t ignore the white sticker on the shield. Those 6 numbers are the MAC address you have to use. On the older shields you could just invent a MAC but on the current ones you’re supposed to use the proper one. I saw that sticker and at first thought it was a serial number. The EthernetShield page says it’s a mac.

Generic-user-small
13 Dec 2011, 19:52
roman plevka (3 posts)

Hey Marc, sorry for delayed answer. All I did was unpacking the tar file and running the arduino binary as it was…I had no problem with setting the right USB port, all settings (board, port) have been detected automatically.

  • btw. Server example is working fine, but I still experience problems with Client example. - still the same problem.

  • so I programmed the arduino under windows (I lost patience) on my other laptop.

Generic-user-small
23 Dec 2011, 09:53
Jack (1 post)

Hey Mark, I seem have the same problem to you.

You must be logged in to comment