Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Interesting! Tomorrow night I'll do two things:

Repro the problem you describe and then push out s new version.

Push out a version of the classic 0.19.13 build with a special flag set that tells the bootloader to ignore the version info. From now on I'll always set this flag.

Sorry about these recent bugs - usually I use a release on my bike for a few days before releasing - but currently my bike is disassembled (upgrading to a new bike 😁)

windburner said:
windburner said:
I think that reversing a version is very important ...

Looks like my "reversing a version via bluetooth" comment was very much appropriate, as I'll need to do a bit of soldering to revert to 0.19.11 for tomorrow morning's ride (or revert to the TSDZ2 factory firmware and to the VLCD6 display and wait for the next SW102 update).

The update via bluetooth from .11 to .15 went very easy. However, with 0.19.15, using UP+DOWN to go between screens, the sequence for my unit is, main screen, info screen, settings screen, to OFF!!! Just in case, I waited for some time (up to 180 seconds) to see if it would reboot and return with a fault code, but it remained off. In fact, I got to a black screen in many ways, without touching the power button.

The reason I need to revert is the fact that, no matter what I did, no setting changes were ever saved, thus, it can't be configured for my trike and ride profile, and the default settings will not work.

Also, I experimented with the ability to change the info screen configuration, which is a nice feature, and these too could not be saved.

Will attempt to report an issue, which could be a large report if I tried to report everything encountered.

On the positive side, I do see lots of promise with these changes.
 
looks like you have made some progress. I hacked open my display and flashed back to v.11 via SWD, which I was enjoying before. All the weird motor issues went away and seems better now, so I think I didn't fry my motor on the second ride yay! i will move up to the latest version eventually but liking the way it rides so I'm leaving it with the old one for now.

I prefer pressing single buttons, use the M or power button, up or down, but pressing up and down together I need to stop and use two hands. The buttons don't work so great after hacking into the display.
 
ebentrider said:
... I hacked open my display and flashed back to v.11 via SWD, ...
I didn't want to dig into that again, so, I decided to wait for the next progression of SW102 FW, and flashed the TSDZ2 back to factory while switching back to the VLCD6 display. Still an enjoyable ride.

Looking forward to test the 0.20.x compatible variant!
 
hex4def6 said:
head --> desk...

Guess I didn't realize this was for the TZD2 only, not the bafang motors.... Oops.

You're not the only one. I was looking forward to trying this out with my Bafang too. Sad times...
 
If anyone is planning on flashing the to a fresh device, I'd appreciate if you could try grabbing a copy of the existing factory firmware off the device using the method suggested on the first page of this thread. Thanks!
 
hex4def6 said:
If anyone is planning on flashing the to a fresh device, I'd appreciate if you could try grabbing a copy of the existing factory firmware off the device using the method suggested on the first page of this thread. Thanks!

You can't copy the factory firmware off normally (because it is read protected). However, I can help you out - PM me ;).
 
Hi ya'll,

The 0.19.15 had a serious bug with saving settings. This release fixes that, it also returns the M/ONOFF key usage to the more popular choices.

