Programming the Bafang Middrive BBS01+BBS02

Hello

I too would like to set my cut-off voltage so I can use a 36volt battery on a BBS02. I've tried a number of work arounds for flashing the firmware to no avail. My preference is to run the system at 36 volts with a cut-off around 32. I have some really cool 36 volt batteries I want to use. Does anyone have and willing to share the BBS01 firmware so I can try flashing my system with that?

Anyone out there have any success trying to do this? Thank you in for any help in this area.
 
osholt said:
I purchased a BBS02 48V 750W a few months ago and fitted it to my bike before acquiring a battery.



Is there a 36V BBS02 firmware image available? I have seen a few on these forums but I think they are all 48V.
Key phrase, "I purchased a BBS02 48V 750W" you need 48V!(54.6V)
 
The 500c display voltage readout is indeed not always correct. I have a bbshd and a 48 volt battery and the 500c didn't show the correct voltage. It would always show the percentage of a 52 volt battery, even if you change the settings in the display to 48 volt. And the bbshd would even power down to a lower power output if the percentage of the battery (which wasn't correct) dropped below 5%. That's very annoying because the battery was actually not empty at all.

I figured out that the 500c use the voltage used in the motor controller instead of the voltage selected in the display. I changed my firmware in my bbshd to the 4830 version and it now shows the correct voltage and the motor power output now remains normal over the correct range from my battery. So it appears to be a controller firmware issue and not a 500c issue. I don't now if this is the same for the bbs01 and bbs02, but I suspect it is.
 
BotoXbz said:
cross33 said:
elenhinan said:
Well, not anymore. I wrote a really small python script that spoofs the login response of their server, letting one access the programming tool in the BESST software (tested with v1.06). For this to work you need to add the line "127.0.0.1 besst-api.yuntick.com" to c:\windows\system32\drivers\etc\hosts . This will redirect all communication intended for the bafang servers to the local web-server run by the script. Any login will then automatically be accepted. Open notepad with administrative privileges to edit this file, or save it somewhere else and copy and overwrite it afterwards. Then start the spoof.py if you already have python installed, or spoof.exe if not. It might need some microsoft visual c++ redist package, but most computers already have this installed. Login with whatever email and password you want. After login click menu and then tool. Just to clarify, this does not give you access to any restricted Bafang servers or anything I would consider shady, it just let's you open the software that runs locally on your computer.

An diagnostics mode is also available if one modifies the python script (type from 4 to 3 on line 19), which should do some testing of the display and controller.

As I have no programming cable I have not tested this. Since the software comes straight from Bafang I wouldn't expect it to put your bike on fire, but then again don't blame me if it does. If anyone want to test it out it would be interesting if you could share your experience.

Hi elenhinan
First of all, thank you for making the besst-spoof script. But, I'm unable to get it woking with the current version of BESST (v.1.2.17). I'm just getting "Unable to connect to remote service". Are you able to share the v.1.06? Or is there a another fix to this problem?

Best
Martin

they changed a few things, need to add
127.0.0.1 test.api.besst.bafang-service.com
to hosts file now

and here is the updated python code (converted it to python3):
Code:
# written by elenhinan, 24.11.2016

from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
import simplejson as json
import socket

class BESST_server(BaseHTTPRequestHandler):
	def do_POST(self):
		data_string = self.rfile.read(int(self.headers['Content-Length']))
		print("got post from BESST (%s)"%data_string)
		
		if b"password" in data_string:
			print("login accepted ;)")
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			#user type: 1 brand, 2 dealer, 3 assembler, 4 manufacturer, 5 terminal. 4 for tool access, 3 for diagnostics
			userdata = json.dumps( {'code':0,'data':{'user':{'status':1,'org': {'id': 12345, 'type': 4}},'token':123}} )
			self.wfile.write(userdata.encode('utf-8'))
		else:
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			userdata = json.dumps( {'code':0} )
			self.wfile.write(userdata.encode('utf-8'))
 
		
