nikhilrajg
Member level 3
- Joined
- Mar 2, 2012
- Messages
- 63
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- Manipal,Karnataka,India
- Activity points
- 1,834
Hello,
How to upload a file directly from the running microcontroller ? I mean I am going to connect my PIC24F to the router via Wi-Fi connectivity. So now I want to upload a full file through wi-fi directly from the MCU to the computer. At the end I should see the file in one of the folders. So that I can access it from the web page.
From the demo app of Microchip's TCp/IP stack there is a code for Potentiometer..(Can be tried on Explorer-16 demo board) which displays the data directly on the web page. So I want this data should be stored inside a file. How to do this?
I tried this,, to create a file and append the content of the file as the data comes in..
Please someone do help... This is not working !!!
Thank you.
Regards.
Nikhil Raj.
How to upload a file directly from the running microcontroller ? I mean I am going to connect my PIC24F to the router via Wi-Fi connectivity. So now I want to upload a full file through wi-fi directly from the MCU to the computer. At the end I should see the file in one of the folders. So that I can access it from the web page.
From the demo app of Microchip's TCp/IP stack there is a code for Potentiometer..(Can be tried on Explorer-16 demo board) which displays the data directly on the web page. So I want this data should be stored inside a file. How to do this?
I tried this,, to create a file and append the content of the file as the data comes in..
Code:
void HTTPPrint_pot(void)
{
BYTE AN0String[8];
WORD ADval;
FILE *file;
file = fopen("file.txt","a+");
#if defined(__18CXX)
// Wait until A/D conversion is done
ADCON0bits.GO = 1;
while(ADCON0bits.GO);
// Convert 10-bit value into ASCII string
ADval = (WORD)ADRES;
//ADval *= (WORD)10;
//ADval /= (WORD)102;
uitoa(ADval, AN0String);
#else
ADval = (WORD)ADC1BUF0;
//ADval *= (WORD)10;
//ADval /= (WORD)102;
uitoa(ADval, (BYTE*)AN0String);
#endif
fprintf(file,"%d",ADval);
TCPPutString(sktHTTP, AN0String); //AN0String);
fclose(file);
}
Please someone do help... This is not working !!!
Thank you.
Regards.
Nikhil Raj.