I know that the ethernet shield is receiving the packets as the orange LED on the ENC28j60 when it is doing so. Using wireshark to inspect the packets I can see this happening. When trying to do a ping request I get "no response found". When I do a traceroute using UDP from the terminal, the packets are being sent but there is also no response. The only response I am getting is the ARP. When the Raspberry Pi asks who is at a particular IP address, the Arduino responds with the MAC address. I get the correct IP/MAC addresses here. When I tried to access the site that is hosted on the arduino I can see that the TCP sends the SYN but does not get a SYN/ACK back.
I have gotten rid of any whitespace when assigning IP/MAC addresses.
I have connected the Arduino to the Raspberry Pi via Ethernet cable. I have connected the ENC28j60 to the Arduino UNO via the following ports:
Vcc = 5v
GND = GND
CS = PIN 10/8 depending on which library I am using
SI = PIN 11
SCK = PIN 13
S0 = PIN 12
Any help would be greatly appreciated. Myself and my colleague have been working on this for a couple of days now and cannot figure out why it won't work for us.
ieee488:
If you try to access that Raspberry Pi webpage with a browser, what happens?
.
When trying to access the webpage I get
This page isn't working
192.168.0.10 didn't send any data.
ERR_EMPTY_RESPONSE
pylon:
Did you choose the correct baud rate (57600)?
Yes I have. Using the code below I recieve "⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮" in the serial moniter
pylon:
Post the actual code you used when testing this.
#include <SPI.h>
#include <UIPEthernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0xDE,0xAD,0xBE,0xEF,0xFE,0xED
};
IPAddress ip(192,168,1,177);
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; //wait for serial port to connect. Needed for native USB port only
}
// start the Ethernet connection and the server:
Ethernet.begin(mac,ip);
Ethernet.maintain();
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}
void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
Serial.println("new client");
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close"); // the connection will be closed after completion of the response
client.println("Refresh: 5"); // refresh the page automatically every 5 sec
client.println();
client.println("<!DOCTYPE HTML>");
client.println("<html>");
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
int sensorReading = analogRead(analogChannel);
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(sensorReading);
client.println("
");
}
client.println("</html>");
break;
}
if (c == '\n') {
// you're starting a new line
currentLineIsBlank = true;
} else if (c != '\r') {
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
Serial.println("client disconnected");
}
}
This code has given me the most results but still receiving the same errors.
pylon:
That's not the reliable signal to check for that, unfortunately.
I know this that is why I expanded on this saying
Using wireshark to inspect the packets I can confirm this happening. When I tried to access the site that is hosted on the arduino I can see that the TCP sends the SYN but does not get a SYN/ACK back.
pylon:
Sure, because that code is setting the baud rate to 9600. You have to select the baud rate in the serial monitor that is selected in the sketch.
Yeah I know, I have tried 9600 also and this gives me random characters such as "f.c,/?as;?"
pylon:
IPAddress ip(192,168,1,177);
and
This page isn't working
192.168.0.10 didn't send any data.
ERR_EMPTY_RESPONSE
Do you see the problem? (Hint: it's about IP addresses)
Ah yes sorry I copied the wrong response. Using that IP address was when I was using a different code example. But the error I get it the same regardless of what IP address. Sorry for the confusion, but I assure you I have been using the right corresponding IP addresses.
Yeah I know, I have tried 9600 also and this gives me random characters such as "f.c,/?as;?"
In that case check the cabling and/or your computer's drivers. Fix that problem first. Because without a debugging capability it's hard to fix network issues.
Try other sketches (without the ENC28j60 attached) which output serial information. Do they work? Do they stop working if the ENC28j60 is attached?