def run(handler_class=BESST_server, port=80):
        ip_lookup = socket.gethostbyname('besst-api.yuntick.com')
        print(("test.api.besst.bafang-service.com forwards to %s"%ip_lookup))
        httpd = socketserver.TCPServer(("", port), handler_class)
        print("Starting httpd...")
        httpd.serve_forever()

	
if __name__ == "__main__":
	run()

I don't have a BESST tool sadly so this was kinda useless for me as the program doesn't seem to work with just a CP2102
But I unpacked the code from the BESST tool, it's an electron app.
Here's most of the logic: https://cloud.botox.bz/s/6577jFi9a2nrT3g
It has a bunch of battery related stuff, gonna use that info to make my open source BMS firmware compatible with Bafang displays :D

Thank you very much for the Script. I got it to work on my PC.
Does anyone know what is inside the BESST Box?
Because during Installation of BESST software the drivers of CP2102 will be installed.
Maybe it is working with CP2102?
In my case I want to change some settings in the DP-C11 Display.
Thanks
Ben
 
SirBen said:
BotoXbz said:
cross33 said:
elenhinan said:
Well, not anymore. I wrote a really small python script that spoofs the login response of their server, letting one access the programming tool in the BESST software (tested with v1.06). For this to work you need to add the line "127.0.0.1 besst-api.yuntick.com" to c:\windows\system32\drivers\etc\hosts . This will redirect all communication intended for the bafang servers to the local web-server run by the script. Any login will then automatically be accepted. Open notepad with administrative privileges to edit this file, or save it somewhere else and copy and overwrite it afterwards. Then start the spoof.py if you already have python installed, or spoof.exe if not. It might need some microsoft visual c++ redist package, but most computers already have this installed. Login with whatever email and password you want. After login click menu and then tool. Just to clarify, this does not give you access to any restricted Bafang servers or anything I would consider shady, it just let's you open the software that runs locally on your computer.

An diagnostics mode is also available if one modifies the python script (type from 4 to 3 on line 19), which should do some testing of the display and controller.

As I have no programming cable I have not tested this. Since the software comes straight from Bafang I wouldn't expect it to put your bike on fire, but then again don't blame me if it does. If anyone want to test it out it would be interesting if you could share your experience.

Hi elenhinan
First of all, thank you for making the besst-spoof script. But, I'm unable to get it woking with the current version of BESST (v.1.2.17). I'm just getting "Unable to connect to remote service". Are you able to share the v.1.06? Or is there a another fix to this problem?

Best
Martin

they changed a few things, need to add
127.0.0.1 test.api.besst.bafang-service.com
to hosts file now

and here is the updated python code (converted it to python3):
Code:
# written by elenhinan, 24.11.2016

from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
import simplejson as json
import socket

class BESST_server(BaseHTTPRequestHandler):
	def do_POST(self):
		data_string = self.rfile.read(int(self.headers['Content-Length']))
		print("got post from BESST (%s)"%data_string)
		
		if b"password" in data_string:
			print("login accepted ;)")
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			#user type: 1 brand, 2 dealer, 3 assembler, 4 manufacturer, 5 terminal. 4 for tool access, 3 for diagnostics
			userdata = json.dumps( {'code':0,'data':{'user':{'status':1,'org': {'id': 12345, 'type': 4}},'token':123}} )
			self.wfile.write(userdata.encode('utf-8'))
		else:
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			userdata = json.dumps( {'code':0} )
			self.wfile.write(userdata.encode('utf-8'))
 
		
def run(handler_class=BESST_server, port=80):
        ip_lookup = socket.gethostbyname('besst-api.yuntick.com')
        print(("test.api.besst.bafang-service.com forwards to %s"%ip_lookup))
        httpd = socketserver.TCPServer(("", port), handler_class)
        print("Starting httpd...")
        httpd.serve_forever()

	
if __name__ == "__main__":
	run()

I don't have a BESST tool sadly so this was kinda useless for me as the program doesn't seem to work with just a CP2102
But I unpacked the code from the BESST tool, it's an electron app.
Here's most of the logic: https://cloud.botox.bz/s/6577jFi9a2nrT3g
It has a bunch of battery related stuff, gonna use that info to make my open source BMS firmware compatible with Bafang displays :D

