Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Electric Motors and Controllers
casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by casainho » Feb 19 2020 6:39am

stefkrger wrote:
Feb 19 2020 6:26am
casainho wrote:
Feb 19 2020 12:15am
SW102 new firmware release
The previous firmware version on SW102 had a problematic issue where the configurations and other settings were not being saved and I was able, finally, to correct it.
Hi casainho, I just installed this update since I had been waiting for a fix for the configuration bug. However, with this update when I start the system in the lower part of the display it says "motor bloc" (blinking) and I cannot enter the configuration screen. With the previous version (0.6.5) it was working except for the configuration bug. I did not change anything except the display FW.

Motor FW is 0.54.0 and motor is a 36V version.
Ok, I found the issue. I will make a new release today.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by casainho » Feb 19 2020 7:34am

casainho wrote:
Feb 19 2020 6:39am
stefkrger wrote:
Feb 19 2020 6:26am
casainho wrote:
Feb 19 2020 12:15am
SW102 new firmware release
The previous firmware version on SW102 had a problematic issue where the configurations and other settings were not being saved and I was able, finally, to correct it.
Hi casainho, I just installed this update since I had been waiting for a fix for the configuration bug. However, with this update when I start the system in the lower part of the display it says "motor bloc" (blinking) and I cannot enter the configuration screen. With the previous version (0.6.5) it was working except for the configuration bug. I did not change anything except the display FW.

Motor FW is 0.54.0 and motor is a 36V version.
Ok, I found the issue. I will make a new release today.
Go and download the new version. For the keys, read the wiki.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

hefest   100 W

100 W
Posts: 140
Joined: Jan 11 2019 4:55am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by hefest » Feb 19 2020 9:31am

casainho wrote:
Feb 19 2020 7:34am
casainho wrote:
Feb 19 2020 6:39am
stefkrger wrote:
Feb 19 2020 6:26am
casainho wrote:
Feb 19 2020 12:15am
SW102 new firmware release
The previous firmware version on SW102 had a problematic issue where the configurations and other settings were not being saved and I was able, finally, to correct it.
Hi casainho, I just installed this update since I had been waiting for a fix for the configuration bug. However, with this update when I start the system in the lower part of the display it says "motor bloc" (blinking) and I cannot enter the configuration screen. With the previous version (0.6.5) it was working except for the configuration bug. I did not change anything except the display FW.

Motor FW is 0.54.0 and motor is a 36V version.
Ok, I found the issue. I will make a new release today.
Go and download the new version. For the keys, read the wiki.
Few bugs on tsdz2-0.54.0 and sw102-0.6.7

- On main screen, when you short press and release MODE it goes back to main screen but there are no numbers.
- On power-up of sw102 (long press power button) there is nudge from the motor, it just starts to pull for a brief moment
- When exiting configuration screen again, motor pulls/nudges for a bit and it looks like time for how long it pulls is not constant
- While trying to access "Assist" sub-menu, sw102 froze, had to disconnect battery and connect it again. On second attempt there was no issue.
- Default settings are for battery 52V not 48V, which was the case in previous versions.

User avatar
giannidipie1   10 µW

10 µW
Posts: 5
Joined: Oct 30 2019 1:17pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by giannidipie1 » Feb 19 2020 10:11am

I have installed SW102_v0.6.7. now parameters are saved, only battery soc freeze display.
Great Work. The best release I have tried. :bigthumb:

feyris   10 mW

10 mW
Posts: 32
Joined: Nov 21 2009 6:24am
Location: Biarritz, France

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by feyris » Feb 19 2020 10:25am

hefest wrote:
Feb 19 2020 9:31am
casainho wrote:
Feb 19 2020 7:34am
casainho wrote:
Feb 19 2020 6:39am
stefkrger wrote:
Feb 19 2020 6:26am

Hi casainho, I just installed this update since I had been waiting for a fix for the configuration bug. However, with this update when I start the system in the lower part of the display it says "motor bloc" (blinking) and I cannot enter the configuration screen. With the previous version (0.6.5) it was working except for the configuration bug. I did not change anything except the display FW.

Motor FW is 0.54.0 and motor is a 36V version.
Ok, I found the issue. I will make a new release today.
Go and download the new version. For the keys, read the wiki.
Few bugs on tsdz2-0.54.0 and sw102-0.6.7

- On main screen, when you short press and release MODE it goes back to main screen but there are no numbers.
- On power-up of sw102 (long press power button) there is nudge from the motor, it just starts to pull for a brief moment
- When exiting configuration screen again, motor pulls/nudges for a bit and it looks like time for how long it pulls is not constant
- While trying to access "Assist" sub-menu, sw102 froze, had to disconnect battery and connect it again. On second attempt there was no issue.
- Default settings are for battery 52V not 48V, which was the case in previous versions.
I can confirm all those issues.
I also have a problem with the lighting:
If I turn on the light after power on but before riding, the motor wont engage.
If I turn on the light during the ride, the motor continue to run, until I stop pedaling, then the motor can't restart.
I'm not sure it's firmware related anyway.

