Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Electric Motors and Controllers
JaiCee   1 mW

1 mW
Posts: 10
Joined: May 06 2019 4:57am

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

Post by JaiCee » Aug 28 2019 3:39am

eyebysickle are you planning on selling your units? I am in the UK and keen to try this out and would prefer to test with a unit known to have a high chance of working without opening up the unit.

bart1006   10 W

10 W
Posts: 90
Joined: Sep 24 2012 11:10am
Location: Zwolle

Re: Looking for an alpha tester for "totally bluetooth"

Post by bart1006 » Aug 28 2019 6:57am

perryscope wrote:
Aug 28 2019 2:55am
geeksville wrote:
Aug 27 2019 8:32pm
So,

Thanks to eyebysickle talking to the mfg and getting us some key data we've now made changes that have a pretty good shot of allowing 'solderless/no need to even open the SW102' bluetooth initial installation. However, in making these changes I've now changed the device eyebysickle gifted me with that I can no longer test a 'from scratch' installation. I think it has a very good chance of 'just working' on a virgin device from their factory, but I can't promise it.

So. If any of ya'll are interested in using a SW102 and you are comfortable with using our existing instructions (i.e. open the unit and use an ST-LINK for the initial load) but haven't yet tried it: We are looking for someone willing to try our new wireless update instructions instead. Note: It is possible this update won't work and at that point you would need to open the unit and install the conventional way (thus the possibility that you still might need to open the unit if this approach fails).

It might be that all SW102s support this wireless update? but we know for sure that the semi-custom units made for eyebysickle & eggrider do have this feature. So if you have been wanting to buy one, you might want to buy it from either of them.

If you are willing to be a trailblazer and try this, the basic instructions are here. But I'm happy to chat with anyone who wants to try this for us: https://github.com/OpenSource-EBike-fir ... -525492910
Sure happy to try this once I receive my next device in the next few days.

Edit:

I have received a unit today! :) so will try this later and let you guys know how I get on.
PS this is the Ali Express seller I ordered my unit from. https://www.aliexpress.com/item/4000054 ... 4c4drTZe5H about 10 days delivery to the UK.
I have a spare one still in the box which i can use for testing. At this moment somebody has my bike with him on a holiday. When it is back and still needed I can test it. Or can i also test the procedure without being connected to the tsdz2 motor by only power the sw102 lcd?

perryscope   100 W

100 W
Posts: 106
Joined: Jan 06 2019 4:29pm
Contact:

Re: Looking for an alpha tester for "totally bluetooth"

Post by perryscope » Aug 28 2019 7:32am

bart1006 wrote:
Aug 28 2019 6:57am
I have a spare one still in the box which i can use for testing. At this moment somebody has my bike with him on a holiday. When it is back and still needed I can test it. Or can i also test the procedure without being connected to the tsdz2 motor by only power the sw102 lcd?
You can flash the sw102 with just the screen powered from another power source, I have flashed all my screens like this.
However I would hold off for the time being as eyebyesickle has found an issue with this method... please see..

viewtopic.php?f=30&t=93818&p=1492482#p1492480
Empowered people support rider and trustee
www.empoweredpeople.co.uk

qwerkus   1 kW

1 kW
Posts: 484
Joined: Jul 22 2017 4:00am

Re: Looking for an alpha tester for "totally bluetooth"

Post by qwerkus » Sep 01 2019 8:52am

geeksville wrote:
Aug 27 2019 8:32pm
So,

Thanks to eyebysickle talking to the mfg and getting us some key data we've now made changes that have a pretty good shot of allowing 'solderless/no need to even open the SW102' bluetooth initial installation. However, in making these changes I've now changed the device eyebysickle gifted me with that I can no longer test a 'from scratch' installation. I think it has a very good chance of 'just working' on a virgin device from their factory, but I can't promise it.

So. If any of ya'll are interested in using a SW102 and you are comfortable with using our existing instructions (i.e. open the unit and use an ST-LINK for the initial load) but haven't yet tried it: We are looking for someone willing to try our new wireless update instructions instead. Note: It is possible this update won't work and at that point you would need to open the unit and install the conventional way (thus the possibility that you still might need to open the unit if this approach fails).