Thank you very much for the Script. I got it to work on my PC.
Does anyone know what is inside the BESST Box?
Because during Installation of BESST software the drivers of CP2102 will be installed.
Maybe it is working with CP2102?
In my case I want to change some settings in the DP-C11 Display.
Thanks
Ben

Did u find out about this? Currently looking at buying a package with this display but if it overrides the settings in the controller it's no good... :(
And what about the others that had similar issues (@tomjasz , @tweakradje , @Nick22 , @Milad_A , @wian) did u change the firmware in the pedal assist tab "Speed Limited: By Display’s Command" as described here: https://electricbike-blog.com/2015/06/26/a-hackers-guide-to-programming-the-bbs02/
 
I'm using the DP-C11. That has a speed limit of 25 kph.

When I set the speedlimit in the controller to 25 kph instead of "by display" the assistance is very abruptly stopped at 24.7 kph. And after having done that a few times there is some kind of bug, allowing only limited current from then on. Have to switch the display off/on to reset the controller and get full power back.

So now I only run the controller speedlimit set "By Display" which is smooth to about 24 kph (doesn't go to 25 at all with this DP-C11).

Would be very interested to hack this DP-C11.

Uses an IAP 15L2K61S2 MCU from STC. (google it for datasheet)

I post you some pictures from the inside. Note my "prophete" dp-c11 has a 6th pin for head/tail light power (purple wire)

IMG_20190907_234006.jpg

IMG_20190907_234146.jpg

Cheers
 
tweakradje said:
I'm using the DP-C11. That has a speed limit of 25 kph.

When I set the speedlimit in the controller to 25 kph instead of "by display" the assistance is very abruptly stopped at 24.7 kph. And after having done that a few times there is some kind of bug, allowing only limited current from then on. Have to switch the display off/on to reset the controller and get full power back.

So now I only run the controller speedlimit set "By Display" which is smooth to about 24 kph (doesn't go to 25 at all with this DP-C11).

Would be very interested to hack this DP-C11.

Uses an IAP 15L2K61S2 MCU from STC. (google it for datasheet)

I post you some pictures from the inside. Note my "prophete" dp-c11 has a 6th pin for head/tail light power (purple wire)

IMG_20190907_234006.jpg

IMG_20190907_234146.jpg

Cheers

Have you tried setting it to a higher value than 25km/h, for example 30,35 or 40?
 
Hello,

yoou wanted to use an 36 V battery on the motor with 48 V controller. You have the same problem as me:

You can only set the batteryprotection cutoff at 38 V (silly for the 36 V battery)

I have an 250 W 36 V motor - and burned the controller.
I buyed used an kontroller - and was told that this kontroller should work for 48 V and 36 V.

But i can only programm down to 38 V

DOES SOMEONE HAVE A SOLUTION TO SET THE BATTERYPROTCTION TO 30 V AT AN 48V KONTROLLER?
 

Attachments

  • BILD.png
    BILD.png
    12.4 KB · Views: 4,694
Antohagg said:
Have you tried setting it to a higher value than 25km/h, for example 30,35 or 40?

The controller you mean? Sure. But DP-C11 display always overrides.

Btw I have also a 500C display. More about that in this post: https://endless-sphere.com/forums/viewtopic.php?f=28&t=58780&p=1500151#p1520351
 
Is there any difference between a BBS02B 48V 500W vs 750W? Golden Motor sells both but the 750W is about $40 more.

They are both the "B" version but I'm hoping that I can but the 500W/18a one and program it to 25a myself.

https://goldenmotor.bike/product/bafang-bbs02b-48-volt-500-watt-mid-drive-kit/

https://goldenmotor.bike/product/bafang-bbs02b-48-volt-750-watt-mid-drive-kit/
 
lolo.31 said:
Hi there,

A little update.

I have upgraded the Software Programming Tool, starting from the S. Penoff amazing version he did ( so much thanks for his work)
Lot of improvments are now available, with a included help for each parameters, additional infos, bugs corrections, full multi language (available today : english french) translation. A easy system is set up to add any additional languages for who wants to contribute, by adding your own txt files in the "Languages" directory. (see readme.txt included
The included help is of course based on the electricbike wellknown reference
This new software has been successfully tested by a little communauty from France. All sources file are included of course.

Download link (V2.2a) and release history (in french, chapter 12 at bottom page, use the translate widget on the right) and future new versions here::
https://blitip.blogspot.com/2019/04/logiciel-de-configuration-bafang-bbs.html


Any comments or suggestions will be welcome :D


Enjoy !
Laurent

Hi,
I tested it. That's great. It is really well documented. Unfortunately I have not yet managed to do what I wanted, ie save my new parameters on a BBS01 36V 250W motor ! I can connect to the controller. The characteristics of the controller are displayed well. The Read and Write menus are active. I launch the executable in administrator mode. When I want to re-read the parameters that I have just modified and save, it is always the default parameters which are read. Does somebody have an idea ?
Thanks.
 
Hello

Can you help me to program bafang m300?
The problem is display socket, it is different that usual. I connected it by wires and it reads crappy data.
file.php


data is like this
file.php


motor is m300
file.php


display is dcp10
it doesnt have psw menu and it wont let chance values.
file.php


The cable works fine with other bike on m400 motor with proper socket on dislpay.

Does this bike have some different controller or what?

Best Regards
-risto
 

Attachments

  • socket.JPG
    socket.JPG
    17.4 KB · Views: 4,306
  • data.JPG
    data.JPG
    116.4 KB · Views: 4,306
  • motor.JPG
    motor.JPG
    90.5 KB · Views: 4,306
  • display.JPG
    display.JPG
    21.3 KB · Views: 4,305
Hi all,
I bought a BBS01B 36V 250W (C965 LCD) with a 10.4Ah bottle battery that I installed on a first bike (then I changed to a TSDZ2 for this bike).

And these days I installed the BBS01B and C965 on another bike but I changed the battery to a 13Ah 36V PVC battery. Everything works well. When fully charged, the battery voltage is 41.9V and the C965 battery indicator has 5 bars. But after 30 kilometers the battery indicator is still fully charged with 5 bars! In addition, the voltage measured with a voltmeter dropped to 39.0V as normal. What's wrong with the settings? Is it possible to check with the USB program that the battery is set to 36V?
It no longer seems possible to change the battery voltage with the new parameters of the C965 (the password is indeed 0512 and no longer 1919),

Thanks for any advice.
 
In my experience, those are in fact "indicators", not reliable gauges.
I establish my actual battery mileage and plan my charges based on mileage.
 
Thank you for your answer.
From what I remember of my short (1 month) experience with the Bafang, before I switched to the Tongsheng, the battery indicator wasn't so wrong and quite reliable. With a 10.4Ah and after 30 km, there were only 2 bars out of 5; this is the reason why I was worried even if the battery is a 14Ah (I said 13Ah wrongly in my first message). The bike has been transformed for my sister and I will be away if the battery is flat...

Also, I understand that there is no way to verify the 36V setting of the BBS01.

Regards,
 
I am looking for the BBS01 engine software because in my engine marked "e-novation" (BBS01), after installing the trottle handle, error 11 appeared on the display and does not display the speed or battery status. Despite this error, the engine is fully working. I believe that the reason for this is the software of the engine. The engine can be programmed normally from the display as well as the computer.Controller info Manufakt.: SZBF ; Model : NS06 ; Hardware : V2.4 ; Firmware : V2.1.1.2 ; Nom.Volt 36V ; Max Current 20A .The presets according to the Kepler work on a 20-inch bike. I would like to add that this is my second BBS01 engine, in the first I also put on a trottle and I had to lead an additional signal cable from the motherboard to the handle, the software was also based on the Kepler and I additionally turned the engine to 48V (13s5p battery), which was described on the Polish forum "arbiter" https://forum.arbiter.pl/viewtopic.php?t=8148.
 
SirBen said:
BotoXbz said:
cross33 said:
elenhinan said:
Well, not anymore. I wrote a really small python script that spoofs the login response of their server, letting one access the programming tool in the BESST software (tested with v1.06). For this to work you need to add the line "127.0.0.1 besst-api.yuntick.com" to c:\windows\system32\drivers\etc\hosts . This will redirect all communication intended for the bafang servers to the local web-server run by the script. Any login will then automatically be accepted. Open notepad with administrative privileges to edit this file, or save it somewhere else and copy and overwrite it afterwards. Then start the spoof.py if you already have python installed, or spoof.exe if not. It might need some microsoft visual c++ redist package, but most computers already have this installed. Login with whatever email and password you want. After login click menu and then tool. Just to clarify, this does not give you access to any restricted Bafang servers or anything I would consider shady, it just let's you open the software that runs locally on your computer.

An diagnostics mode is also available if one modifies the python script (type from 4 to 3 on line 19), which should do some testing of the display and controller.

As I have no programming cable I have not tested this. Since the software comes straight from Bafang I wouldn't expect it to put your bike on fire, but then again don't blame me if it does. If anyone want to test it out it would be interesting if you could share your experience.

Hi elenhinan
First of all, thank you for making the besst-spoof script. But, I'm unable to get it woking with the current version of BESST (v.1.2.17). I'm just getting "Unable to connect to remote service". Are you able to share the v.1.06? Or is there a another fix to this problem?

Best
Martin

they changed a few things, need to add
127.0.0.1 test.api.besst.bafang-service.com
to hosts file now

and here is the updated python code (converted it to python3):
Code:
# written by elenhinan, 24.11.2016

from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
import simplejson as json
import socket

class BESST_server(BaseHTTPRequestHandler):
	def do_POST(self):
		data_string = self.rfile.read(int(self.headers['Content-Length']))
		print("got post from BESST (%s)"%data_string)
		
		if b"password" in data_string:
			print("login accepted ;)")
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			#user type: 1 brand, 2 dealer, 3 assembler, 4 manufacturer, 5 terminal. 4 for tool access, 3 for diagnostics
			userdata = json.dumps( {'code':0,'data':{'user':{'status':1,'org': {'id': 12345, 'type': 4}},'token':123}} )
			self.wfile.write(userdata.encode('utf-8'))
		else:
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			userdata = json.dumps( {'code':0} )
			self.wfile.write(userdata.encode('utf-8'))
 
		
def run(handler_class=BESST_server, port=80):
        ip_lookup = socket.gethostbyname('besst-api.yuntick.com')
        print(("test.api.besst.bafang-service.com forwards to %s"%ip_lookup))
        httpd = socketserver.TCPServer(("", port), handler_class)
        print("Starting httpd...")
        httpd.serve_forever()

	
if __name__ == "__main__":
	run()

I don't have a BESST tool sadly so this was kinda useless for me as the program doesn't seem to work with just a CP2102
But I unpacked the code from the BESST tool, it's an electron app.
Here's most of the logic: https://cloud.botox.bz/s/6577jFi9a2nrT3g
It has a bunch of battery related stuff, gonna use that info to make my open source BMS firmware compatible with Bafang displays :D

Thank you very much for the Script. I got it to work on my PC.
Does anyone know what is inside the BESST Box?
Because during Installation of BESST software the drivers of CP2102 will be installed.
Maybe it is working with CP2102?
In my case I want to change some settings in the DP-C11 Display.
Thanks
Ben
Hi every body,
I would like to ask you if this script works with the newest soft version BESST_setup_1.2.22 ? And if it could be used to updated Firmware of Bafang m600 motor without Bafang account (that is login and PW from Bafang)?
 
For me it doesn’t work at the moment with the new software. Maybe somebody has an older release of the software?
Would be helpful because I have a besst tool but no login data:(


Gesendet von iPhone mit Tapatalk
 
BotoXbz said:
cross33 said:
elenhinan said:
Well, not anymore. I wrote a really small python script that spoofs the login response of their server, letting one access the programming tool in the BESST software (tested with v1.06). For this to work you need to add the line "127.0.0.1 besst-api.yuntick.com" to c:\windows\system32\drivers\etc\hosts . This will redirect all communication intended for the bafang servers to the local web-server run by the script. Any login will then automatically be accepted. Open notepad with administrative privileges to edit this file, or save it somewhere else and copy and overwrite it afterwards. Then start the spoof.py if you already have python installed, or spoof.exe if not. It might need some microsoft visual c++ redist package, but most computers already have this installed. Login with whatever email and password you want. After login click menu and then tool. Just to clarify, this does not give you access to any restricted Bafang servers or anything I would consider shady, it just let's you open the software that runs locally on your computer.

An diagnostics mode is also available if one modifies the python script (type from 4 to 3 on line 19), which should do some testing of the display and controller.

As I have no programming cable I have not tested this. Since the software comes straight from Bafang I wouldn't expect it to put your bike on fire, but then again don't blame me if it does. If anyone want to test it out it would be interesting if you could share your experience.

Hi elenhinan
First of all, thank you for making the besst-spoof script. But, I'm unable to get it woking with the current version of BESST (v.1.2.17). I'm just getting "Unable to connect to remote service". Are you able to share the v.1.06? Or is there a another fix to this problem?

Best
Martin

they changed a few things, need to add
127.0.0.1 test.api.besst.bafang-service.com
to hosts file now

and here is the updated python code (converted it to python3):
Code:
# written by elenhinan, 24.11.2016

from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
import simplejson as json
import socket

class BESST_server(BaseHTTPRequestHandler):
	def do_POST(self):
		data_string = self.rfile.read(int(self.headers['Content-Length']))
		print("got post from BESST (%s)"%data_string)
		
		if b"password" in data_string:
			print("login accepted ;)")
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			#user type: 1 brand, 2 dealer, 3 assembler, 4 manufacturer, 5 terminal. 4 for tool access, 3 for diagnostics
			userdata = json.dumps( {'code':0,'data':{'user':{'status':1,'org': {'id': 12345, 'type': 4}},'token':123}} )
			self.wfile.write(userdata.encode('utf-8'))
		else:
			self.send_response(200)
			self.send_header('Content-type', 'application/json;charset:UTF-8\r\n')
			self.end_headers()
			userdata = json.dumps( {'code':0} )
			self.wfile.write(userdata.encode('utf-8'))
 
		
def run(handler_class=BESST_server, port=80):
        ip_lookup = socket.gethostbyname('besst-api.yuntick.com')
        print(("test.api.besst.bafang-service.com forwards to %s"%ip_lookup))
        httpd = socketserver.TCPServer(("", port), handler_class)
        print("Starting httpd...")
        httpd.serve_forever()

	
if __name__ == "__main__":
	run()

I don't have a BESST tool sadly so this was kinda useless for me as the program doesn't seem to work with just a CP2102
But I unpacked the code from the BESST tool, it's an electron app.
Here's most of the logic: https://cloud.botox.bz/s/6577jFi9a2nrT3g
It has a bunch of battery related stuff, gonna use that info to make my open source BMS firmware compatible with Bafang displays :D

Hi, do you think it is possible to decompile the firmware for the M600 controller? I am attaching the file.
 

Attachments

  • CRX10NC4320i132045.6-20200806.txt
    71.6 KB · Views: 88
I've got a BBS02 that I'm really struggling to program.
I've tried two different Luna cables, multiple computers, etc.

The connection is very intermittent. Most of the time it either won't connect at all, or it will just give me garbage data.

My initial suspicion was a bad cable, so Luna sent a second one. That one worked initially, I was able to program the "Basic" pane, then it just stopped responding while trying to adjust throttle settings, and it's having the same issues.

Am I having bad luck with programming cables? What is going on here?
 
Have you tried another USB port? My front usb didn’t work. Just the USB ports directly at the mainboard are working well.


Gesendet von iPhone mit Tapatalk
 
gsa103 said:
I've tried multiple different USB ports. Same result.

https://penoff.me/2016/01/13/e-bike-conversion-software/

Try another USB to TTL.
 
Back
Top