OpenBafangTool - New Open-Source Bafang Configuration Tool

Understood - thanks for the quick reply. Do you happen to know of any opensource tool that can do it? (CAN-bus motor)

I am reluctant to spend the money on the BESST tool if I cannot update the old motor.
I don't think that its possible to read firmware through can bus. In best case you can found a copy of firmware somewhere in internet and flash with official software if you have it.
There is no other open source tool for bafangs with can bus
 
I'm with you . just want to emphasize that nowadays companies try to commercialize ideas...bafang could provide simple usb cable for programming m series motors but they choose to force users to buy expensive besst tool moreover restricting access with some logins...on top of that they made their cranks incompatible with industry standards so you have to pay them even more
Bafang is a Chinese company, they don't acknowledge copyright or IP at all, so in turn they have no right to claim anything either, also, this is more of a bypassing/cracking a digital lock thing, and I believe that is mainly a US thing, and again, Befang products shouldn't fall under this either, as its a Chinese company.
 
Thanks a lot AndreyPr for your work !
It looks very good and worked well for me.

However I think I did a silly thing.
I used it to tune my external 22A controller that came with the H640 Bafang hub motor (750W geared).
I know the tool is more oriented towards middrive with internal controllers but I decided to give it a try.
Initially I wanted to fix the following issue: my motor is triggered by the PAS even when pedaling backwards, instead of only forward.
So I played a bit with the "Pedal sensor type” to see if 1 of the 3 options would solve it.
When first reading the parameters, it displayed DH-Sensor-12, so I tried BB-Sensor-32 and DoubleSignal-24.
It did not solve my backward pedalling issue but instead it broke the PAS detection at low rates. Now I need to pedal at more than 50rpm before the motor assistance starts!
Unfortunately, going back to the initial setting does not change this new behaviour and using "none" (which should disable the PAS) does nothing different.

My assumption is that the factory setting for "Pedal sensor type” on this external controller was something different than the 4 options available in the software, and therefore I cannot go back to the original state.
Do it makes sense?
Any idea how I could fix that without buying a new controller?

I can only blame myself and I would greatly appreciate any advice from more experienced members

If it is of any use, the Info page reads:
- Model S106
- Manufacturer HZLD
Firmware version LDCBB107U4822B1111356.1
 
Thanks a lot AndreyPr for your work !
It looks very good and worked well for me.

However I think I did a silly thing.
I used it to tune my external 22A controller that came with the H640 Bafang hub motor (750W geared).
I know the tool is more oriented towards middrive with internal controllers but I decided to give it a try.
Initially I wanted to fix the following issue: my motor is triggered by the PAS even when pedaling backwards, instead of only forward.
So I played a bit with the "Pedal sensor type” to see if 1 of the 3 options would solve it.
When first reading the parameters, it displayed DH-Sensor-12, so I tried BB-Sensor-32 and DoubleSignal-24.
It did not solve my backward pedalling issue but instead it broke the PAS detection at low rates. Now I need to pedal at more than 50rpm before the motor assistance starts!
Unfortunately, going back to the initial setting does not change this new behaviour and using "none" (which should disable the PAS) does nothing different.

My assumption is that the factory setting for "Pedal sensor type” on this external controller was something different than the 4 options available in the software, and therefore I cannot go back to the original state.
Do it makes sense?
Any idea how I could fix that without buying a new controller?

I can only blame myself and I would greatly appreciate any advice from more experienced members

If it is of any use, the Info page reads:
- Model S106
- Manufacturer HZLD
Firmware version LDCBB107U4822B1111356.1
Thank you for report. I will try to solve this situation. Can you please provide me screenshots with full list of parameter values?
 
I was wondering what "digital batteries" means ( as in "Added support of Bafang digital batteries "). I am assuming that it refers to any battery pack that is built with a BMS that can balance charge each cell in the battery pack?
 
No, that definition fits most batteries (other than those really cheap ones that have no balance function).