windburner   100 mW

100 mW
Posts: 49
Joined: Sep 24 2019 3:45pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by windburner » Feb 19 2020 4:19pm

On install of SW102_v0.6.7, the configuration is saved and the Assist level is saved across power off and power up. After limited testing (20'F colder outside than I ride), I have not yet encountered the freeze at the configuration panel, nor the issue with no assist when starting with the lights on. Can confirm the other issues. Regarding the assist nudge, it is still there on start-up and when returning to the main1 panel from the configuration panel, however the light flicker that I previously encountered along with the nudge with v0.6.5, is not happening in v0.6.7, so far.

It took some muscle memory development to be able to consistently get to the config screen from the main panels instead of power offing :confused: .

Looking forward to some warmish temps so that I can fine tune my Assist level preferences!!! :thumb: :D

Oh yes, one more thing. When updating the odometer setting in config (after switching units from SI to Imperial), when I enter a number and saved it, the number would change to a lower value, i.e. 120-->77.4. So I'd enter 120 again, and it became 84.2, then say 150, and it saved as 114.2, like it was doing some kind of averaging/smoothing. Clear? Any thoughts on this? Nevertheless, so happy to be able to reset the odometer. :D
TerraTrike Rover Tandem - TSDZ2 48V 750W - 13AH Batteries - VLCD6-->SW102/v0.6.8 OSF-->VLCD6

stefkrger   1 mW

1 mW
Posts: 16
Joined: Dec 03 2018 11:49am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by stefkrger » Feb 20 2020 1:40am

Thanks for the quick update and fix for my problem casainho.
Just made my first ride on the 0.54.0 and 0.6.7 and it has been great!

One thing that came to my mind:
I read somewhere that there should be an option to configure a minimum torque level for the assistance to kick in from still stand.
Eg. if I use the assist without pedal option this will be helpful not to start the motor with my feet resting on the pedals.

Is that torque configuration available on SW102 yet?

windburner   100 mW

100 mW
Posts: 49
Joined: Sep 24 2019 3:45pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by windburner » Feb 20 2020 1:59am

stefkrger wrote:
Feb 20 2020 1:40am
... there should be an option to configure a minimum torque level for the assistance to kick in from still stand. ...
That would be amazingly helpful!!!!! :thumb:
TerraTrike Rover Tandem - TSDZ2 48V 750W - 13AH Batteries - VLCD6-->SW102/v0.6.8 OSF-->VLCD6

hefest   100 W

100 W
Posts: 140
Joined: Jan 11 2019 4:55am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by hefest » Feb 23 2020 8:47am

Went for a test drive 0.54+0.6.7 and the feeling motor is giving is much better out of the box.

One thing that Im missing is than I cant see motor temperature and its enabled.

Another issue is that even at 5th assist level which is set at 0.9 I'm not getting more than 500w from motor. Maximum current is set at 16A. On a steep incline i tried pushing it the maximum an it was outputting only 400w. Not sure what the issue is.

feyris   10 mW

10 mW
Posts: 32
Joined: Nov 21 2009 6:24am
Location: Biarritz, France

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by feyris » Feb 26 2020 5:38am

windburner wrote:
Feb 01 2020 4:08pm

While testing to see what minimum re-config I could do to take advantage of an opportunity to ride with v0.6.5, I made the following additional observations:
  • The long motor jiggle noted above is not good. When it happens, the application of assist power afterwards is all wrong (sounds destructive!!!), and requires a power off to correct, and, you guessed it, re-config. This upset has also occurred simply cycling through Main2/Config/Main1 to see the values on Main2. So, any way you get to Main1 is preceeded by the jiggle, with the potential to upset power application.
With 0.6.5, I had the exact same issue with jiggle on start, then some kind of misconfig/ unsynchronised motor when the jiggle take some time.
I never reproduced it since i upgraded to 0.6.7

windburner   100 mW

100 mW
Posts: 49
Joined: Sep 24 2019 3:45pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by windburner » Feb 26 2020 9:31am

feyris wrote:
Feb 26 2020 5:38am
windburner wrote:
Feb 01 2020 4:08pm

While testing to see what minimum re-config I could do to take advantage of an opportunity to ride with v0.6.5, I made the following additional observations:
  • The long motor jiggle noted above is not good. When it happens, the application of assist power afterwards is all wrong (sounds destructive!!!), and requires a power off to correct, and, you guessed it, re-config. This upset has also occurred simply cycling through Main2/Config/Main1 to see the values on Main2. So, any way you get to Main1 is preceeded by the jiggle, with the potential to upset power application.
With 0.6.5, I had the exact same issue with jiggle on start, then some kind of misconfig/ unsynchronised motor when the jiggle take some time.
I never reproduced it since i upgraded to 0.6.7
I too have not yet encountered the long motor jiggle (with upset) in v0.6.7. On the other hand, with v0.6.7 the short jiggle on start-up and when returning to the Main panel from Config usually does not usually flash the lights, but sometimes does. In v0.6.5, it consistently flashed the lights with the motor jiggle.

You know, I don't recall seeing any notation to say whether the jiggle introduced in v0.6.5 is by design or a coding artifact.
TerraTrike Rover Tandem - TSDZ2 48V 750W - 13AH Batteries - VLCD6-->SW102/v0.6.8 OSF-->VLCD6

gatorsean   1 mW

1 mW
Posts: 18
Joined: Jun 12 2019 1:28am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by gatorsean » Mar 03 2020 2:14am

I am not sure how to access the config settings on 0.6.7.

It seems when i press the m button, the config screen opens, but then disappears when i release the button. i have tried long pressing, double pressing, and combinations of buttons, but the menu only pops up momentarily while the m button is pressed.

What am i missing about setting the config options on the latest firmware?

Thanks!

windburner   100 mW

100 mW
Posts: 49
Joined: Sep 24 2019 3:45pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by windburner » Mar 03 2020 11:33am

gatorsean wrote:
Mar 03 2020 2:14am
... It seems when i press the m button, the config screen opens, but then disappears when i release the button. ...
When you press the M button, you are actually seeing the description of the data items being displayed.

With v0.6.7, in order to get to the config screen, you have to quick press and then hold the power button. This takes some practice. If, on the quick press, the screen changes from info1 to info 2 (or, vice versa), it will turn off on the hold. The key is that when you do the quick press, the screen stays the same, then on the hold, the config screen will appear in a few seconds, at which time you release.

It took me more than 10 tries to get this to happen, now, it probably happens on the first try, ~70% of the time.
TerraTrike Rover Tandem - TSDZ2 48V 750W - 13AH Batteries - VLCD6-->SW102/v0.6.8 OSF-->VLCD6

gatorsean   1 mW

1 mW
Posts: 18
Joined: Jun 12 2019 1:28am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by gatorsean » Mar 04 2020 1:53am

windburner wrote:
Mar 03 2020 11:33am
gatorsean wrote:
Mar 03 2020 2:14am
... It seems when i press the m button, the config screen opens, but then disappears when i release the button. ...
When you press the M button, you are actually seeing the description of the data items being displayed.

With v0.6.7, in order to get to the config screen, you have to quick press and then hold the power button. This takes some practice. If, on the quick press, the screen changes from info1 to info 2 (or, vice versa), it will turn off on the hold. The key is that when you do the quick press, the screen stays the same, then on the hold, the config screen will appear in a few seconds, at which time you release.

It took me more than 10 tries to get this to happen, now, it probably happens on the first try, ~70% of the time.
Thanks so much! Still quite a bit of freezing setting up options, but if you go one setting at a time and power down in between, you can get it set up.

motorm3ssie   100 µW

100 µW
Posts: 7
Joined: Feb 17 2020 3:39am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by motorm3ssie » Mar 08 2020 10:28am

Hey guys, i just finished my Bafang Ultra build and really want check out this outstanding source! Im planing on using the minimalistic sw102 display and maybe developing an android extension app as im an android devolper ;)

