Pages: [1]   Go Down
Author Topic: Strange characters on Arduino Ethernet?  (Read 1370 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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:
Code:
2��j`�u�t@���}A#ٴ9aw��a�Fđ�
                                                                              �0��ܷ�&Z���ꄚ�<�DžPp�[E�:�#�EDW��Y_���?�Ɛ�=X��]Cr������y�T1)P�� ��"��=��u�)(L\�QH�f�D`�Z�'"Z�9���$����Z����LQ�ơ�5��By �w�0&���
e��0��������X�NB4��/�X(�87��ﮓ6A1�l�4�-rT]v�����ߺɺ�Y�#�Y��R�V���Z-�~�3oV9Uk ����D��- ����m���}���>2�(��`�Sx��w�n��8�:���lPQ�'��~�>J����96�ȁ�l�kU]T9�`(
           �Y[C��5̵�<�˧p=�#ޜ
!��k��ӌ*��X�+�~<!У⃔���m8j嘷
</tr>
</table>
<br>
<form method=get><input type=submit name=all value='Alles aus'></form>
</body></html>
2222'><form method=get><input type=submit name=4 value='ausschalten'></form></td>
<td align='center'><font color='#CFCFCF' size='5'>OFF
</tr>222'><form method=get><input type=submit name=4 value='einschalten'></form></td>�o�yߑ��8���A���DH�y‘��J��j1���HP�*�1����g`O 1��'��a���<#f�X��Y���W��5 �S�gQ� 9�TL,v�u5�K5�a`
                                                   {n��N
                                                        O�v
Z$�KC\I��q��$����S�F\��h�X,c�q�P�bX��y�U\� �I
                                                      oG&�j��&�r%�(�`!rWl�VP
D�o�%�\�Vr<�x�R�]t�7}&t��WU���~*�i�3�~E!���#C-AP�D+�本�x���
                                                                  �%,aˆ�͡.(P����k6"�!���/x�J
             ��nLKt!kb���Q��W�3� �-�)��s��쫾@A]\Ij��=�ć��s;��b��wR"Z��ɕ��0n`��~�4�'
�=Fdb$�A h���V�_����9�[�Ed�3��z���inL9�ʸ
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.

Any idea where my problem is?

PS: Excuse my bad english, I'm from Germany
« Last Edit: December 29, 2011, 11:48:49 am by darthsimon123 » Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 149
Posts: 6117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That could be the microSD card reader SPI interfering with your ethernet SPI.
Code:
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.
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried your suggestion, it didn't work.
Here is the sketch I've tried:
Code:
#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...
« Last Edit: December 25, 2011, 10:04:14 am by darthsimon123 » Logged

'round the world...
Offline Offline
Faraday Member
**
Karma: 42
Posts: 3289
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe you have too many strings in memory? Have you tried sending the bare minimum and see if this happens again?
Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Have you tried sending the bare minimum and see if this happens again?
The same: The old string is displayed + the new string + the strange characters
Logged

France
Offline Offline
Sr. Member
****
Karma: 2
Posts: 380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What kind of arduino is the main board ? Uno, Mega ?

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As I said:
Quote
I recently bought me the Arduino Ethernet board
It is this one here http://www.arduino.cc/en/Main/ArduinoBoardEthernet
Another thing: I think those characters are not as random as they look. They're almost the same every time they are transmitted.
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9686
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
No matter what (Ethernet)sketch I upload to the Arduino, it always returns some strange text when I try to telnet to the Arduino.

You are trying to access the arduino http server using a telnet application?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes.
It (should) work. Telnet only sends text over the network, if you run
Code:
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.
« Last Edit: December 25, 2011, 01:01:38 pm by darthsimon123 » Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9686
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I try the the telnet, I get the below, much of which appears to be the binary conents of the "image/png;base64,".

Quote
HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 11782
Date: Sun, 25 Dec 2011 20:14:59 GMT
Server: GFE/2.0

<!DOCTYPE html>
               <html lang=en>
                               <meta charset=utf-8>
                                                     <title>Error 400 (Bad Reque
st)!!1</title>
                <style>
                           *{margin:0;padding:0}html,code{font:15px/22px arial,s
ans-serif}html{background:#fff;color:#222;padding:15px}body{background:url(data:
image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKsAAADVCAMAAAAfHvCaAAAAGFBMVEVYn%2BH%2
F%2F%2F%2Bex%2B3U5vd7s%2Bfq8%2Fs0itq72PMLUPvtAAASvklEQVR4AbXBC0JqCQxEwT5Jd7L%2FH
c8FdR4g%2BEGtEr8u%2FBHxu7otdzd%2FQPyqlmRp1Pw%2B8aukDfRa1fw28ZtWy4sa89vEb7LCi0zx2
8RvqgkvouW3id%2FU8pbtWmv5beJXRWNrRmp%2BnfhlHXZm%2BQPi95Vk%2FoD4fZbMHxC%2FryTzB8T
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you typed
Code:
GET / HTTP/1.1
Host: www.google.de
[empty line]
?
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.
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9686
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, ignore this post. It was my fault.
EDIT:
Probably got a solution! See here http://arduino.cc/forum/index.php?topic=81846.0.
It's a bug in gcc.
Another edit:
Got it working now, using the solution prowided here: http://code.google.com/p/arduino/issues/detail?id=605&start=200
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?
« Last Edit: December 29, 2011, 11:48:20 am by darthsimon123 » Logged

Pages: [1]   Go Up
Jump to: