Schlagwort-Archive: Mac

Running the Bafang programming software on a Mac

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.

  1. Download Bafang programming software (use google)
  2. Download „WineBottler“ (http://winebottler.kronenberg.org)

Build an executable Mac-App

  1. Run Winebottler
  2. Go to „Advanced“ tab
  3. Klick „select file“
    • Navigate to the folder containing the Bafang programming software
    • Select „Controllerst_torque.exe“
    • Klick „Open“
  4. Set „installation mode“ to „execute file“ (Installer)
  5. Set „identifier“ to „com.bafang.programmingsoftware“
  6. 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

  1. Connect your Bafang programming cable via USB-port
  2. Klick on the Apple Logo on the far left of your menu-bar
  3. 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“

  1. Open „Finder“
  2. Klick Command+Shift+. to show hidden files
  3. Open your home-folder and navigate to „Library/Application Support/„
  4. Check if there’s a new folder named „com.bafang.programmingsoftware_#########“ 
  5. Copy that name to the clipboard or write it down

Check for the correct USB2Serial Device Name

  1. Disconnect the programming cable
  2. Open up „Terminal“ and type
    • cd /dev
    • ls > ~/disconnect.txt
  3. Reconnect the programming cable and type
    • ls > ~/reconnect.txt
  4. 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…

  1. 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

  1. Open „Finder“
  2. Navigate to „Library/Application Support/com.bafang.programmingsoftware_#########“
  3. Open „system.reg“ using Texteditor
  4. 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