Here´s a quick tutorial on how to run the Bafang programming software (Microsoft Windows) on an Apple Mac.
Please note, that altering your e-bike controller settings might be illegal in your country and bear the risk of frying the controller hardware. So be careful and make sure, you know what you´re doing. It´s all on your own responsibility.
- Download Bafang programming software (use google)
- Download „WineBottler“ (http://winebottler.kronenberg.org)
Build an executable Mac-App
- Run Winebottler
- Go to „Advanced“ tab
- Klick „select file“
- Navigate to the folder containing the Bafang programming software
- Select „Controllerst_torque.exe“
- Klick „Open“
- Set „installation mode“ to „execute file“ (Installer)
- Set „identifier“ to „com.bafang.programmingsoftware“
- Klick „Install“
WineBottler now builds an executable Mac App containing the Bafang programming software. When finished, the Bafang programming software shows up in a separate window.
- Close the window
- Select a folder and save the Mac App
Check if the necessary USB2Serial drivers are installed
- Connect your Bafang programming cable via USB-port
- Klick on the Apple Logo on the far left of your menu-bar
- Klick „About this Mac“
- Open „System information“
- In the contents tree, check „Hardware / USB“ for „USB2.0-Serial“
Set the serial com-port within the newly created Mac App´s „application support files“
First, make a quick check for the correct folder names using the Apple „Finder“
- Open „Finder“
- Klick Command+Shift+. to show hidden files
- Open your home-folder and navigate to „Library/Application Support/„
- Check if there’s a new folder named „com.bafang.programmingsoftware_#########“
- Copy that name to the clipboard or write it down
Check for the correct USB2Serial Device Name
- Disconnect the programming cable
- Open up „Terminal“ and type
- cd /dev
- ls > ~/disconnect.txt
- Reconnect the programming cable and type
- ls > ~/reconnect.txt
- Now compare the difference between the two file listings to see what /dev entry was created
- Type: diff ~/disconnect.txt ~/reconnect.txt
- This should show a device name similar to „tty.usbserial-1460“
- Note the device name
Then…
- Open up „Terminal“ and symlink the COM port into place for wine to find (fill in the correct folder and device names), type…
cd ~/Library/Application\ Support/com.bafang.programmingsoftware_#########/dosdevice
ln -s /dev/DEVICENAME com1
Register the com port within the new Mac App system-registration
- Open „Finder“
- Navigate to „Library/Application Support/com.bafang.programmingsoftware_#########“
- Open „system.reg“ using Texteditor
- Add the following lines to the end:
[Hardware\\Devicemap\\Serialcomm] 1231984861
„Serial0″=“COM1“
Open the newly created Mac App and you should be good to go.
Don’t forget to switch on your Moke´s battery. Otherwise you will not be able to connect to the controller.
References/Credits
https://fearthecow.net/guest/wine-serial-ports/
https://www.codeweavers.com/support/wiki/mac/faq/usbtoserial