New features (full changelist [here](https://github.com/OpenSource-EBike-firmware/Color_LCD/pull/27)):

* Fix settings saving
* Change back to using M to start/stop field editing
* Change back to using ONOFF to go to the next screen or exit from nested menus
* Fix a few drawing bugs
* (And as usual - we might have made new bugs - oops. If that happens _please_ log a bug on github). We read the forums but making a real bug makes it less likely we'll forget to fix what you found.

The initial install (mainly getting access to the programming pins) is a bit of a hassle but we've written [instructions](https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Initial-SW102-firmware-install) to make it easier. Every installation after that is very painless via our bluetooth bootloader software-update.

If you are upgrading from a previous release, you can upgrade over bluetooth. The procedure is:

* Install "nRF Connect" from your appstore of choice (Google Play or whatever)
* Download our [sw102-otauptdate-xxx.zip](https://github.com/OpenSource-EBike-firmware/Color_LCD/releases) file onto your phone (do not unzip)
* Press and hold the M key on the SW102, then press and hold the power button. Keep both buttons pressed down for at least eight seconds. You can then release the buttons. You will know you are in the bootloader if the screen stays dark.
* Run the "nRF Connect" app. You should see "SW102 DFU" list, click on Connect
* On this new pane you will see a small DFU icon in the upper right of the screen. Click on it.
* Select our "application bundle" and our zip file.
* The update should start and show progress as it progresses
* After the upload completes turn your bike completely off
* Then start your new SW102 load as normal (a long press on the power button)

Future releases will include release notes, but for now here's a link to our [TODO list](https://github.com/OpenSource-EBike-firmware/Color_LCD/blob/master/firmware/TODO.md). If you encounter bugs please open as issue [here](https://github.com/OpenSource-EBike-firmware/Color_LCD/issues). Make sure you mention you were using a SW102 and include as much information as possible.

We look forward to your reports of great success (or failure, ahem) in this [thread](https://endless-sphere.com/forums/viewtopic.php?f=30&t=99698).
 
geeksville said:
Hi ya'll, ...
We look forward to your reports of great success (or failure, ahem) in this thread ...

With the closing of the issue reported with 0.19.15, a request was made to try it quick, just in case, so I complied.

The update from 0.19.15 to 0.19.17 went smoothly via bluetooth. The system power was removed, waited some seconds, then system power on and startup via a ~3 second power button press.

Unfortunately, the SW102 powered up to a blank screen in DFU mode (as seen by still being available as "SW102 DFU" from the DFU Utility). Tried two more power off/on cycles, no success. Then, again attempted to uploaded the 0.19.17 update via the DFU Utility, successfully. Wow! Same outcome. Also tried a few key press combinations (+M, +V, etc.) at startup without success.

Also tried to upload the 0.19.11 update, but, it was a no go.

Oh well. Thanks for trying.

I'll leave the TSDZ2 with the OSF (for the next several hours) in case there are suggestions of other things to try with the SW102 at 0.19.17.
 
Hmm. Were you using the nrf connect app to do the upgrade? (I updated two bikes here and my dev SW102 without problem)
 
geeksville said:
Hmm. Were you using the nrf connect app to do the upgrade? (I updated two bikes here and my dev SW102 without problem)

Yes, and it did report that the upload was successful.
 
geeksville said:
Please try nrf connect. The updater in nrf toolbox seems flaky to me.

So, reading is fundamental! My first answer should have been: No, I used "nrf toolbox".

So, I downloaded "nrf connect", and tried the "dfu". It did not ask the "scope" question, and immediately proceeded to the upload and install step. After reporting success, I powered off the trike and tried again. Same results, in that is still starts up in DFU (is that also called bootloader?) mode!

My SW102, purchased in September, was reported to be "the latest generation". Perhaps that is the difference?

... Time passes ...

I tried again using "nrf connect" and the SW102 got lost, still powering up in DFU mode, but "nrf connect" could not get sustain a connection.

... More time passes ...

I tried an upload again using "nrf toolbox" and left it sit while I typed in the second "nrf connect" trial info. Then I went back, did a full power off, counted to 10, powered on the trike, then pressed the power button.

I GOT A DISPLAY!!!

I am not sure what all of this back and forth was about, but, now, I'll go do some configuring/testing.

P.S. The flash screen is so/too fast, << 1.0 second, I think that I saw that it was 0.19.17.
 
If you hold down the power button the not screen will stay on. Also, it takes a long time for the
Unit to power down after the battery is disconnected, maybe even 30 seconds.
 
Well, more mostly good news. Testing of the SW102 with the 0.19.17 firmware went OK.
- Feature settings and screen configurations are now being saved.
- Changing units to mph from kph now seems to display mph (fairly close correlation with my GPS)

Re preceding geeksville comment:
While my typical power down was on the order of 10 seconds, during the first constant bootloader issue period, there were several 5 minute power downs, in fact, one overnighter. For a normal power up, I hold the power button for up to 3 seconds, versus the 8 seconds to activate the bootloader mode.

One big query:
On the TSDZ2 v0.19 OSF with the modified SW102 firmware at both 0.19.11 and 0.19.17 levels, the startup power feature seemed to have no positive effect. While the default was 'disable', when changed to 'enable', it actually delays the onset of pedal assist by the value of 'duration', instead of boosting for 'duration', no matter what Motor Duty Cycle value is set for Level1-X. Am I misunderstanding what this should do? Is this a known abnormality of v0.19 OSF? Or does this seem to be an error introduced with the SW102? This is important right now, as the onset of pedal assist with v0.19 OSF seems to lag well behind the factory firmware.

Issue Reports:
1. For the Odometer and Trip Distance, using mph as units, the decimal point is missing (i.e., 6.8 miles displays as 68). The miles were a close match to the GPS.
2. While scrolling through the feature menu, I did from time to time get the remnant of a cursor blink (I think this might have been called a 'screen turd' in one version of the todo list), usually when moving down the feature menu, versus up.
3. Again with both versions I've tested, when going through a feature sub-menu, some settings would be inverted, with a white background which blanked the still white descriptor text, while the value field was reversed to black and clearly visible. A power off/on usually solved this.

I still like the potential of the SW102 over the VLCD6 as a compact display, and am willing to keep at it to get it to Beta and Beyond. Although, the closely packed assist up/down buttons will definitely take some finger memory re-development to prevent control dribbles.
 
I use the startup power option also with my sw102. However to get it to respond quickly you need to also turn on the option to not require cadence before starting (ie just pedal pressure is sufficient). This is a trait of the 0.19 tsdz2 code - not the display code.

Unfortunately I don't remember the name of that option exactly and I'm on a long plane flight now. Hopefully someone can chime in with more details.
 
geeksville said:
... you need to also turn on the option to not require cadence before starting (ie just pedal pressure is sufficient)...

Aha! That must be that option under Various called "Motor Assist" which by default is "disable". I'll give "enable" a try. Thanks.

EDIT: Yes, that's it, although, the 'torque for activation threshold' probably needs to be adjustable, as I once inadvertently activated the boost (momentarily) just mounting my feet to the pedals.
 
Follow-up Notes on SW102 with 0.19.17 firmware testing:
1.The Display-->Auto power off Feature has a 15 'minutes' default, but, in my testing, the display powers off after 9 minutes no matter the default or any value I've set. I experienced something similar to this same behavior in 0.19.11, but I never timed it.
2.The "Trip Distance" attribute resets with each power off, thus, you can't pause on a trip for more than 9 minutes to smell the wild flowers, or watch the ripples where two branches of a river rejoin.

Features Suggestions:
1.Allow user-only Trip Distance reset versus with every power off. (I checked the TODO and did not see any such mention.)
2.Add an Option where Trip Time only accumulates when Cadence&Speed != Zero(+any appropriate buffering), allowing user-only reset, as above.
 
Just a quick post to report I had no problem going from 0.19.11 to 0.19.17 with nrf connect. Some of the chat here made me nervous about updating.

Startup is way faster - that's very welcome! Also, MPH works. As a very minor issue the 'mph' label seems to overlap the speed digits. The battery capacity display seems to still have the issue of drastically underestimating the remaining charge. I've disabled the SoC display so that I can see voltage to guestimate the charge level.

I had some strange behavior in the settings menu where after a while some items show up in inverse video, and sometimes it seemed to freeze up mildly. Sorry this report isn't very useful for bug chasing - I'll try to work out how to reproduce.

Thank you for the work on this!
 
Thanks! The SOC thing I think shares a common bug with the 850C version. So when we fix it it will work for both devices.
 
Back
Top