Show Posts
Pages: 1 ... 156 157 [158] 159 160 ... 392
2356  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
2357  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.
2358  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
2359  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);
2360  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.
2361  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.
2362  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?
2363  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?
2364  Using Arduino / Storage / Re: SD.h library - error handling. on: June 04, 2013, 06:11:37 am
How do you get that error? SD.begin() returns true on success and false on fail.

What device are you using? Is it just an SD card or some other device on the shield also? Any other SPI devices connected to the Arduino?
2365  Community / Bar Sport / Re: Keep weapons off Arduino forum and website on: June 03, 2013, 03:58:48 am
Quote
I am not against the personal possession of guns like revolvers and shotguns,
Yes I feel a lot happier at the thought of being killed by a shot gun or revolver so much more personal.
Or beat to death with a club or rock? Maybe stabbed with a sword or spear is better? You could destroy all the firearms on the planet, and humans would still find a way to kill each other.

People talk like the first murder victim died from a gunshot wound.
2366  Using Arduino / Programming Questions / Re: Pullup Resistor Anomaly on Pin 13 on: June 03, 2013, 03:45:43 am
If there is nothing else connected to D13, it is floating. D13 connects to a high impedance op-amp to drive the LED. If you leave the input floating, the state of the output is not guaranteed. If D13 floats to a HIGH state, the LED lights.
2367  Using Arduino / Project Guidance / Re: Manage SD files remotely from PC. on: June 02, 2013, 11:09:50 am
I used PuTTY to test this stuff. It works just like I am telling you. The w5100 does not indicate "connected" on a socket until it has something in the rx buffer. You can connect, and the shield shows nothing. Send that one GET line to put something in the rx buffer, and suddenly you are connected.

If that is not the way it turns out for you, I would like to know that.
2368  Using Arduino / Project Guidance / Re: Manage SD files remotely from PC. on: June 02, 2013, 08:46:17 am
Take a look at this code:
http://playground.arduino.cc/Code/FTP
The first thing it does after the connection is established is wait for the FTP server to send a "hello". I would guess that the connection is not showing as established because that particular code is not sending the hello. The web browser may actually establish the connection to the ethernet shield, but when it does not receive a "hello" from the Arduino, then you get the unsafe port message. I have not checked the network packets.

edit: That is why I posted this warning in reply #9:
Quote
Don't mix protocols. The server response for a FTP connection is different than a HTTP connection.
2369  Using Arduino / Project Guidance / Re: Manage SD files remotely from PC. on: June 02, 2013, 07:43:19 am
Quote
It's clear this is on the right lines because changing the client has changed the behaviour, but according the the evidence given it shouldn't have made any difference - the problem described was that the server did not see any incoming connect request.
It did not receive a connection request because IE and Chrome do not allow any type of port 21 connection. Chrome displays the message "unsafe port" and does not attempt to establish a connection. Try it!

edit: You would have the same problem with a SMTP server. The client does not send a request. The server sends a "hello" first. Then the SMTP client responds to that hello. In this case, you do not show a connection until the client sends something. But the client will not send anything until the server sends a "hello". But you are not sending a "hello". Deadlock.

If you want to test this, fire up PuTTY and connect to the Arduino with port 21 and RAW mode. When it connects, don't enter anything. Check the Arduino. No connection. Now type "GET / HTTP/1.0" and press the enter key only once. Now you will get a "connection" message on the arduino, but it will not send a response until you press the enter key again.
2370  Community / Bar Sport / Re: Keep weapons off Arduino forum and website on: June 02, 2013, 07:01:29 am
Just to make my position clear, I am not as much of a pacifist as it appears from that one statement. It is  bad enough that these weapons are in the hands of the military establishments worldwide, but to have them in the hands of drug cartels or terrorist organisations, that is something completely different.

I am not against the personal possession of guns like revolvers and shotguns, just certain types. Here are some weapons I do not think civilians should be able to own:
automatic AK-47
40mm grenade launcher
105mm howitzer
RPG
cruise missile
TOW missile
Pages: 1 ... 156 157 [158] 159 160 ... 392