dronecan / pydronecan

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

app/dynamic_node_id: avoid spurious reallocation #71

Closed tpwrules closed 1 week ago

tpwrules commented 2 weeks ago

Only set a None unique ID in the DNA database if there's no existing unique ID for the node ID and the node's unique ID is not available. This prevents erasing an existing allocation and causing the node to be allocated another ID, while still allowing the node ID to be reserved if a unique ID never becomes available.

Tested and this seems to fix the issue, though this seems very likely to happen with AM32 and I don't have my AM32 hardware available this exact moment so I'm not 1000% confident yet.

Huibean commented 2 weeks ago

LGTM, test with AM32

tpwrules commented 2 weeks ago

Testing with AM32, 10 reboots, ESC panel open so we go to main firmware:

Quite confident this is fixed now.