Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Electric Motors and Controllers
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 01 2020 2:12pm

casainho wrote:
Feb 01 2020 1:45pm
hefest wrote:
Feb 01 2020 12:43pm
Not sure if this the correct thread to discuss this, but isn't it a bit difficult to keep track of which display firmware version works with tsdz2 firmware version?
Wouldn't it make more sense to use semantic versioning where major and minor versions are the same across the firmwares if they are compatible with each other?
For example, 1.1.X tsdz2 firmware is compatible with any 1.1.x version display firmware?

Another thing that can be improved is configuration. Instead of maintaining it on wiki which already is hard to find valid info on, keep the CONFIGURATION.md in each git branch/tag that corresponds to that version of the software and just maintain the link on Wiki to the MD file?
I think those 2 points are good suggestions.

I think next time I will implement point 1.

Point 2, there is one thing I don't like that makes me not want to do it. As you say, is hard to find the valid info on the wiki and so I try to make the configurations page with a structure and Table of Contents at top of the page - happens that .md files do not support Table of Contents but only the wiki pages when using the Mediawiki style, so, I will keep with that.
I'm convinced that MD on Github supports tables as well. There is also helper bash script to automatically format tables. Let me check that and get back at you.

On the first point, if you want to keep the major version 0 for some reason, you could use 4 numbers for versioning.

windburner   100 mW

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

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

Post by windburner » Feb 01 2020 2:44pm

casainho wrote:
Jan 31 2020 10:38am
850C and SW102 displays new firmware

850C_SW102_v0.6.5

This version was developed for the TSDZ2 motor controller firmware v0.54.0 (TSDZ2-v0.54.0.hex).
...
This update represents my most satisfying use & ride experience using the SW102 & TSDZ2 OpenSource Firmware!!!

Downloaded & installed both updates without incident (except "remembering how" given the time since the last try), then tested and tuned the configuration to my preference. Gave it a Big Thumbs Up!

However, alas, I then turned off the display, and went to get pen & paper to make notes for my documentation of the settings. When I turned the display back on and went to settings, every one of my configuration changes had been reset to the defaults.

Ouch, there went an hour or so!

However, I am still at a Big Thumbs Up! It's winter here and very few opportunities to ride, and I am sure that not saving the configuration will be resolved by the spring.

In addition to the above, I did note:
--cursor remnants/blobs from time to time when moving around the settings screen.
--the numbers disappear on Main1 panel after pressing "M" to see the text.
--I liked the fact that the light flashes and the motor jiggles a little when returning from settings with changes,
------however, a couple time the motor jiggle went for nearly a second, which was enough to move the trike.
--------- (Assuming, of course, that this is intentional notification behavior and not an accident.)
------------ (This same light/jiggle behavior occurs as the SW102 welcome screen changes to the Main panel.)

What I really liked about this update:
--default values on the Main2 panel are perfect for me. (I assume reconfiguration of Main2 is still there?)
--the ability to restore the odometer setting after a new FW install.
--the much smoother application of power for Walk mode.
--I'm sure there's more, but memory fails.

Thanks casainho for this effort and especially for continuing the support of the SW102!
TerraTrike Rover Tandem - TSDZ2 48V 750W - 13AH Batteries - VLCD6-->SW102/v0.6.8 OSF-->VLCD6

windburner   100 mW

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

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

Post by windburner » Feb 01 2020 4:08pm

windburner wrote:
Feb 01 2020 2:44pm
--I liked the fact that the light flashes and the motor jiggles a little when returning from settings with changes,
------however, a couple time the motor jiggle went for nearly a second, which was enough to move the trike.
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.
  • From time to time in configuration, after making a change and returning to the config main panel, the SW102 locks up, requiring a power off, and redo. Had this happen twice in a row after changing the Battery settings. Appeared to defeat it by returning to main panel immediately after the Battery changes, then returning to config for any other changes. Didn't see this at all during the initial testing session.?.?.?
Overall, I have found that I only need to config my wheel diameter, battery, and SOC settings to eek out an enjoyable ride. :thumb: Actually, wheel diameter is enough, but, I like to see the battery indicator look ~right.
TerraTrike Rover Tandem - TSDZ2 48V 750W - 13AH Batteries - VLCD6-->SW102/v0.6.8 OSF-->VLCD6

Cbisbaf   10 mW

10 mW
Posts: 24
Joined: May 04 2019 3:26pm

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

Post by Cbisbaf » Feb 02 2020 12:06pm

#################################################
# #
# Windows Standalone SW102 Full Installer #
# #
#################################################
.
.
(e)xit / (t)est connection / (f)lash sw102-full-0.19.11 (1).hex : t
GNU MCU Eclipse OpenOCD, 32-bitOpen On-Chip Debugger 0.10.0+dev-00593-g23ad80df4 (2019-04-22-16:40)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J28S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.239683
Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections



