TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Electric Motors and Controllers
casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Nov 27 2021 4:41pm

anszom wrote:
Nov 27 2021 10:05am
As a bonus, it should be easy to port this to casainho's DIY display, as the electronics are quite similar.
Great work!!

I just got OLED SPI version work, that is the same as SW102, so closer / easier to port your firmware.

I am in the process to release a stable version of the OpenSource display firmware, so, I will not port or test your firmware right now.

Also I am starting on another different project, the Xiaomi M365 scooter motor controller and display firmware and so I need a stable version of the display.

I need a firmware that is easy to adapt for different project / device and the previous SW102 firmware was developed thinking on that, with the layout and fields, is quick to adapt a different design. You firmware seems, at least visually, very specific to TSDZ2 and I wounder if it follows the same ideas as previous firmware on the layout and fields.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

anszom   10 µW

10 µW
Posts: 6
Joined: Nov 27 2021 9:43am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by anszom » Nov 27 2021 6:22pm

I need a firmware that is easy to adapt for different project / device and the previous SW102 firmware was developed thinking on that, with the layout and fields, is quick to adapt a different design. You firmware seems, at least visually, very specific to TSDZ2 and I wounder if it follows the same ideas as previous firmware on the layout and fields.
Yes, that's mostly right. My idea was to design a nice UI for an ebike - it was easier to drop the "generality" of the layouts in the process. I don't think there's anything specific to the TSDZ2 in the UI code though (aside from the config tree).

If I was trying to "port" this to a scooter, I would perhaps reuse some of the "backend" code, but the UI - at least the main screen - would need to be redesigned for the new use-case (not that it's THAT much of work - the main screen code is about 300 lines total).

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Nov 27 2021 6:32pm

anszom wrote:
Nov 27 2021 6:22pm
I need a firmware that is easy to adapt for different project / device and the previous SW102 firmware was developed thinking on that, with the layout and fields, is quick to adapt a different design. You firmware seems, at least visually, very specific to TSDZ2 and I wounder if it follows the same ideas as previous firmware on the layout and fields.
Yes, that's mostly right. My idea was to design a nice UI for an ebike - it was easier to drop the "generality" of the layouts in the process. I don't think there's anything specific to the TSDZ2 in the UI code though (aside from the config tree).

If I was trying to "port" this to a scooter, I would perhaps reuse some of the "backend" code, but the UI - at least the main screen - would need to be redesigned for the new use-case (not that it's THAT much of work - the main screen code is about 300 lines total).
Do you have experience with Garmin GPS Edge or any watch like Fenix? - because the SW102 firmware was to be like that, were user could have a few main screens, on each screen could choose some predefined layouts (like 1 big field or 2 small fiels, or 3 small fields or such) and then could choose each variable field (and even choose a graphic field or numeric field - like for 1 big field as you did, user could choose the graph field).

Does you firmware support customization of variable of each field? and are your fields only graph or could they also be numeric?

Other then a graph, I wish to have like a small horizontal bar graph to use the same space as current numeric fields, so user could like see if battery voltage is somewhere between 0 up to 100%.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

anszom   10 µW

10 µW
Posts: 6
Joined: Nov 27 2021 9:43am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by anszom » Nov 28 2021 7:14am

Does you firmware support customization of variable of each field? and are your fields only graph or could they also be numeric?
Not really. I mean, you could customize all you want by changing the source code, but as a user you can't alter the layout.

I haven't seen the Garmin or Fenix devices but I think the xiaomi smartbands have a similar option for customizing the "face" of the watch. It's a nice idea - and now I understand the reason behind the complexity of your code :) . The only issue I see is that configuring the layouts on the SW102 device itself would be really impractical - you would need to use a smartphone for this.

I chose a different approach, to (quickly) make something that works well for me. I hope that it can also be useful to others. But it's not going to be anything close to "universal".

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Nov 28 2021 7:42am

anszom wrote:
Nov 28 2021 7:14am
Does you firmware support customization of variable of each field? and are your fields only graph or could they also be numeric?
Not really. I mean, you could customize all you want by changing the source code, but as a user you can't alter the layout.

I haven't seen the Garmin or Fenix devices but I think the xiaomi smartbands have a similar option for customizing the "face" of the watch. It's a nice idea - and now I understand the reason behind the complexity of your code :) . The only issue I see is that configuring the layouts on the SW102 device itself would be really impractical - you would need to use a smartphone for this.

