o-gs / dji-firmware-tools

Tools for handling firmwares of DJI products, with focus on quadcopters.
GNU General Public License v3.0
1.54k stars 418 forks source link

Help for implement write/trigger function on comm_sbs_bqctrl.py #273

Open WigHlod opened 2 years ago

WigHlod commented 2 years ago

Hello,

First i want to thanks the peoples behind this repository. It help a lot.

I am currently building a battery pack based on the WM220 Intelligent-Board of a Mavic Pro 1 battery. My pack use regular but large capacity cells, not high voltage one like the genuine.

The comm_sbs_bqctrl.py tool helped me reset of the PF flag with success. But, i would like now edit two other values, the DesignCapacity() and the ChargeVoltage().

I've read somewhere by diggin on the web that @mefistotelis said to another requester that it would be easy to implement the trigger and write missing functions in the software. To be honnest i'm not developper, and only made very some simple programs.
But, anyway i've tried to take a closer look to maybe implement it by myself, but honestly i didn't understand what i read.

So i'm sorry for asking you again, but could someone help me to implement the missing function to rewrite and triggering actions ? It could help a lot of people, some people use CP2112 module with others tools but it become pricey to find one.

I'm documenting the whole process of my project here for the interested people : make-a-custom-battery-for-dji-mavic-pro

buddyjojo commented 2 years ago

No clue if this is the correct way to do this (probably not) but this worked for me.

Change line ~3056 from v = smart_battery_system_cmd_value_from_text(cmd, subcmd, nval_str, po) to v = int(nval_str).