|
2357
|
Using Arduino / Networking, Protocols, and Devices / Re: Uploading file from SD card to remote server?
|
on: March 21, 2012, 04:20:41 pm
|
client.write("(QUIT\r\n"); -> it's client.print("(QUIT\r\n"); (it's a real bug, because write only take the first char)
end in eRcv() thisByte is a char. (it's just to be more clear) -> char thisByte;
Ill go with the client.write(). That changed with v1.0 and later. It no longer takes a zero terminated string. My bad. It has been corrected. The variable thisByte should be an int. That is the return value size on client.read().
|
|
|
|
|
2361
|
Using Arduino / Networking, Protocols, and Devices / Re: Uploading file from SD card to remote server?
|
on: March 20, 2012, 06:52:37 am
|
This is the old code: char rtnVal[32]; sscanf(outBuf,"%*s %*s %*s %*s %s",rtnVal);
unsigned int hiPort,loPort;
sscanf(rtnVal,"(%*u,%*u,%*u,%*u,%u,%u",&hiPort,&loPort);
This is the replacement code: char *tStr = strtok(outBuf,"("); tStr = strtok(NULL,"(");
if(tStr == NULL) { Serial.println("No parenthesis"); } unsigned int hiPort,loPort;
sscanf(tStr,"%*u,%*u,%*u,%*u,%u,%u",&hiPort,&loPort);
Give that a try and see if it does better. If that works for you, I will go back and edit the original code. edit: I put the NULL test after the incorrect strtok call. It should be after the second strtok call. My bad.
|
|
|
|
|
2364
|
Using Arduino / Storage / Re: Arduino UNO + Arduino Ethernet Shield - can't read SD card
|
on: March 19, 2012, 12:19:44 pm
|
Digital pin 4 is the SS for the SD card. Try this in your setup() routine: Serial.print("Initializing SD card..."); // disable the ethernet SPI pinMode(10, OUTPUT); digitalWrite(10,HIGH);
// SD card SS pin is digital 4 if (!SD.begin(4)) { Serial.println("failed!"); return; } else { Serial.println("ok"); }
edit: change bad spelling.
|
|
|
|
|
2368
|
Using Arduino / Project Guidance / Re: Non-Blocking web server
|
on: March 18, 2012, 08:32:07 pm
|
So if I'm understanding right, the client.available function is NOT returning space available for outbound data, it's telling me how much incoming data there is?
That is correct. That is the receive buffer byte count.
|
|
|
|
|
2369
|
Using Arduino / Storage / Re: Ethernet Shield (SD Slot) & LCD combined problems
|
on: March 18, 2012, 06:35:59 pm
|
Ah, I see. Thanks alot for the insight. So there is no possible way for me to get a recording every 10 seconds as opposed to 16-17 seconds?
I did not look at the rest of the code to see where the holdup is. You should not have any problem with a 10 second update. The files take about a second at the most. You will need to figure out in your code where the time is being spent. Six to seven seconds should be easy to find with some well-placed Serial.println("At X") statements. Watch the serial monitor and wait for the unexpected pause in serial output.
|
|
|
|
|
2370
|
Using Arduino / Project Guidance / Re: Non-Blocking web server
|
on: March 18, 2012, 06:29:08 pm
|
|
I see what you mean. In that respect, it is blocking. If the tx buffer is full, it will wait for space to be available. It requires modifications to the ethernet library to access the function that provides that info.
uint16_t W5100.getTXFreeSize(SOCKET s);
Are you up to that?
|
|
|
|
|