I doubt it too. I used a Windows XP box to verify that my code was not buggy. I hear that 64 bit versions are having some challenges.
I did try it on windows 7 32bit, and also on windows xp 32bit emulated on VirtualBox ... again, I can ping it and all, but can't get webpage to work
Post your code and I will test it. ![]()
Using code from the last post in the first page of this topic. from Lideshi
This worked for me. I left my localnet ip/subnet/gateway intact, but you may need to change that to your localnet settings.
/*
Web Server
A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)
created 18 Dec 2009
by David A. Mellis
modified 4 Sep 2010
by Tom Igoe
*/
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0x02, 0xAA, 0xBB, 0xCC, 0x00, 0x01 };
byte ip[] = { 192,168,2, 2 };
byte gateway[] = { 192, 168, 2, 1 };
byte subnet[] = { 255, 255, 255, 0 };
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
Server server(80);
void setup()
{
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();
}
void loop()
{
// listen for incoming clients
Client client = server.available();
if (client) {
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// 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();
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(analogRead(analogChannel));
client.println("
");
}
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();
}
}
This is what my web browser shows when I request http://192.168.2.2 :
analog input 0 is 212
analog input 1 is 208
analog input 2 is 205
analog input 3 is 197
analog input 4 is 200
analog input 5 is 206
Nothing is connected to any of those pins, so...
still no luck, this is wireshark captured data, when I point my browser to arduino IP ... so there is some data coming back, but webpage does not load :s
Post your code. Don't change anything.
here it is:
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0x02, 0xAA, 0xBB, 0xCC, 0x00, 0x01 };
byte ip[] = { 192, 168, 5, 130 };
byte gateway[] = { 192, 168, 5, 1 };
byte subnet[] = { 255, 255, 255, 0 };
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
Server server(80);
void setup()
{
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();
}
void loop()
{
// listen for incoming clients
Client client = server.available();
if (client) {
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// 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.0 200 OK");
client.println("Content-Type: text/html");
client.println();
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(analogRead(analogChannel));
client.println("
");
}
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();
}
}
According to your last post, you are not requesting the correct ip.
http://192.168.5.130
Your last post shows you were requesting
http://192.168.5.144
changed ip from last test, I did point my browser to 192.168.5.130 this time don't worry ![]()
um, ok this is strange, now its working...
What, me worry?
Alfred E. Neuman
well, this is broken looks like, now its not working anymore.
Same code. Mine is still working.
analog input 0 is 221
analog input 1 is 215
analog input 2 is 213
analog input 3 is 206
analog input 4 is 208
analog input 5 is 212
??
same code, same IP, just reuploaded sketch and restarted arduino, worked for first two restarts, not working after third one
update:
could it maybe be too low voltage on the ethernet board?
On the ethernet shield, PWR, LINK, 100M, AND FULLDupex leds do work, with ocasional blink of TX & RX , but If i'm not mistaken, USB outputs around 5V, and my other power source I also tested with, outputs 7,5V ... could this maybe be the case? If not, any Idea how to troubleshoot it? Also last first time it worked, I unplugged my the ethernet shield, replugged it back, and applied power, and it worked. Webserver worked normally. Now even that does not help. :~
Now If something is broken, how can I figure out if its Arduino mega or ethernet board?
Thanks for helping SurferTim btw
What OS are you using to program it? Windows or Linux?
The minimum voltage recommended on the power jack is 7v. The power jack uses a regulator. The USB does not. You might want to check the power on the 5v pin when the Mega is powered up to insure you are getting 5v there. Might as well check the 3.3v while you are checking.
Have you tried it powered with the USB? That is how I am testing this. I also use the Serial functions to troubleshoot. If you still have trouble, you might want to add a Serial output to help you figure out if it is the receive or the send that is failing. I can help with that.
Edit: I just checked my device. I forgot to upload my program into it yesterday, so it is still running your code. It still works fine.
What is the current rating on your 7.5v power supply?
Ok, did some more testing.
Blink program works ok. theres 5V on pin 13.
3.3V to GND 3.28V
5V to GND 4,87V
The adapter I got now, 12V (11,4V) 1,5A
When the web server was working, whole thing was plugged into usb only
as for OS that I tested with:
Windows 7 64bit
Windows 7 32bit
Windows XP 32bit
Considering it works ok on the USB, then I suspect thermal shutdown on the 5v onboard regulator (overheat). How is the temperature on your regulator? Is it getting hot when the ethernet shield is connected?
A 12v power supply may be too much for the regulator thermally. From what I can tell, this regulator is linear, not switching. It will get hot and shut down if too much voltage is applied.
Nothing hot on my board, apart from wiznet chip on ethernet shield that feels warm, but not hot
I just tested mine on a 9v supply with the ethernet shield on. When I touch the bottom of circuit board between the USB and the power jack (under the regulator), it gets too warm to touch comfortably in just a few seconds. I disconnected it and went back to the USB power. That was too hot.
12v would make it hotter.
With USB power, it is cool there.