Skip to content

Open-source e-bike service tool for Bafang (even with CAN!) - tune your bike (BBS01, BBS02, BBSHD, M500, M600 or any other)

License

Notifications You must be signed in to change notification settings

andrey-pr/OpenBafangTool

Repository files navigation

Issues MIT License


OpenBafangTool

Open-source e-bike Configuration&Diagnostics software - tune any kind of your Bafang device - M500, M510, M600, M420, BBS01, BBS02, BBSHD, display or any other
Explore the docs

Releases · Report Bug · Request Feature

Release Notes

2.0.1

  • Fixed bug with writing

2.0.0

  • Added support of new systems with CAN bus

1.0.1

  • Published project in Beta
  • Added Simplified Mode for beginners

1.0.0

  • Published first version in Alpha

About The Project

Screenshot Screenshot Screenshot

Warning! This project in beta version, so use it carefully. If you have any problems, write in Issues

Please report about your expirience of using this program on forum to help me make programm better

The goal of project is to replace official diagnostic tools for ebikes, that available only for official dealers, with open source alternative to let people repair and configure their bikes at home. For example, you can read and erase error codes, or limit power if physical power of your motor is too big for your country rules (possibilities depend on motor brand and model). Second goal of project is to document protocols of as much systems as possible to let other developers use them in their projects.

Currently this program supports any kinds of Bafang - motors with UART (BBS01, BBS02, etc) and with CAN (M500, M600, M420, etc). Currently not all features of CAN motors are supported, more features will be available in next versions.

(back to top)

Getting Started

You can download executables for Windows and Linux (AppImage) here

Prerequisites

Minimal set of hardware that you need to use this program for motors with CAN (also possible to test program in simulator mode without real hardware):

Programming cable

Official Bafang BESST Tool device - you can buy it in many shops for 150$ or sometimes for 100$. In the future program will support cheap Canable hardware, that costs from 10$ to 20$.

Motor

Motor that you want to configure.

Minimal set of hardware that you need to use this program for motors with UART (also possible to test program in simulator mode without real hardware):

Programming cable

Programming cable for bafang - you can buy it on Aliexpress for 5$ or in local shops.

Motor

Motor that you want to configure.

USB isolator

Also better to have USB isolator, that will protect your computer in case when motor or connection cable is broken and put battery voltage (usually 36V or 48V) on USB connector.

Installation

Current build of program are portable, so just download executable and launch it. Also, if you use Linux, you may need to unblock your serial ports or hid device in way, dependent on your distributive.

HID troubleshooting on Linux

Many Linux distros, such as Ubuntu, blocks direct access to HID device. To fix it, do next things:

  1. Create file /etc/udev/rules.d/51-bessttool.rules (name may be different, but compatible with udev).
  2. Write following content in file (if pid or vid if different on your device, change it in file):
    SUBSYSTEM=="input", GROUP="input", MODE="---rw-rw-rw-"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0323", ATTRS{idProduct}=="0627", MODE:="rw-rw-rw-", GROUP="plugdev"
    KERNEL=="hidraw*", ATTRS{idVendor}=="0323", ATTRS{idProduct}=="0627", MODE="---rw-rw-rw-", GROUP="plugdev"
    
  3. Execute folowing command: sudo udevadm control --reload-rules
  4. Replug your device

(back to top)

Usage

There are docs on each parameter in program or you can use any manual from internet. Here is some examples what you can do with this parameters (some of examples related not to all kind of hardware):

  1. You can set wheel size when you want to install motor kit on your bike, to show correct speed on display.
  2. You can change value on odometer on display if you want to replace display on existing bike or install used display on new bike.
  3. According user reports, some motor modifications starts only after one full pedal rotation - in that case, you can lower parameter "Signal No." to start motor after quarter of rotation or less.
  4. You can use error codes and diagnostic data from onboard sensors to physically repair your motor.

(back to top)

Roadmap

  • Add support of Bafang motors with UART
    • Find hardware
    • Alpha
    • Beta
    • Stable
  • Add support of Bafang systems with CAN
    • Find hardware
    • Alpha
    • Beta
    • Stable
    • Add more channgeable parameters
  • Add support of Bafang displays with UART
  • Add more kinds of executables
    • .dmg - MacOS, on Apple Silicon and x86_64
    • Flatpak - Linux, x86_64 - in progress
  • Add multi-language interface
  • Add simple mode for beginners
  • Add support of cheap Canable USB-CAN convertrs

You can open issue for request a new feature.

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Forum topic

Issues

Project Link: https://github.com/andrey-pr/OpenBafangTool

(back to top)

Acknowledgments

(back to top)

About

Open-source e-bike service tool for Bafang (even with CAN!) - tune your bike (BBS01, BBS02, BBSHD, M500, M600 or any other)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published