It might be that all SW102s support this wireless update? but we know for sure that the semi-custom units made for eyebysickle & eggrider do have this feature. So if you have been wanting to buy one, you might want to buy it from either of them.

If you are willing to be a trailblazer and try this, the basic instructions are here. But I'm happy to chat with anyone who wants to try this for us: https://github.com/OpenSource-EBike-fir ... -525492910
This looks super promising indeed. When you mean a "virgin device", you mean a sw102 with bafang firmware ? Because I have a unit here that came with a lishui controller. Looks a bit different.

There is also a KT version of the display that showed up on aliexpress, though it looks more like a cheap copy without OLED than an actual new version: https://ae01.alicdn.com/kf/HTB1eAx7VXzq ... -Parts.jpg

Image

geeksville   10 W

10 W
Posts: 82
Joined: Aug 02 2019 6:44pm

Re: Looking for an alpha tester for "totally bluetooth"

Post by geeksville » Sep 01 2019 11:48am

qwerkus wrote:
Sep 01 2019 8:52am

This looks super promising indeed. When you mean a "virgin device", you mean a sw102 with bafang firmware ? Because I have a unit here that came with a lishui controller. Looks a bit different.

There is also a KT version of the display that showed up on aliexpress, though it looks more like a cheap copy without OLED than an actual new version: https://ae01.alicdn.com/kf/HTB1eAx7VXzq ... -Parts.jpg

Image
re: wireless update of a virgin device without ever having to open it
yes, that's the goal. Alas, our last experiment shows we are "close but still not working". I think our current status on this idea is on hold for a few weeks. We have some other things we want to push out for the SW102 and 850C before going back to this idea. So in a few weeks, after those things are finished I'll probably order another virgin device. But on that device I'll be more careful and run a tedious tool that uses JTAG to sneakily copy out the entire firmware from the device. Which will then allow me to debug and find the remaining problem and test solutions with the ability for me to "revirginmotize it" repeatedly while testing.

re: that cheap copy
Looks super amusing. Do you know of a link to purchase it? I might buy one to play with (as long as the LCD is not segmented, but rather pixels).

casainho   10 GW

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

Re: Looking for an alpha tester for "totally bluetooth"

Post by casainho » Sep 01 2019 12:04pm

geeksville wrote:
Sep 01 2019 11:48am
qwerkus wrote:
Sep 01 2019 8:52am

This looks super promising indeed. When you mean a "virgin device", you mean a sw102 with bafang firmware ? Because I have a unit here that came with a lishui controller. Looks a bit different.

There is also a KT version of the display that showed up on aliexpress, though it looks more like a cheap copy without OLED than an actual new version: https://ae01.alicdn.com/kf/HTB1eAx7VXzq ... -Parts.jpg

Image
re: that cheap copy
Looks super amusing. Do you know of a link to purchase it? I might buy one to play with (as long as the LCD is not segmented, but rather pixels).
Is the KT-LCD4 and it is almost for sure segment. Get it here: https://www.aliexpress.com/item/33016875338.html

PSWPower sells SW102 for $35 while that segmented KT-LCD4 costs $30.
- 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.

geeksville   10 W

10 W
Posts: 82
Joined: Aug 02 2019 6:44pm

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

Post by geeksville » Sep 01 2019 12:58pm

heh:

> PSWPower sells SW102 for $35 while that segmented KT-LCD4 costs $30.

I guess that settles that. also: segments suck. ;-)

(Though I do wish the otherwise amazing SW102 they had opted for a transflective LCD - it seems the oled though sexy is a bit hard to read in direct sun)

sidmodi   1 mW

1 mW
Posts: 11
Joined: Oct 28 2018 12:57am

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

Post by sidmodi » Sep 03 2019 6:52pm

My SW102 finally arrived. I will leave it in it's "virgin" state for now and wait for further instructions to try the method to flash the device without opening it. Geeksville, I am happy to volunteer my device for any new experimental methods to try flashing. Thanks for all the work you have done so far!