Is this source ready for use with the Bafang Ultra (g510/m620)?

Aquakitty   100 W

100 W
Posts: 152
Joined: Jun 10 2017 3:07pm

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by Aquakitty » Mar 09 2020 9:14pm

motorm3ssie wrote:
Mar 08 2020 10:28am
Hey guys, i just finished my Bafang Ultra build and really want check out this outstanding source! Im planing on using the minimalistic sw102 display and maybe developing an android extension app as im an android devolper ;)

Is this source ready for use with the Bafang Ultra (g510/m620)?
This firmware is for the Tong Sheng TSDZ2, the SW102 should work with Bafang motors already since it is a Bafang display. Not really a need for open source firmware with them since they allow programming (well the DIY OEM motors do).
Rans Enduro Sport w/Sturmey-Archer XFRD8, TSDZ2 open source mod 48v
GT Verb Comp f/s TSDZ2 open source 48v
Diadora Ampio bargain f/s TSDZ2 48v
2020 Diamant 247 belt drive 1000w 9C 48v
Hardtail made from random bits I had laying around, ginormous old Marzocchi fork, BBS02

motorm3ssie   100 µW

100 µW
Posts: 7
Joined: Feb 17 2020 3:39am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by motorm3ssie » Mar 10 2020 1:36am

Ok thank you. Then i need to develop my own firmware. I know i could use stock firmware or flash eggrider firmware but i want to develop some custom features. Do you know what protocol the controllers use to communicate with the display, is it can open? Is ist documented somewhere?

Frankenshtain   1 µW

1 µW
Posts: 3
Joined: Jul 26 2018 8:39am

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Post by Frankenshtain » Mar 10 2020 5:34am

tnx for good job!


Post Reply