Here is a branch which adds real time configuration of mixer parameters and the ability to store new mixer settings to file:
https://github.com/crashmatt/Firmware/tree/mixer_configuration4
It is a rework of this pull px4 Firmware pull request 4844 which did not support px4io. Sorry, I can’t post the link since I passed my limit.
Looks at the description in the pull request for more details.
The new version attempts to support px4io. The problem with px4io is getting the mixer file back over the link without using lots of memory it doesn’t have. The solution is to have a copy of the mixer on the fmu side. All modifications to the px4io side are also done to the fmu side. That means that all mixer information can be obtained easily.
I don’t trust the link to be perfect. Instead of cross checking every mixer parameter I thought to do a checksum on the floating point data. This is where it all falls apart. There is precision loss between int->float->int conversions as can be seen from the mixer configuration output below. The 7999 values were originally 8000.
Any single bit of difference with a int->float conversion will completely change the checksum.
If I convert from float->int to do the checksum there will still be occasional differences.
This thing is close to working. Just need some extra magic for it.
nsh> mixer config /dev/pwm_output0
…abbreviated
O: 10000 10000 0 -10000 10000
S: 0 2 -7000 -7000 0 -10000 10000
S: 0 1 -7999 -7999 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 2 -7000 -7000 0 -10000 10000
S: 0 1 7999 7999 0 -10000 10000
M: 1
etc…