sending binary files to a 16 micro controller.

Grant Edwards grante at visi.com
Mon Aug 22 16:08:50 CEST 2005


On 2005-08-22, johnny.karlsson at gmail.com <johnny.karlsson at gmail.com> wrote:

> I'm working on a project were a need to be able to upload firmware
> to a microcontroller based Ethernet device. But because of the memory
> constraints the controller can only handle packages of 300 bytes each
> time. So therefore the firmware file must be sent in chunks and i need
> a header in each file describing which part of the file it is I'm
> sending. Could anyone give me some pointer on how a could accomplish
> that in python? I'm talking about the client that uploads the software
> to the device via TCP.

You have no control over packet size in TCP if you use the
normal socket interface.  About the only thing you can to is
put delays between calls to send() in hope that the TCP stack
will send a packet.

If you really do want control over packet size, you'll have to
use a raw socket and impliment TCP yourself.

-- 
Grant Edwards                   grante             Yow!  After THIS, let's go
                                  at               to PHILADELPHIA and have
                               visi.com            TRIPLETS!!



More information about the Python-list mailing list