dronecan / pydronecan

python DroneCAN code generation, interface and utilities
MIT License
40 stars 42 forks source link

Firmware update example #31

Closed dakejahl closed 1 year ago

dakejahl commented 1 year ago

Added an example script to update the firmware on a CAN node. I used the gui_tool project as an example to follow.

I don't like this

node.defer(4, request_update)

but it does work -- from what I understand sending the BeginFirmwareUpdate request triggers the node to reboot. We then send BeginFirmwareUpdate again such that the bootloader catches it and actually starts updating. Do I understand this correctly?

dakejahl commented 1 year ago

@julianoes Thanks for the review. I made the suggested changes and shortened the argument names.

tridge commented 1 year ago

@dakejahl I've pushed a few fixes to this branch. Key changes are: