Show Posts
Pages: 1 2 3 [4] 5 6 ... 392
46  Using Arduino / Programming Questions / Re: Not writing to SD on: July 15, 2014, 08:02:56 pm
Explain what part of the code writes the "header". Is it this?
Code:
  myFile.println("ADC,Time");
47  Using Arduino / Programming Questions / Re: Not writing to SD on: July 15, 2014, 06:24:43 pm
Which Arduino are you using? If it is an Uno, you can't use D13 for the lcd display. That is the SPI SCK pin.

48  Using Arduino / Storage / Re: Why don't sdcard and rfid reader share the same pin? on: July 15, 2014, 05:43:46 pm
That is ok. The MOSI, MISO, and SCK pins are shared pins. All SPI devices share those pins. The pin they can't share is the slave select pins. Each device must have its own unique slave select.
49  Using Arduino / Interfacing w/ Software on the Computer / Re: How to add .js and .css files in a arduino-SD card hosted website ? on: July 15, 2014, 03:41:59 pm
You are probably correct. Your code seems to be faulty. Here is the section of code with the problem. If the request contains the string "ajax_inputs", it sends a header and the XML stuff. Otherwise, it sends a header and the index.htm file. The js files are not sent correctly. They would be sent after the index.htm file.
Code:
          if(StrContains(HTTP_req, "ajax_inputs")){
            //send rest of HTTP header
            client.println("Content-Type: text/xml");
            client.println("Connection: keep-alive");
            client.println();
            //send XML file containing input states
            //Serial.println("XMP_RPM_MPH(client)");
            XML_RPM_MPH(client);
          }

          else {  //web page request
            //send rest of HTTP header
            client.println("Content-Type:text/html");
            client.println("Connection: close");
            client.println();
            //send web page
            Serial.println("Sending Index.htm");
            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();
            }
The "else" should be an "if(StrContains(HTTP_req, "index.htm"))".
50  Using Arduino / Networking, Protocols, and Devices / Re: Problems with UDP on: July 15, 2014, 01:27:54 pm
Apology for the delay in my answer, but I was surfing.

If Udp.endPacket() hangs, it is probably because it is having trouble delivering the packet. Does it hang forever, or just for a while?

Even though the reference documentation does not specify a return value for Udp.endPacket(), it does return a value. It returns 1 if the packet was sent to the:
1) device if the destination device is localnet,
or
2) gateway if the destination device is not localnet,

or 0 if it wasn't sent.

Use this to determine the status of the send:
Code:
if(!Udp.endPacket()) Serial.println(F("packet send failed"));
else Serial.println(F("packet sent ok"));
The 1 return value does not indicate the packet reached its destination, just that the first device en route to the destination device took the packet.
51  Using Arduino / Project Guidance / Re: Arduino udp and processing udp on: July 15, 2014, 10:47:31 am
Bear in mind that 'A' (0x41) does not equal 'a' (0x61).
52  Using Arduino / Networking, Protocols, and Devices / Re: Problems with UDP on: July 14, 2014, 10:02:47 am
So from what I read, the Arduino is receiving packets from the Mac, but no packets received on the Mac? If so, check the Mac firewall.
53  Using Arduino / Programming Questions / Re: convert string to int on: July 14, 2014, 08:32:36 am
There is a difference between string (character array) and String (data type). atoi accepts only the character array type.
54  Community / Website and Forum / Re: Nick Gammon on: July 14, 2014, 08:17:14 am
Thanks, John. I guess you may be correct. I miss his contributions here.
55  Using Arduino / Programming Questions / Re: Ethernet Shield connection issue on: July 14, 2014, 08:08:52 am
I usually check the dhcp server address pool in the router. I use an IP within the localnet but outside that pool. No duplicate IPs on that localnet allowed. My routers are fault tolerant about that, but some aren't. Some routers will not recognize or communicate with an IP in the dhcp range if it did not issue that ip.
56  Community / Website and Forum / Nick Gammon on: July 14, 2014, 08:01:29 am
Anybody know what happened to Nick Gammon? I have not seen a post since February. I tried to send a PM to him to see if he was ok, but got this message when I tried:
Quote
User 'Nick Gammon' has blocked your personal message.

I still use his "blink without delay" code. I miss reading his stuff.
57  Using Arduino / Programming Questions / Re: convert string to int on: July 14, 2014, 07:12:08 am
What is difficult about atoi?
Code:
char myCharInt[] = "49";
int myInt = atoi(myCharInt);
58  Using Arduino / Networking, Protocols, and Devices / Re: AdaFruit CC3000 tutorial connection error on: July 14, 2014, 06:34:49 am
The server is reporting a PHP parse error, not a connection error. This is line 7 in that file.
Code:
$myFile = “/~Peder/wifi-weather-station/temp_data.txt";
The file location is probably not correct. Use the local directory path, not the Apache path.

edit: I did not notice the leading double quote is not correct until I posted line 7 here. Do you notice it is different than the trailing double quote? They should look the same.

You did not post the entire Apache access log, but I will presume the status code returned was "500 - Internal Server Error".
59  Using Arduino / Programming Questions / Re: Ethernet Shield connection issue on: July 14, 2014, 06:19:17 am
You cannot use an IP that is already in use. Do not use the IP of the computer's network adapter on the Arduino.

You cannot use a mac address that is already in use.

60  Using Arduino / Programming Questions / Re: Ethernet Shield connection issue on: July 13, 2014, 10:38:56 am
From a command prompt on the Windows computer, enter ipconfig. It will display the network settings for all network devices.
http://en.wikipedia.org/wiki/Ipconfig
Pages: 1 2 3 [4] 5 6 ... 392