Except for batteries that have communications between the controller and the battery, a drive system doesn't care what a battery does internally, it only sees the main + and - from it, and only knows if the battery is or is not providing sufficient voltage to operate, based on the controller's LVC/HVC hardware and software.

In order for software to have to add support for them, "digital" batteries would have to be the type that require communication with the controller to operate.

If that's not the case, one of the coders that added that support would have to reply with a definition of what it does / means.
 
I was wondering what "digital batteries" means ( as in "Added support of Bafang digital batteries "). I am assuming that it refers to any battery pack that is built with a BMS that can balance charge each cell in the battery pack?
Digital batteries are batteries that have digital interface (available on CAN bus) for reading some electrical parameters of battery (battery health, each cell voltage, etc). Only original bafang batteries (and branded ones also) have it
 
Тry to change "time before end of assist" from 50ms to 200
Wow it works !
Back to normal, I am so grateful ! Thank you.

So my initial theory was completely wrong.
Do you have the explanation why my controller does not support 50ms for this parameter while it is recommended for most of i understood properly?

Then, as a bonus, coming back to my initial issue of PAS triggering the motor when rotating backwards, do you think one of the 2 other "Sensor Type" options could solve it or just create other problems?

Again many thanks !
 
Wow it works !
Back to normal, I am so grateful ! Thank you.

So my initial theory was completely wrong.
Do you have the explanation why my controller does not support 50ms for this parameter while it is recommended for most of i understood properly?

Then, as a bonus, coming back to my initial issue of PAS triggering the motor when rotating backwards, do you think one of the 2 other "Sensor Type" options could solve it or just create other problems?

Again many thanks !
This parameter means time between last signal from sensor and turning engine off. 50RPM are 0.8333RPS (rotation per second). If your sensor makes 12 signals per rotation, delay between them is 0.833/12=0.007, or 70ms, that is even more then 50ms, so on this speed or lower motor stops faster than starts :). When you changed this parameter to 200, its more than one interval between signals, and motor works.
To solve your problem with reverse rotation, set your parameter "signals before assist" to 2 or 3, I think it can help. Was this problem already when you bought your bike? If it happened after long time of usage, it may be hardware problem, that need hardware repair. But at first try with "signals before assist"
 
Last edited:
Thanks for the explanation!
I tried already with 1 and 2 for signals before assist but I will try also with 3.
In fact the kit was delivered with another PAS sensor that is not compatible with my bike. With the original sensor, the behaviour was correct (assist forward, no assist backwards).
I am now using another PAS model (BZ-10C I think) which is compatible with my bike and worked well with my previous kit with a KT controller (on which I adjusted the settings to make it work in the good direction).
Also, the new bafang controller has a Julet 3pin for sensor which was not the case on the KT so I wired an adaptor myself. I tried all possible combinations matching the 3 wires and this one seems to be the only one working smoothly - but in both directions.
 
Thanks for the explanation!
I tried already with 1 and 2 for signals before assist but I will try also with 3.
In fact the kit was delivered with another PAS sensor that is not compatible with my bike. With the original sensor, the behaviour was correct (assist forward, no assist backwards).
I am now using another PAS model (BZ-10C I think) which is compatible with my bike and worked well with my previous kit with a KT controller (on which I adjusted the settings to make it work in the good direction).
Also, the new bafang controller has a Julet 3pin for sensor which was not the case on the KT so I wired an adaptor myself. I tried all possible combinations matching the 3 wires and this one seems to be the only one working smoothly - but in both directions.
BZ-10C is not designed to be used with Bafang controller, so it may be partially incompatible. This model has 10 signals per rotation, but not a 12 or 24 (that makes rotation speed measuring inaccurate, but its not a big problem), and probably have different way to determine rotation direction. I can't say more precisely without physical access. You can compensate rotation measuring incorrectness by adjusting settings, but I don't think that its possible to solve problem with reverse direction by software. Better find a compatible PAS sensor
 