geeksville   10 W

10 W
Posts: 82
Joined: Aug 02 2019 6:44pm

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

Post by geeksville » Sep 03 2019 7:04pm

sidmodi wrote:
Sep 03 2019 6:52pm
My SW102 finally arrived. I will leave it in it's "virgin" state for now and wait for further instructions to try the method to flash the device without opening it. Geeksville, I am happy to volunteer my device for any new experimental methods to try flashing. Thanks for all the work you have done so far!
Hi,

Alas - I think the next step is for me to carefully image a virgin device myself (which I'm happy to do, but I'll need to buy a device). So I think I'm going to spend a few weeks finishing the rest of the items we need for 1.0 first (https://github.com/OpenSource-EBike-fir ... re/TODO.md). So I bet your wait for wireless install will be about a 4-6 wks. If that is a problem, you should probably just use an ST-LINK and open up the device.

e3s   10 W

10 W
Posts: 76
Joined: Jan 08 2018 12:40pm

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

Post by e3s » Sep 05 2019 7:47am

From a bit of time I'm thinking to integrate the mid drive with arduino, adding some sensors. Practically riding with two screens, one with all info about the motor. Now I haven't so much time to begin the project but I was thinking if you are interested to connect arduino with sw102 lcd. There are "endless" :) possibility. One of them is to have more buttons to activate a precise function, it's a far far far away possibility because it's not released neither a stable version.

casainho   10 GW

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

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

Post by casainho » Sep 05 2019 8:00am

(...) delete.
Last edited by casainho on Sep 05 2019 10:53am, edited 1 time in total.
- 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.

e3s   10 W

10 W
Posts: 76
Joined: Jan 08 2018 12:40pm

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

Post by e3s » Sep 05 2019 10:21am

I like the original controller but if there's a better alternative...

mittkonto   10 mW

10 mW
Posts: 34
Joined: Mar 02 2019 2:31am

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

Post by mittkonto » Sep 05 2019 10:24am

So, getting open source software on a device like this... indeed, the possibilities..

One nice thing could be "the front end for (a) bluetooth open source shifting (BOSS)".
Sure there is xshifter, but $400 is a bit steep, at least to me.
By the wholesome Code Gods of Muchgivings!!? A tidy TSDZ2 spliced cable and a nice chunk of HIGO-Z812-B with a tad of temperature mods sprinkled on top, you say?

casainho   10 GW

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

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

Post by casainho » Sep 05 2019 12:31pm

I would like to make a standalone Bluetooth terrain inclination sensor, so the SW102 could automatically increase/decrease the assistant level based on the terrain inclination -- more assist on hills and less on descends.

There is a 5 euro board on eBay that includes a NRF51822 (the same inside SW102) and an IMU -- see bellow.

The idea was to add a battery, a USB battery charger and a power switch, so the system could be placed on some fixed part of the ebike.

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

geeksville   10 W

10 W
Posts: 82
Joined: Aug 02 2019 6:44pm

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

Post by geeksville » Sep 05 2019 2:37pm

e3s wrote:
Sep 05 2019 7:47am
From a bit of time I'm thinking to integrate the mid drive with arduino, adding some sensors. Practically riding with two screens, one with all info about the motor. Now I haven't so much time to begin the project but I was thinking if you are interested to connect arduino with sw102 lcd. There are "endless" :) possibility. One of them is to have more buttons to activate a precise function, it's a far far far away possibility because it's not released neither a stable version.
I like this idea, but rather than arduino, I'd recommend one of the arduino like boards that already have nice built in BT LE support. That would allow an easy transport to the SW102 without soldering (and there is only one free UART on the SW102 and we already use that to talk to the motor).

geeksville   10 W

10 W
Posts: 82
Joined: Aug 02 2019 6:44pm

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

Post by geeksville » Sep 05 2019 2:39pm

If someone wants to do an openhw version of xshifter I think that would be awesome. A suitable linear servo attached to the board casainho just pointed to would do everything you want. And the SW102 could be the UI. Forking into a new thread here: viewtopic.php?f=30&t=102236

