Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

uploading a file from the server MCU to the computer system :

Status
Not open for further replies.

nikhilrajg

Member level 3
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..

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 !!! :cry:



Thank you.
Regards.
Nikhil Raj.
 

One method would be to initiate a FTP transfer.

I believe there are examples demonstrating the use of the FTP Protocol by the Microchip TCP/IP Stack.

BigDog
 
Thanks Bigdog for your reply..

Is'nt it possible using HTTP ? Anyways the data will be sent to the web page. Only the problem is to store that in a file.

Thank you.
Regards.
Nikhil Raj.
 

Possibly.

I've personal only used the FTP Protocol to transfer a file.

Have you implemented SD or MSD Flash Card storage?

BigDog
 

Hello,
No I haven't used such external storage. I have got a robot where I am not storing anything and I have designed a microphone circuit and want to add to the robot to lively record the voice. So I am not going to store anywhere on the external memory. I want that recorded data to be stored in the computer system which is connected via wi-fi router.

Well better to try with the FTP as you said. Thank you.

Regards.
Nikhil Raj.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top