Show Posts
Pages: 1 ... 186 187 [188] 189 190 ... 422
2806  Using Arduino / Programming Questions / Re: Arduino Uno R3 being used as a web server periodically failing on: June 14, 2013, 01:24:16 pm
Does that mean it ran almost 2 hours and it still hasn't failed? Or it ran almost 2 hours and then failed.

I use this. It works well.
http://playground.arduino.cc/Code/WebServerST
2807  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield + arduino as a CLIENT, please help! on: June 14, 2013, 08:39:46 am
I am fortunate enough to have static public ips. If you have a static public ip available, then you can test it using your public ip. If not, you will probably be stuck with my code above. It should get you an ip address, etc.

Or you could set your router localnet ports "static" by disabling the dhcp server on that interface. It will be a private ip localnet, but the theory is the same. Once you have a working ip, all else is pretty much the same, with the exception that a static ip does not need to call Ethernet.maintain() to renew your ip.
2808  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield + arduino as a CLIENT, please help! on: June 14, 2013, 08:09:23 am
If the school does not have a dhcp server, then you can assign a static ip if the Ethernet.begin(mac) call fails. Something like this.
Code:
if(!Ethernet.begin(mac)) {
  Serial.println(F("DHCP failed. Setting static ip."));
  Ethernet.begin(mac, ip, gateway, gateway, subnet);
}
Serial.println(Ethernet.localIP());
2809  Using Arduino / Networking, Protocols, and Devices / Re: Serial Monitor Print From Outside Server on: June 14, 2013, 05:52:41 am
Quote
But when I substitute the: char serverName[] = "web.comporium.net";    which is used in the example code for my: IPAddress server(XX,XX,XX,XX);      code, and make the necessary changes in my GET line to pull the information I want from the website, it almost always hangs up.
Hangs up where? What is the last thing you see on the serial monitor when it hangs up?
2810  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield + arduino as a CLIENT, please help! on: June 14, 2013, 05:31:00 am
This works for me. Sends a request and reads the server response every 30 seconds.
http://playground.arduino.cc/Code/WebClient
2811  Using Arduino / Networking, Protocols, and Devices / Re: Connect() fails using Ethernet Board + Ethernet Library on: June 13, 2013, 03:04:39 pm
Did you allow tcp port 14531 through your Windows firewall?
2812  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet lockups/freezes/non responsive on: June 12, 2013, 06:02:43 am
@Artie: Good suggestion normally, but it is probably not a memory problem.
Quote
The hardware is an Arduino Mega 2560 with an R3 ethernet shield.
More than likely it is a freeze in the while(client.connected()) loop. If the server code does not receive the double cr/lf (blank line) from the client, which some port scanners do not send, the code locks up without the timeout code.

edit: If the connection breaks (fails) during the request send, that will have the same effect. If the server code does not receive the blank line or the close, it freezes there.
2813  Using Arduino / Programming Questions / Re: Ethernet Connection with Arduino on: June 12, 2013, 05:55:33 am
Part of your problem may be the format of your request. The request must end with a blank line. Also, is the file in a directory named /localhost/xampp?
Code:
if(client.connect(server, 80))
{
    Serial.println("Connected");
    client.println("GET /localhost/xampp/rec.php?name=Mahmoud HTTP/1.1");
    // send blank line after Connection: close
    client.println("Connection: close\r\n");
}
Here is my client code.
http://playground.arduino.cc/Code/WebClient
2814  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet lockups/freezes/non responsive on: June 12, 2013, 05:25:10 am
Hope it works for you. If it doesn't, try to find out where in the code it is failing and let me know. The last line that appears on the serial monitor before the crash usually helps troubleshoot it.
2815  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet lockups/freezes/non responsive on: June 11, 2013, 04:51:47 am
Try this web server code. It has a few error checking routines that help prevent the server from locking up.
http://playground.arduino.cc/Code/WebServerST
2816  Using Arduino / Networking, Protocols, and Devices / Re: Testing SD card with Ethernet W5100 shield ? on: June 10, 2013, 10:02:55 pm
D53 (default SPI slave select for the Mega) has nothing to do with the w5100 SPI slave select. That is D10. You need this in the setup() function before the SD.begin(4) call.
Code:
pinMode(10,OUTPUT);
digitalWrite(10,HIGH);
D53 should be set to OUTPUT by the SD library begin function call.

If you want to use the w5100 with a SD card in the slot, then use this before the Ethernet.begin() call.
Code:
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
2817  Using Arduino / Networking, Protocols, and Devices / Re: Testing SD card with Ethernet W5100 shield ? on: June 10, 2013, 07:52:04 am
By the time I pulled out the SD card, ethernet is working properly....why ??
Is it because of Chip Select conflict ? how to fix it ??
Probably, but not how you think. Both the SD and w5100 use the SPI bus. If this was an Uno, you would not have a problem according to fat16lib. The library begin function sets the default SPI slave select to output and high. That is D10 on an Uno, but not a Mega. So you are leaving the w5100 SPI slave select (D10) floating (INPUT and LOW). Sometimes it will trash up the SPI bus during the SD communication, and sometimes it won't.

Where in "the code" are you disabling the w5100 SPI? Looks like it is floating to me.

edit: The same applies the other way. If you access the w5100 without disabling the SD SPI, the SD card may or may not trash up the SPI bus, depending on the state of the floating slave select pin.
2818  Using Arduino / Programming Questions / Re: SoftwareSerial and Ethernet (UDP) 'hang' on: June 08, 2013, 03:04:26 pm
You can't use D10-D13 for the SoftwareSerial pins. Those are used for the SPI. That is how the ethernet shield communicates with the Arduino. Since you are using SoftwareSerial, I presume an Uno, so try D8 and D9 for the rx/tx pins instead.
2819  Using Arduino / Networking, Protocols, and Devices / Re: Testing SD card with Ethernet W5100 shield ? on: June 07, 2013, 06:33:17 am
It must be this code. I don't see any other reads that could cause it.
Code:
                    // send web page
                    webFile = SD.open("index.htm");        // open web page file
                    if (webFile) {
                        while(webFile.available()) {
                            client.write(webFile.read()); // send web page to client
                        }
                        webFile.close();
                    }
What is in the index.htm file?
2820  Using Arduino / Networking, Protocols, and Devices / Re: Testing SD card with Ethernet W5100 shield ? on: June 07, 2013, 06:04:43 am
The "funny y" (ΓΏ) is 255 (-1). Normally you would see that if you read a buffer that has nothing in it.

What version of the IDE are you using?
Pages: 1 ... 186 187 [188] 189 190 ... 422