I recently bought me the Arduino Ethernet board and I've just started trying the examples. But there's a problem:
No matter what (Ethernet)sketch I upload to the Arduino, it always returns some strange text when I try to telnet to the Arduino.
This text contains sometimes the message I'd like to send, but mostly characters which look that what you see when you have an invalid Baud-Rate on a serial port.
For example:
In this case, you can see what I wanted to send, it was some HTML.
The problem occurs with every sketch I've tryed, even with the examples of the Ethernet library.
That could be the microSD card reader SPI interfering with your ethernet SPI.
void setup()
{
pinMode(4,OUTPUT); // set SD SPI slave select pin to OUTPUT
digitalWrite(4,HIGH); // disable SD SPI interface. HIGH is disabled.
// now do your ethernet setup stuff.
}
I tried your suggestion, it didn't work.
Here is the sketch I've tried:
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x90, 0xa2, 0xda, 0x00, 0x61, 0xf1 };
IPAddress ip(10,42,43, 2);
EthernetServer server(80);
void setup()
{
pinMode(4,OUTPUT); // set SD SPI slave select pin to OUTPUT
digitalWrite(4,HIGH); // disable SD SPI interface. HIGH is disabled.
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
}
void loop()
{
EthernetClient client = server.available();
if (client) {
client.println("Hello World!");
client.stop();
}
}
Maybe it has to do something with my setup?
I've got a notebook with an UMTS internet stick. On this notebook, I share the UMTS connection to the Arduino, which is connected using a normal patch cable. This is supported by my network adapter (I've tried it with other computers).
The Arduino has the static IP-Address you can see in the sketch and it is powered through USB.
EDIT:
Maybe it's a problem with the memory? I've changed the string in client.println() and it outputs me the old string + the new string...
Yes.
It (should) work. Telnet only sends text over the network, if you run
telnet www.google.com 80
for example, you can "talk" HTTP to Google.
But even when I run the "ChatServer"-Example (which explicitly sais "To use telnet to your device's IP address and type.") it doesn't work.
?
But I think this is not the problem! I've tried the SD library, and it doesn't work too. I have set the SS port for the Wiznet chip (10) to high, as you suggested for the SD card, but the lamps of the RJ45 connector were blinking. So I think there's a general problem with the SPI.
But I think this is not the problem! I've tried the SD library, and it doesn't work too. I have set the SS port for the Wiznet chip (10) to high, as you suggested for the SD card, but the lamps of the RJ45 connector were blinking. So I think there's a general problem with the SPI.
Sorry, but I do not understand what you are actually trying to do.
OK, ignore this post. It was my fault. EDIT:
Probably got a solution! See here Arduino Forum.
It's a bug in gcc. Another edit:
Got it working now, using the solution prowided here: Google Code Archive - Long-term storage for Google Code Project Hosting.
No the Ethernet part works, but not the SD...
I think I've set all the CS lines to the SD card an the W5100 correct, but the initialisation always fails. I've also tried using the card.init() function with a CS port specified, didn't work even. Any suggestions what I'm doing wrong?