Python application for updating an embedded device - is it feasible?
I am considering to write a tool for updating a WinCE based device. The update procedure consists of following steps:
- get several files from two different zip-archives
- start target and while it is booting send a command over serial interface RS232 (switch in bootstrap mode)
- transfer WinCE-OS image and a flash-tool over FTP
- connect via telnet and execute the flash-tool
- reboot target
- transfer customization files via FTP
Currently all this is done manually, which is very error prone and time consuming. Especially the step 6 is a pain in the a**, because FTP server on WinCE target often breaks.
I hope, Python could help me accomplish all these steps, the first look in the libraries showed, that there is everithing there: ziplib, ftplib, seriallib, telnetlib.开发者_如何学编程
Does anyone have done something similar? What are hidden problems there?
Thank you for any hint!
EDIT: There is not Python on target (and ihmo there is no need for). Target provides telnetd, ftpd via ethernet connection and a boot-console via serial connection. The entire file system is exposed via telnet and ftp - so any file can be accessed through these protocols from the host.
You can use pyserial or python for windows extensions to send the serial command, telnetlib to send telnet commands and and ftplib for the FTP part. Eventually, you even can install Python on the WinCE device, but should should not need it.
精彩评论