I chose a different approach, to (quickly) make something that works well for me. I hope that it can also be useful to others. But it's not going to be anything close to "universal".
The layouts on Garmin are predefined and user can select from a some like 10 or 16 different ones, starting showing only variable up to 10 variables. No mobile app to select the layout.
Even the idea was to have the display to be placed on vertical or horizontal, and have specific layouts for horizontal. Can you imagine your graph to scale up on X and scale down on Y?

That is not my code, that code was developed by other developer and I do not have knowledge to develop such structured / flexible code, still I did learn a lot with it - that developer then moved on and developed this incredible device - Meshtastic: Open Source hiking, pilot, skiing and secure GPS mesh communicator: https://meshtastic.org/

So knowing your firmware was not developed with this ideas, I will not use my time on the next weeks to try it. Still I am very curious and I want to look at it, to learn and maybe reuse at least the graphs.

If you want to port it to the OpenSource display, your are welcome and I can guide you in anything you may need.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

Voytek   1 µW

1 µW
Posts: 2
Joined: Jul 03 2019 4:40am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Voytek » Dec 09 2021 11:27am

Hi Guys,
Considering all similarities between the 850c and 750c displays I've found close to nothing regarding the OSF compatibility with the 750c (with or without bluetooth). Would it be possible to make TSDZ2 work with 750c using OSF?
I'd appreciate your thoughts on this.

takai   1 µW

1 µW
Posts: 2
Joined: Dec 09 2021 7:38pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by takai » Dec 09 2021 7:45pm

Newbie to the SW102 displays, and I bought one before reading about the second PCB variant. It arrived in the mail this week and sure enough it was the second variant. But I did some fiddling and I think the second variant is actually preferred over the first one.

I did the chop around buttons method to open it up from the keypad side and as casainho has found there are no programming pads on the top PCB surface.
Image

However, after some prying and then cutting the PCB mounts off with a flush cutter the PCB can be flipped over and the programming pads are on the back:
Image

They are super close to the edge of the casing there, and effectively down in this lower corner of the case:
Image

I think with some careful dremel or knife work it will be trivial to reveal the pads on the new SW102 v3.1.1 boards, and will actually be easier than the old method to seal back up. A bit of silicone or sikaflex on the underside will easily keep it waterproof and you are going nowhere near the buttons or the top surface.

Will attempt to program it later today and report back on that.

Peacepirate   100 mW

100 mW
Posts: 36
Joined: Sep 22 2020 11:49am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Peacepirate » Dec 24 2021 5:31pm

@ anszom
Vow, your display looks great. Thank you although i havn‘t used it yet because of testing mbrusas new software which doesn’t seem to be bad at the moment and quite popular, i believe. hopefully someone will adapt your display firmware for his controller firmware too one day.

Fellan   1 µW

1 µW
Posts: 2
Joined: Feb 24 2017 2:05pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Fellan » Dec 29 2021 4:32pm

takai wrote:
Dec 09 2021 7:45pm
Newbie to the SW102 displays, and I bought one before reading about the second PCB variant. It arrived in the mail this week and sure enough it was the second variant. But I did some fiddling and I think the second variant is actually preferred over the first one.

I did the chop around buttons method to open it up from the keypad side and as casainho has found there are no programming pads on the top PCB surface.
Image

However, after some prying and then cutting the PCB mounts off with a flush cutter the PCB can be flipped over and the programming pads are on the back:
Image

They are super close to the edge of the casing there, and effectively down in this lower corner of the case:
Image

I think with some careful dremel or knife work it will be trivial to reveal the pads on the new SW102 v3.1.1 boards, and will actually be easier than the old method to seal back up. A bit of silicone or sikaflex on the underside will easily keep it waterproof and you are going nowhere near the buttons or the top surface.

Will attempt to program it later today and report back on that.

Did the programming turn out alright?
Debating ordering the sw102 and will probably get the new version, would be nice to now if it works with OSF firmware.

Would love to build casainhos diy display but I am short on free time and lack easy access to a 3d printer.

And it seems like I could repurpose the sw102 display into an diy display if I manage to blow it up.

Also been trying to find cheap higo 8 pin connectors so I don't have to cut the vlcd5 display wire, but the connectors seems hard to find in Europe och China. Any general ideas for finding connectors?

Best regards

Peacepirate   100 mW

