View previous topic :: View next topic |
Author |
Message |
tranz
Joined: 10 Feb 2007 Posts: 78
|
Remote Installation |
Posted: Wed Jan 16, 2008 7:17 am |
|
|
Hey guys,
I am facing a problem and was wondering if you guys can give your experienced insights on it.
I have developed an internet communications module for inverters, where in the data of the inverter is displayed on a webpage. This communications board is based on the CCS internet kit. Only difference is 18F8722 and RTL8019AS as the ethernet controller.
Now my question is, is it possible to remotely transfer a 16Kb file to an external memory eg 24LC256 through the ethernet.
Would appreciate any response on this, cause it seems I have hit a dead end.
Thanks |
|
|
SET
Joined: 15 Nov 2005 Posts: 161 Location: Glasgow, UK
|
|
Posted: Wed Jan 16, 2008 7:21 am |
|
|
You could use TCP or UDP to transfer packets to the remote device, which would then re-program the external EEPROM. Higher level file based protocols such as FTP could also be used, but in that case you would need some sort of filesystem at the remote end. |
|
|
tranz
Joined: 10 Feb 2007 Posts: 78
|
|
Posted: Wed Jan 16, 2008 12:26 pm |
|
|
All I have at the remote end is the PIC and the ethernet controller (RTL8019AS) which has a 1kb buffer space and an external EEPROM device. Although there are buffers available, I am still unable to think of how to join the 1Kb packets into 16.
Then again if this can be done, how can the packets be sent to the remote embedded device ( by this I mean the formation of the packets).
Example : if the 16Kb file is a binary one, what kind of algorithm can be used for dividing the packets into 1500 bytes sized packets (for TCP). |
|
|
SET
Joined: 15 Nov 2005 Posts: 161 Location: Glasgow, UK
|
|
Posted: Thu Jan 17, 2008 9:55 am |
|
|
You wouldnt attempt to send all 16k, you would send in smaller chunks (say 512 bytes), which would easily fit in a TCP packet. So you would have something like:
[command to reprogram EEPROM] [block number] [data bytes] [checksum]
defined within your TCP packet. |
|
|
Coco the monkey Guest
|
|
Posted: Thu Jan 17, 2008 10:07 am |
|
|
Look into using TFTP [Trivial File Transfer Protocol]. It's kind of a stripped-down version of FTP that runs over UDP. A TFTP server is very simple to write for a PIC. If you bought the CCS compiler, you should have access to the TFTP server code that's included with the CCS TCP/IP examples. |
|
|
tranz
Joined: 10 Feb 2007 Posts: 78
|
|
Posted: Thu Jan 17, 2008 12:32 pm |
|
|
coco,
In this case I cant just use the tftp server, see I already have a TCP based web server and I need it, so there is no point in changing it to a tftp based server. So sending small TCP packets to the board makes more sense.
But I will look into it, lets see..will keep you guys posted with the latest developments.
Thanks again. |
|
|
|