I was fascinated by the demonstration by 'pepsiman' http://pepsiman.tistory.com/67using Wiznet WIZ811MJ, which employs the same W5100 as used in Arduino Ethernet Shield Arduino Ethernet Shield - DEV-09026 - SparkFun Electronics, interfaced to the Duemilanove for ethernet connection, sending some A/D signals on the internet.
I received the WIZ811MJ a few days ago, and made connections of 6 wires,D10-D13 and 3v3/Gnd of Arduino, and pin1 and pin2 of J1, pin3 and pin4 of J2, pin1 and pin9 of J2 for 3v3 power/gnd.
I found the MAC address for my PC and ethernet ip address, inserting the info to the demo Arduino program, Examples/Library-Ethernet/WebServer.
Uploaded program onto the Duemilanove seemed OK.
When I tried to connect to the ip address, on which I connected the Wiz811MJ with Arduino, I did not get any message.
Would there be some other preparations such as Firewall unblocking or temporary disabling of virus detecting programs, either MS Explorer or other commercial products?
Any suggestions are welcome.
Bryan.
p.s. I tried to insert my picture of the connections of Wiz811 and Arduino, but failed.
I found the MAC address for my PC and ethernet ip address, inserting the info to the demo Arduino program, Examples/Library-Ethernet/WebServer.
That could be your problem. You need to have a different MAC address and IP address to connect to it.
Try adding 1 to the last number in your ip (if it is "192,168,1,100" change it to "192,168,1,101").
The gateway is important to (for some of the samples). This should be set to the same as your computer's gateway. If your IP is "192,168,1,100" - the gateway should be something like "192,168,1,1" in your sketch.
The firewall should not be a problem for the example sketches, if you can web browse the internet, you should be able to web browse your arduino at the new address like this:
I've tried the suggestion for the ip address. When I sat down in front of one of my 7 Lab PC's, which are interconnected under a Netgear product, with numbers 192.168..191,192, 193, 194, .. 197, I found it has ....193. I changed the ip address to {192, 168, ***, 194}, in the sketch, as you have suggested. This PC has common gateway of 192.168. *** .1. One thing I don't have any idea is where to put the gateway statement in the example Arduino sketch.
//source - Arduino example sketch -
#include <Ethernet.h>
byte mac[] = { 0x00, 0x0B, 0xCD, 0xB9, 0xDB, 0x** };
byte ip[] = { 192, 168, ***, 194 };
byte gateway[] = { 192, 168, ***, 1};
Server server(80);
void setup()
{
Ethernet.begin(mac, ip, gateway);
server.begin();
}
void loop()
{
Client 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();
// 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();
// output the value of each analog input pin
for (int i = 0; i < 6; i++) {
client.print("analog input ");
client.print(i);
client.print(" is ");
client.print(analogRead(i));
client.println("
");
}
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;
}
}
}
// give the web browser time to receive the data
delay(1);
client.stop();
}
}
deleted former comments-
When I add gateway-related statements, it works perfect.
(Without the gateway statesments, it did not.)
I am enjoying the Wiz811MJ connection with my Duemilanove now.
One more question:
The connection solution works excellent within a boundary of the lab sharing the same gateway.
What happens if the ip address is sort of fixed one given almost permanently within a company or a university? My concern is that there might already be someone using the last two digit + 1 of the ip address.
You could use DHCP to get an unused address on the subnet and go with that, but on a server that means somehow telling your clients what that address is. It may be more suited for client work than server (DHCP is in general, unless you assign a static address within DHCP itself.)