100 mW
Posts: 36
Joined: Sep 22 2020 11:49am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Peacepirate » Dec 29 2021 5:07pm

Fellan wrote:
Dec 29 2021 4:32pm
Debating ordering the sw102 and will probably get the new version, would be nice to now if it works with OSF firmware.


Best regards
[/quote]

i can confirm it works.

Fellan   1 µW

1 µW
Posts: 2
Joined: Feb 24 2017 2:05pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Fellan » Dec 31 2021 6:48am

Peacepirate wrote:
Dec 29 2021 5:07pm

i can confirm it works.
Great to hear, thanks for the info!

Regarding 8-pin cables it seems like 1t4 "extension cables" found on aliexpress have male and female 8-pin connectors if someone is searching for one. Will order and see if it fits.

andyb   10 mW

10 mW
Posts: 28
Joined: Oct 26 2021 3:42am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by andyb » Jan 11 2022 4:50am

Thanks for sharing that, it' s a huge help for me as i'm getting one later this month. It looks like you did a great job of cutting it open, any tips?
Also, is there any way of knowing which version you have before cutting it open?

corny   10 µW

10 µW
Posts: 5
Joined: Jan 18 2022 1:45pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by corny » Jan 18 2022 1:54pm

andyb wrote:
Jan 11 2022 4:50am
Thanks for sharing that, it' s a huge help for me as i'm getting one later this month. It looks like you did a great job of cutting it open, any tips?
Also, is there any way of knowing which version you have before cutting it open?
it's easy to distinguish both versions of the SW102: The cover of the up and down-keypad (without 'M'-Key) measures 20mm on the old vs. 26mm on the new version. So the new version is slightly bigger.
Attachments
IMG_9465.JPG
IMG_9465.JPG (810.13 KiB) Viewed 837 times

andyb   10 mW

10 mW
Posts: 28
Joined: Oct 26 2021 3:42am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by andyb » Jan 20 2022 5:00am

Thank you that's brilliant, just what I needed. :bigthumb:

corny   10 µW

10 µW
Posts: 5
Joined: Jan 18 2022 1:45pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by corny » Jan 20 2022 1:18pm

Meanwhile I can also confirm that the new version of the SW102 seems to be fully compatible with the OSF.

anszom   10 µW

10 µW
Posts: 6
Joined: Nov 27 2021 9:43am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by anszom » Jan 20 2022 3:36pm

Peacepirate wrote:
Dec 24 2021 5:31pm
@ anszom
Vow, your display looks great. Thank you although i havn‘t used it yet because of testing mbrusas new software which doesn’t seem to be bad at the moment and quite popular, i believe. hopefully someone will adapt your display firmware for his controller firmware too one day.
I'd be interested to hear what are the advantages of the mbrusa version compared to casainho's.

Right now I'm using mbrusa's firmware on my wife's ebike (VLCD5), and casainho's motor firmware on my ebike (SW102).

Peacepirate   100 mW

100 mW
Posts: 36
Joined: Sep 22 2020 11:49am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Peacepirate » Jan 22 2022 11:33am

anszom wrote:
Jan 20 2022 3:36pm
Peacepirate wrote:
Dec 24 2021 5:31pm
@ anszom
Vow, your display looks great. Thank you although i havn‘t used it yet because of testing mbrusas new software which doesn’t seem to be bad at the moment and quite popular, i believe. hopefully someone will adapt your display firmware for his controller firmware too one day.
I'd be interested to hear what are the advantages of the mbrusa version compared to casainho's.

Right now I'm using mbrusa's firmware on my wife's ebike (VLCD5), and casainho's motor firmware on my ebike (SW102).
Witam z kolonie.

Well, guess that then you already know the differences?
I don‘t claim to be a benchmark for good software implementation but i was never satisfied with casainho‘s „original“ firmware in terms of quick and appropriate motor response compared to the original tsdz2 firmware although i highly respect the efforts and the idea of this osf in general.
I was not very happy with mbrusas 20.C1 for sw102 too because of the same issue but his newest firmware (20.C3 ? or sth like that) seems to be be quiet improved after a few test rides. Motor responds more vividly and you don’t have to pedal once 360 degrees before feeling noticable motor responce. I am missing the menu point where you you can set motor ampereage (only battery amp can be set) thus the system is weaker than with r0nkos fork.
You can set different support modes( torque only/power/ emtb?/ cadence) and there will be other small improvements. I am not completly satisfied with mbrusas formware either and will probably never be unless i don’t install eclipse and try to implement and compile my own ideas but at least mbrusas firmware seems to be still under active development in contrast to casainhos firmware 1.1.0 and i would highly appreciate your modern display firmware being compatible with mbrus fork because the standard display firmware of sw102 looks really poor and could need some visual facelift.

