Web server

Il dhcp sono abbastanza sicuro di non averlo disattivato ma poi controllo.
Per il resto utilizzo linux senza anivirus, firewall, ecc.

Ho provato con firefox e chrome.
Magari posso provare con Windows 7.

Non saprei proprio.

Se conosci qualcuno nella tua zona protesti vedere di sostituire la shield per vedere se è quella che non va.

Purtroppo no, sono solo in quest'avventura :drooling_face:

Hai collegato arduino + eth direttamente al pc come ti avevo suggerito di fare diversi post fa?

Sisi ma non è cambiato nulla.

Ciao a tutti rieccomi.
Questo è uno dei tanti sketch che ho provato:

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 150 };
EthernetServer server(80);
void setup()
{
Ethernet.begin(mac, ip);
server.begin();
Serial.begin(9600);
}

void loop()
{
EthernetClient client = server.available();
if (client) {
// an http request ends with a blank line
boolean current_line_is_blank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.println("client2" + c);
// if we've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so we can send a reply
if (c == '\n' && current_line_is_blank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
Serial.println("client2");
// output the value of each analog input pin
client.print("welcome to B2CQSHOP");
client.println("
");
client.print("//*************************************");
client.println("
");
client.print("");
client.println("
");
client.print("//*************************************");
client.println("
");
Serial.println("client");
for (int i = 0; i < 6; i++) {
client.print("analog input ");
client.print(i);
client.print(" is ");
client.print(analogRead(i));
client.println("
");
Serial.println("client1");
}

break;
}
if (c == '\n') {
// we're starting a new line
current_line_is_blank = true;
} else if (c != '\r') {
// we've gotten a character on the current line
current_line_is_blank = false;
}
}
}
client.stop();
}
}

Come vedete ho aggiunti delle Serial.print e questo è una parte dell'output perché gira all'infinito non si ferma mai:

 />

HOP
pe: text/html
K

 B2CQSHOP



******
ntent-Type: text/html

**************************

QSHOP
***********************************
/*************************************

*********

ml



*********************
2
lcome to B2CQSHOP



to B2CQSHOP
1.1 200 OK

***************
nt
 OK
.1 200 OK
lient2


1 200 OK
X
*********************************
****
 OK
00 OK
ient2
***********
¸¸Ï

 OK


QSHOP

tent-Type: text/html

?

**********
















e: text/html

: text/html
*********

I
to B2CQSHOP

log input 

¸Ï




client
200 OK

******************************






ient
*************************

*****************
-Type: text/html


br />
/>
******************
me to B2CQSHOP
B2CQSHOP
HTTP/1.1 200 OK

****************


nalog input 
me to B2CQSHOP

***********************

TP/1.1 200 OK

!

ient2
html

nalog input 

**********************************
welcome to B2CQSHOP


¸Ï
og input 

to B2CQSHOP
HTTP/1.1 200 OK


come to B2CQSHOP
ent2
nt2
¢

P

to B2CQSHOP


/1.1 200 OK

l
l
*****************
¸¸Ï


********************************
ntent-Type: text/html
2CQSHOP



0 OK


t-Type: text/html

Perché non fate girare lo sketch che ho inserito al post precedente e mi dite che succede sul vostro serial monitor?

Ho caricato anche io lo sketch che hai postato giusto per solidarietà:
ecco il serial

server is at 192.168.2.177
new client
GET / HTTP/1.1
Host: 192.168.2.177
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive

client disonnected
new client
GET /favicon.ico HTTP/1.1
Host: 192.168.2.177
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive

client disonnected
new client
GET /favicon.ico HTTP/1.1
Host: 192.168.2.177
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive

client disonnected
new client
GET / HTTP/1.1
Host: 192.168.2.177
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cache-Control: max-age=0

client disonnected

E allora niente da fare.
La shield non va.

Ne comprerò un'altra italiana. E' proprio vero chi più spende meno spende. $) Imparata la lezione.

Attenzione amici.
Ho provato a compilare lo sketch in windows ed ovviamente a caricarlo su arduino e tutto ha funzionato.

Nessuno ha mai provato a compilare questo sketch con linux?

Ho trovato anche questo post:

In particolare qui.

Ma sembra che non diano soluzioni.

Ciao,
ho letto velocemente il post e ti consiglio di usare sempre uno switch per collegare pc / router / arduino / tuttoilresto, purtroppo alcuni router con più porte ethernet hanno delle strane configurazioni che impediscono agli apparati di comunicare, per esempio vlan ecc.
Per quanto riguarda la scheda mi sembra un clone della vecchia eth shield ufficiale, che notoriamente aveva dei problemi, risolti sulle ultime versioni, per evitare inconvenienti mi sa che ti conviene procurarti una eth shield nuova originale, la riconosci facilmente perché ha i pin trasversali per saldare il modulo poe.

Sarà pure cinese ma il problema è che compilando con windows funziona e con linux no.
Come dicevo al post precedente c'è qualche problema che non ho solo io.

Possibile che nessuno sappia come compilare questo sketch in Linux?

Questi sono i pacchetti installati:

ii avr-libc 1:1.7.1-2 Standard C library for Atmel AVR development
ii avrdude 5.10-3 software for programming Atmel AVR microcontrollers
ii binutils-avr 2.20.1-2 Binary utilities supporting Atmel's AVR targets
ii gcc-avr 1:4.5.3-2 The GNU C compiler (cross compiler for avr)

effettivamente gcc-avr è la 4.5 ma di errori in compilazione non ne ho. Perchè non mi blocca in compilazione se in modalità verbose ci sono errori?

Posto gli errori in output della compilazione verbose (1/2):

In file included from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Ethernet.h:6:0,
                 from WebServer.cpp:19:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/Udp.h:39:0,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/EthernetUdp.h:40,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dhcp.h:7,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dhcp.cpp:8:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dhcp.cpp: In member function ‘uint8_t DhcpClass::parseDHCPResponse(long unsigned int, uint32_t&)’:
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dhcp.cpp:291:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Ethernet.h:6:0,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/EthernetClient.cpp:10:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/Udp.h:39:0,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/EthernetUdp.h:40,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:6:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp: In member function ‘uint16_t DNSClient::ProcessResponse(uint16_t, IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:285:29: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:285:29: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:287:50: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:304:28: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:304:28: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:313:29: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Dns.cpp:313:29: warning: dereferencing type-punned pointer will break strict-aliasing rules

Posto gli errori in output della compilazione verbose (2/2):

In file included from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Ethernet.h:6:0,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Ethernet.cpp:2:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Ethernet.h:6:0,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/EthernetUdp.cpp:31:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/Ethernet.h:6:0,
                 from /home/paolo/Scrivania/arduino-1.0/libraries/Ethernet/EthernetServer.cpp:7:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.cpp:3:0:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/paolo/Scrivania/arduino-1.0/hardware/arduino/cores/arduino/Tone.cpp:108:45: warning: only initialized variables can be placed into program memory area

disinstalla la 4.5.3 ed installa la 4.3.5 oppure aspetta l'uscita dell'IDE 1.0.1

Ottimo con la rc pare funzionare.

Grazie mille