sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
Hi, 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

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: Hi, 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

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Magnus Lycka
Magnus Lycka wrote: header_template = 'Chunk %05i, %03i bytes' BTW, if the header is binary, you probably want to have a look at the struct module. http://docs.python.org/lib/module-struct.html -- http://mail.python.org/mailman/listinfo/python-list

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Grant Edwards
On 2005-08-22, [EMAIL PROTECTED] [EMAIL PROTECTED] 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

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Grant Edwards
On 2005-08-22, Magnus Lycka [EMAIL PROTECTED] wrote: Hi, 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

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
aaah, well i believe that in Windows XPSP2 has disabled raw socket support (yes i sadly have to use windows) so that's no option. But I'll try to put a time delay and check what happens. Or otherwise perhaps i could do a socket.close each time, but that's a terrible waste of packets. --

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Grant Edwards
On 2005-08-22, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: aaah, well i believe that in Windows XPSP2 has disabled raw socket support (yes i sadly have to use windows) so that's no option. But I'll try to put a time delay and check what happens. Or otherwise perhaps i could do a socket.close

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Richard Brodie
Grant Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's very probable that the TCP stack will combine chunks and send out full Ethernet frames (4K bytes). You're probably going to have to either put a time delay in the loop, or wait for each chunk to be acknowledged

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
I'm going to try the timed wait alternative, if i get it the application to work properly i'll post the results in this group and the code if anyone want's it. It's such a contrast to code a tcp-server for the microcontroller (MC9S12NE64) in C and coding in python :-) I really hope embedded python

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I'm going to try the timed wait alternative, if i get it the application to work properly i'll post the results in this group and the code if anyone want's it. It's such a contrast to code a tcp-server for the microcontroller (MC9S12NE64) in C and coding in python :-)

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Nick Craig-Wood
Grant Edwards [EMAIL PROTECTED] wrote: 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. You can set the MTU (maximum transfer unit) for

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
yeah, i didn't mean running python on the HC12 but using compiled python on a ARM7 or simular would be nice. There was a project for embedded python but it seems to have died. Yeah i've been thinking about using UDP but then i would have to impliment checksums and having a reliable way to send and

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Tom Anderson
On Mon, 22 Aug 2005, Grant Edwards wrote: On 2005-08-22, Magnus Lycka [EMAIL PROTECTED] wrote: Hi, 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