BZ-10C is not designed to be used with Bafang controller, so it may be partially incompatible. This model has 10 signals per rotation, but not a 12 or 24 (that makes rotation speed measuring inaccurate, but its not a big problem), and probably have different way to determine rotation direction. I can't say more precisely without physical access. You can compensate rotation measuring incorrectness by adjusting settings, but I don't think that its possible to solve problem with reverse direction by software. Better find a compatible PAS sensor
Good to know !
I naively thought that PAS sensors were kind of standardized to work with all systems at least electrically.
I'll try to find a bafang compatible one which I can mount on my bike.

Thanks a lot for all your help Andrey !
 
Hi all!
I was referred here by a discord member of the High Voltage Light Electric Vehicles group.

I have received firmware from Bafang customer support that allegedly UNLOCKS the CAN protocols on the Bafang M625 motor, to allow it to use non-proprietary batteries.

I have an M625 but i do not have the Besst tool from Bafang to try and update the firmware... If someone could try this out and FINALLY unlock the CAN protocols on this motor, it would be incredible.

I am happy to share it with anyone, I am not online on forums much. Please shoot me an email and i'll send over the file.

Any help appreciated!

milespapineau@gmail.com
 
I have received firmware from Bafang customer support that allegedly UNLOCKS the CAN protocols on the Bafang M625 motor, to allow it to use non-proprietary batteries.
Nice! did you have to agree to not post it on line?
if not, you could attach it here for posterity.
 
You may have to make it a ZIP file first. Even just renaming whatever extension the filename has now to .ZIP, with a note in the post to rename it back after downloading, and whatever the orignal extension was (like .BIN .EXE or whatever).
 
Hi all. I can't seem to find a wheel diameter option for 27.5 MTB wheels. I've left my setting on 27. Is there another way to force it to 27.5 in the configuration tool?
 
You may have to make it a ZIP file first. Even just renaming whatever extension the filename has now to .ZIP, with a note in the post to rename it back after downloading, and whatever the orignal extension was (like .BIN .EXE or whatever).

AHH! You were right sir. I changed the file from a ".bin" to a ".zip"....

So please change it back after downloading folks...
 

Attachments

  • CRR309C5022i101001.3-28-2230-nodiy-boot3.x-12V-20230818150312.zip
    135.7 KB · Views: 27
Hi all. I can't seem to find a wheel diameter option for 27.5 MTB wheels. I've left my setting on 27. Is there another way to force it to 27.5 in the configuration tool?
Thank you for report. I will fix it later. For now, just adjust actual size with "circumference" parameter
 
Thank you for report. I will fix it later. For now, just adjust actual size with "circumference" parameter
Glad that you are adding that option, but how do I adjust actual size with "circumference" parameter? I can't see that option under BASIC PARAMETERS (or anywhere else), just "Wheel Diameter".
 
Digital batteries are batteries that have digital interface (available on CAN bus) for reading some electrical parameters of battery (battery health, each cell voltage, etc). Only original bafang batteries (and branded ones also) have it
I see, thanks for the explanation, which has greatly expanded my understanding. My son gifted me a Giant Full-e years ago that uses a 36V battery. I always wondered why I could not read 36V from the contacts when tested with my multi-meter, so I gave up on thoughts to rebuild the pack when the time came even though I have a spot welder and lots of Li-Ion cells. Now it seems that I could at least read the battery with this software.
 
I see, thanks for the explanation, which has greatly expanded my understanding. My son gifted me a Giant Full-e years ago that uses a 36V battery. I always wondered why I could not read 36V from the contacts when tested with my multi-meter, so I gave up on thoughts to rebuild the pack when the time came even though I have a spot welder and lots of Li-Ion cells. Now it seems that I could at least read the battery with this software.
Sorry, but my software is only compatible with bafang electronics. Giant bikes mostly have branded and modified yamaha engines, or something other, but not a bafang
 
Glad that you are adding that option, but how do I adjust actual size with "circumference" parameter? I can't see that option under BASIC PARAMETERS (or anywhere else), just "Wheel Diameter".
Is it about UART motors? In that case yes, there is no separate circumference parameter. It should work normally with 27.5, I have to check
 
Back
Top