e3s   10 W

10 W
Posts: 76
Joined: Jan 08 2018 12:40pm

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

Post by e3s » Sep 05 2019 4:33pm

Open source e-shifter is not a problem, I saw many times ago some projects with arduino.

geeksville   10 W

10 W
Posts: 82
Joined: Aug 02 2019 6:44pm

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

Post by geeksville » Sep 05 2019 4:59pm

e3s wrote:
Sep 05 2019 4:33pm
Open source e-shifter is not a problem, I saw many times ago some projects with arduino.
ooh thanks for your pointer adding a link to this: https://www.instructables.com/id/DIY-El ... erailleur/

e3s   10 W

10 W
Posts: 76
Joined: Jan 08 2018 12:40pm

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

Post by e3s » Sep 05 2019 6:15pm

It was nothing.just a little contribute :)

casainho   10 GW

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

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

Post by casainho » Sep 05 2019 7:21pm

Why not write a wiki page with the idea and the links for the other projects?
- 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.

e3s   10 W

10 W
Posts: 76
Joined: Jan 08 2018 12:40pm

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

Post by e3s » Sep 05 2019 7:46pm

casainho wrote:
Sep 05 2019 12:31pm
I would like to make a standalone Bluetooth terrain inclination sensor, so the SW102 could automatically increase/decrease the assistant level based on the terrain inclination -- more assist on hills and less on descends.


Image
inclination sensor in a front suspended bike and worse in a full suspended is so so, in a road bike you can put it everywhere. Prons is a fast response, cons is sensible in a rough terrain. A road with a 10% gradient has only 6 degrees of inclination, 5% 3 degrees. Barometer is less sensitive in this condition but it requires more resources because it needs the variable of the speed

perryscope   100 W

100 W
Posts: 106
Joined: Jan 06 2019 4:29pm
Contact:

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

Post by perryscope » Sep 10 2019 2:17pm

can I just check should the battery icon change when the battery is full or is it just static empty icon at the moment?

I understand if this has not been coded yet just was not sure if its a bug or just not yet implemented.
Empowered people support rider and trustee
www.empoweredpeople.co.uk

casainho   10 GW

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

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

Post by casainho » Sep 10 2019 3:22pm

perryscope wrote:
Sep 10 2019 2:17pm
can I just check should the battery icon change when the battery is full or is it just static empty icon at the moment?

I understand if this has not been coded yet just was not sure if its a bug or just not yet implemented.
Battery icon works. Make sure to select correct mount of battery cells on configurations.
- 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.

hex4def6   100 µW

100 µW
Posts: 8
Joined: Apr 14 2017 12:20pm

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

Post by hex4def6 » Sep 10 2019 5:18pm

Quick side question: is it possible to use another openocd compatible flashing tool? I have a flyswatter2, ft2232h, and an olimex usb-tiny-h at my disposal.

perryscope   100 W

100 W
Posts: 106
Joined: Jan 06 2019 4:29pm
Contact:

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

Post by perryscope » Sep 13 2019 2:50am

casainho wrote:
Sep 10 2019 3:22pm
perryscope wrote:
Sep 10 2019 2:17pm
can I just check should the battery icon change when the battery is full or is it just static empty icon at the moment?

I understand if this has not been coded yet just was not sure if its a bug or just not yet implemented.
Battery icon works. Make sure to select correct mount of battery cells on configurations.
Yes selected 13 cells for a 48V battery, it is moving but I feels like its on the low side, for example at 46.5v you would think the battery was empty looking at the symbol, when in reality that's closer to half full. in comparison the KT-LCD3 would show two out of 4 segments or half full. Not a big issue but due to the small font its difficult to read the voltage amount on the move and a quick glance at the battery symbol is more important.

The other issue I have seen is that even when you select mph in the menu the speed is still shown in kph.
Attachments
battery-sw102.JPG
battery-sw102.JPG (24.17 KiB) Viewed 1675 times
Empowered people support rider and trustee
www.empoweredpeople.co.uk

Post Reply