andyb   10 mW

10 mW
Posts: 28
Joined: Oct 26 2021 3:42am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by andyb » Jan 27 2022 4:15am

corny wrote:
Jan 20 2022 1:18pm
Meanwhile I can also confirm that the new version of the SW102 seems to be fully compatible with the OSF.
Can you please help me some more, is this correct for the sw102 (I added the last column in the table)
The VCC and Kp confused me slightly.

I think VCC is P+ and Kp is Vin/PL is that right?

The picture was from an online manual for the sw102. I added the last column in the table,


:warn: :warn: p4turned out the table was wrong please just use the guidance in the post below :warn: :warn:

Thanks (again).
leads sw102.jpg
leads sw102.jpg (97.9 KiB) Viewed 596 times
Last edited by andyb on Mar 07 2022 2:44pm, edited 1 time in total.

corny   10 µW

10 µW
Posts: 5
Joined: Jan 18 2022 1:45pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by corny » Jan 27 2022 12:25pm

andyb wrote:
Jan 27 2022 4:15am
corny wrote:
Jan 20 2022 1:18pm
Meanwhile I can also confirm that the new version of the SW102 seems to be fully compatible with the OSF.
Can you please help me some more, is this correct for the sw102 (I added the last column in the table)
The VCC and Kp confused me slightly.

I think VCC is P+ and Kp is Vin/PL is that right?

The picture was from an online manual for the sw102. I added the last column in the table,

Thanks (again).

leads sw102.jpg
yes, it is correct. But I think the wire colors are not correct in the SW102 manual. I used this guide:

https://github.com/OpenSourceEBike/TSDZ ... 2-to-TSDZ2

this worked in my case for the old and new version of the SW102.

corny   10 µW

10 µW
Posts: 5
Joined: Jan 18 2022 1:45pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by corny » Jan 27 2022 12:28pm

and don't be confused by the last picture in the link. What counts is this table: https://github.com/OpenSourceEBike/TSDZ ... otor-cable

andyb   10 mW

10 mW
Posts: 28
Joined: Oct 26 2021 3:42am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by andyb » Jan 27 2022 1:37pm

Thanks again, I have already done a 860c which died after a month of not being used, and your advice about the table is spot on.

DiodeCavern   1 µW

1 µW
Posts: 2
Joined: Jan 30 2022 6:54am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by DiodeCavern » Jan 30 2022 6:58am

Kudos for all the hard work.

I’m new to ebiking, I’ve fitted a TSDZ2 to my MTB with a VLCD5 display running stock firmware.

I’d like to try the opensource firmware, I’ve bought a SW102 (new version) and have a ST-Link2 programmer. I’ve carefully removed the switches and PCB to access the programming connections.

Where I’m stuck is in finding the hex file for the bootloader, the links in the wiki are broken, and I’ve been unable to find the file in the github repo. I believe I’m looking for a file named sw102-full-1.1.0.hex ?

Could you point me to the file I need?
Thanks

andyb   10 mW

10 mW
Posts: 28
Joined: Oct 26 2021 3:42am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by andyb » Jan 31 2022 6:28am

I think this is what you need (zipped folder).
sw102-full-0.19.11.zip
(209.29 KiB) Downloaded 16 times
I went through the same thing and in the end had to use the wayback machine to find the file here

https://web.archive.org/web/20201206230 ... ag/0.19.11

corny   10 µW

10 µW
Posts: 5
Joined: Jan 18 2022 1:45pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by corny » Jan 31 2022 12:37pm

andyb wrote:
Jan 31 2022 6:28am
I think this is what you need (zipped folder).

sw102-full-0.19.11.zip

I went through the same thing and in the end had to use the wayback machine to find the file here

https://web.archive.org/web/20201206230 ... ag/0.19.11
Here you can download the 0.19.17 version:

https://github.com/OpenSource-EBike-fir ... .19.17.hex

DiodeCavern   1 µW

1 µW
Posts: 2
Joined: Jan 30 2022 6:54am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by DiodeCavern » Feb 02 2022 5:00am

Thanks, I will program it up and try over the weekend.

Post Reply