im getting this when trying to flash the sw102 any fix ?

obcd   100 W

100 W
Posts: 136
Joined: Jul 16 2019 3:45pm

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

Post by obcd » Feb 03 2020 4:22am

I have no experience, but don't you have to press f instead of t for flashing?

windburner   100 mW

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

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

Post by windburner » Feb 05 2020 2:27am

A Caution For TSDZ2 Trike Riders and OSF V0.6.5/V0.54.0: Don't get off the trike with the display still turned on with 'Various-Assist w/o pedal' enabled. Given that a trike is always "ready to roll", I had a runaway!!!!! Fortunately, it was a slow-speed-chase at ~1 MPH on level ground as the TSDZ2 stuttered/sputtered along, instead of a solid power-on. But, a stark reminder to always think Safety. Honestly, given some of the other observations on this version, it's probably best to hit the power switch (if you have one) when dismounting, even if this option isn't enabled.
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 06 2020 2:10pm

windburner wrote:
Feb 05 2020 2:27am
A Caution For TSDZ2 Trike Riders and OSF V0.6.5/V0.54.0: Don't get off the trike with the display still turned on with 'Various-Assist w/o pedal' enabled. Given that a trike is always "ready to roll", I had a runaway!!!!! Fortunately, it was a slow-speed-chase at ~1 MPH on level ground as the TSDZ2 stuttered/sputtered along, instead of a solid power-on. But, a stark reminder to always think Safety. Honestly, given some of the other observations on this version, it's probably best to hit the power switch (if you have one) when dismounting, even if this option isn't enabled.
Wow, that sounds dangerous. I really like that option because motor is much more responsive on starts.

freechainin   1 µW

1 µW
Posts: 3
Joined: Feb 06 2020 1:06am

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

Post by freechainin » Feb 06 2020 11:54pm

Would it be possible to use something like ESP32 to send and receive signals and a cell phone app for display and controls?

skestans   100 W

100 W
Posts: 120
Joined: Jul 12 2019 12:42am
Location: Luxembourg

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

Post by skestans » Feb 07 2020 3:45am

freechainin wrote:
Feb 06 2020 11:54pm
Would it be possible to use something like ESP32 to send and receive signals and a cell phone app for display and controls?
I remember seeing a video of someone putting a bluetooth module onto the motor itself, and then using a phone app as the TSDZ2 display.

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 07 2020 12:37pm

skestans wrote:
Feb 07 2020 3:45am
freechainin wrote:
Feb 06 2020 11:54pm
Would it be possible to use something like ESP32 to send and receive signals and a cell phone app for display and controls?
I remember seeing a video of someone putting a bluetooth module onto the motor itself, and then using a phone app as the TSDZ2 display.
Would be great if that guy jumps in and supports sw102 bluetooth.

Casainho mentioned his wife potentially working on android app for sw102 bluetooth but not sure at what stage is that.

I've explored a bit possibility of developing such app but in Golang since I'm not familiar with android java development.

casainho   10 GW

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

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

Post by casainho » Feb 07 2020 12:43pm

hefest wrote:
Feb 07 2020 12:37pm
skestans wrote:
Feb 07 2020 3:45am
freechainin wrote:
Feb 06 2020 11:54pm
Would it be possible to use something like ESP32 to send and receive signals and a cell phone app for display and controls?
I remember seeing a video of someone putting a bluetooth module onto the motor itself, and then using a phone app as the TSDZ2 display.
Would be great if that guy jumps in and supports sw102 bluetooth.

Casainho mentioned his wife potentially working on android app for sw102 bluetooth but not sure at what stage is that.

I've explored a bit possibility of developing such app but in Golang since I'm not familiar with android java development.
Currently there is no firmware on SW102 that sends and receives data over Bluetooth so the app projected is halted. I am working on the firmware but there is a big issue that I don't know how to solve...
- 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: 4072
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Feb 07 2020 12:50pm

hefest wrote:
Feb 07 2020 12:37pm
I've explored a bit possibility of developing such app but in Golang since I'm not familiar with android java development.
I think you should go ahead. Maybe you have a better motivation than my wife. I personally do not expect to use the app myself so no big motivation for me.
- 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.

stefkrger   1 mW

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

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

Post by stefkrger » Feb 08 2020 3:25pm

casainho, have you found out yet why the new fw for SW102 does not store settings? Currently I cannot use my bike because I installed the new motor and display fw before I found out about the issue. I have a lot of settings to configure after every start up (36v system)

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 09 2020 10:18am

casainho wrote:
Feb 07 2020 12:50pm
hefest wrote:
Feb 07 2020 12:37pm
I've explored a bit possibility of developing such app but in Golang since I'm not familiar with android java development.
I think you should go ahead. Maybe you have a better motivation than my wife. I personally do not expect to use the app myself so no big motivation for me.
But there is no support on sw102 for sending data over bluetooth, that has to be developed as well?

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 10 2020 12:36pm

Not sure how communication protocol between tsdz2 and sw102 works, but can we just forward what ever sw102 is getting from tsdz2 over bluetooth to mobile?

casainho   10 GW

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

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

Post by casainho » Feb 11 2020 6:41am

hefest wrote:
Feb 10 2020 12:36pm
Not sure how communication protocol between tsdz2 and sw102 works, but can we just forward what ever sw102 is getting from tsdz2 over bluetooth to mobile?
Yes, I would start to replicate the same that is already working between display <-> motor controller. But then we will need to implement the change of the same variables from both display and mobile app, this is new.
- 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.

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 17 2020 7:34am

Hi.
I installed the latest version on my commuting bike, comming from the stock version (VLCD5)

Some questions and returns:

Sometime, the interface freeze while browsing the menus. The bike is still usable anyway.
As already mentioned, there is the issue saving the settings.

I modified the tsdz2 to include a temperature sensor:
Is there any way to read the temp using the sw102?

And I didn't find any way to turn on the lights, is that possible?

anyway, I realy like the new feeling.
Thanks for everyone involved on this project, it's awsome.

windburner   100 mW

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

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

Post by windburner » Feb 17 2020 10:58am

feyris wrote:
Feb 17 2020 7:34am
...
And I didn't find any way to turn on the lights, is that possible?
...
Press and hold the ' ^ ' button to toggle the lights on & off.
TerraTrike Rover Tandem - TSDZ2 48V 750W - 13AH Batteries - VLCD6-->SW102/v0.6.8 OSF-->VLCD6

MartDesjardins   1 µW

1 µW
Posts: 1
Joined: Feb 17 2020 12:36pm

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

Post by MartDesjardins » Feb 17 2020 12:46pm

Hi,

I just purchased an ebike with the SW102 screen and a Bafang Hub Motor (36v 350W). Do you think it will work if I flash the firmware with the OpenSource firmware ?

Thanks,

Mart

casainho   10 GW

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

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

Post by casainho » Feb 17 2020 12:51pm

MartDesjardins wrote:
Feb 17 2020 12:46pm
Hi,

I just purchased an ebike with the SW102 screen and a Bafang Hub Motor (36v 350W). Do you think it will work if I flash the firmware with the OpenSource firmware ?
Read here all the details of this firmware: https://github.com/OpenSource-EBike-fir ... _wiki/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 17 2020 5:34pm

casainho wrote:
Feb 11 2020 6:41am
hefest wrote:
Feb 10 2020 12:36pm
Not sure how communication protocol between tsdz2 and sw102 works, but can we just forward what ever sw102 is getting from tsdz2 over bluetooth to mobile?
Yes, I would start to replicate the same that is already working between display <-> motor controller. But then we will need to implement the change of the same variables from both display and mobile app, this is new.
Ok, it looks to me like sizeable implementation of stuff have to be implemented on sw102 side including creation of GATT server and sending over data. Having ind mind the state of sw102 firmware at the moment, this wouldn't be happening any time soon, right?

casainho   10 GW

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

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

Post by casainho » 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.

Changelog:
- corrected issue on SW102 display were the configurations and other settings were not being saved
- changed SW102 display enter configuration button, to be different from button to change screen

Download the new version here: https://github.com/OpenSource-EBike-fir ... D/releases
- 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: 4072
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Feb 19 2020 12:17am

hefest wrote:
Feb 17 2020 5:34pm
casainho wrote:
Feb 11 2020 6:41am
hefest wrote:
Feb 10 2020 12:36pm
Not sure how communication protocol between tsdz2 and sw102 works, but can we just forward what ever sw102 is getting from tsdz2 over bluetooth to mobile?
Yes, I would start to replicate the same that is already working between display <-> motor controller. But then we will need to implement the change of the same variables from both display and mobile app, this is new.
Ok, it looks to me like sizeable implementation of stuff have to be implemented on sw102 side including creation of GATT server and sending over data. Having ind mind the state of sw102 firmware at the moment, this wouldn't be happening any time soon, right?
Next, I will start looking at sending data over Bluetooth. As you can see by yourself, latest version works well, some data is already sent by Bluetooth -- see the sources.
- 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.

obcd   100 W

100 W
Posts: 136
Joined: Jul 16 2019 3:45pm

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

Post by obcd » Feb 19 2020 4:16am

The open source firmware for SW102 is not compatible with the bafang motor.
That motor display combination will only work with the original firmware.
The open source firmware is for the tungsheng tsdz2 mid drive motor (also running on open source firmware)
And, you need matching firmware versions or it won't work either.

stefkrger   1 mW

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

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

Post by stefkrger » 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.

Post Reply