Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
obcd   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by obcd » Dec 28 2019 6:00pm

I was under the impression the configurator was initially made for configuring the kuteng controllers with open source firmware.
I have no idea who started writing it and if it comes with a GPL or other license.
So, what is so special about Marcoq his configurator that shouldn't be revealed to the public?
As newbie, it's difficult to understand the different motor firmware forks.
There seems to be at least 2 or 3 forks that work with some (all?) of the original displays.
Next, there is the question on what motor firmware revision they are based on, with what features.
If the configurator "sources" were handed over to other dev's with the clear request not to publish them, I can understand Marcoq's feeling, but we don't know what happened.

flufferty   100 mW

100 mW
Posts: 37
Joined: Apr 22 2017 4:00pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by flufferty » Dec 28 2019 6:02pm

obcd wrote:
Dec 28 2019 6:00pm
I was under the impression the configurator was initially made for configuring the kuteng controllers with open source firmware.
I have no idea who started writing it and if it comes with a GPL or other license.
So, what is so special about Marcoq his configurator that shouldn't be revealed to the public?
As newbie, it's difficult to understand the different motor firmware forks.
There seems to be at least 2 or 3 forks that work with some (all?) of the original displays.
Next, there is the question on what motor firmware revision they are based on, with what features.
If the configurator "sources" were handed over to other dev's with the clear request not to publish them, I can understand Marcoq's feeling, but we don't know what happened.
It does not matter where he got the configurator from, nor does his intentions matter, he bundled it with the GPL-project from opensource-tsdz2 project, and therefore his code is also subject to GPL.

User avatar
stancecoke   100 kW

100 kW
Posts: 1170
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 28 2019 6:20pm

chri27.5 wrote:
Dec 28 2019 3:40pm
today marcoq has officially published on jobike that it will no longer release any version, its work ends like this.
sorry I just can't understand that trouble. The configurator was originally developed by me, Casainho and Xnyle as open source for the kunteng firmware.
Anybody can decompile marcoq's .jar file within three minutes with e.g. this online java decompiler.

I just deleted my fork, including the wiki. As I don't use no TSDZ2, it's no loss for me.

regards
stancecoke

famichiki   100 W

100 W
Posts: 130
Joined: Jul 12 2019 9:00am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by famichiki » Dec 28 2019 6:30pm

I do not think Marcoq acted in bad faith but simply did not understand his obligations and possibly still does not. On the Jobike forum the discussion is about the configurator being based on work by Stancecoke, when it should be about the OSF.

https://translate.google.com/translate? ... hpage%3D57

Casainho raised the issue with him many months ago on Github.

https://github.com/qmarco/TSDZ2-Smart-E ... y/issues/3

I am no expert on the GPL, but as I understand it is applicable because this is a derivative work of the OSF... the configurator is useless on its own without the OSF plus it essentially communicates with the OSF project through the configuration data and by calling the compile/program batch scripts.

Also, sorry to hear that Stancecoke, thank you for your efforts and providing a valuable service.

Elinx   100 W

100 W
Posts: 187
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 28 2019 7:42pm

I highly respect the efforts of marcoq for developing the Java configurator for easy configuring OSF for default displays.
I think other people did too, because nobody had recompiled the java gui before and published as another fork.
As I understand this should be an easy job for people with Java experience.
So nobody has used or stolen the intellectual property of marcoq.

I can imagine that marcoq was unpleasent surprised after the publication without his permission, but I hope he will see that there was no bad intention and hope that he will develope the configurator further.
If this should not be the case then I thank marcoq for the work he has done for us; people with tsdz2 and default display.

@stancecoke, it is a pity that you ended the service for marcoq's fork, but I understand your reasons. Thanks for the service you have given.

Demion   10 mW

10 mW
Posts: 27
Joined: Jun 10 2018 3:42am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Demion » Dec 29 2019 1:14am

Hi. I made fork a while ago too. There was no much interest in it, but famichiki tested it, and contacted me in PM recently.
If someone interested, I will quote here more information about it.
Demion wrote:
Jul 06 2019 7:09am
Based on OpenSource-EBike-firmware/TSDZ2-Smart-EBike (casainho, buba, endlesscadence) and added TSDZ2 VLCD display protocol code (hurzhurz, marcoq), no other changes at all.
All configs are in config.h. Need to configure manually and compile by yourself.
https://github.com/Demion/TSDZ2-Smart-E ... cd_v0.18.2
https://github.com/Demion/TSDZ2-Smart-E ... cd_v0.19.0
Demion wrote:
Dec 11 2019 1:04am
My fork is exact copy from original OSF no changes at all except, adding support of VLCD5/VLCD6 displays and default configuration (to run without display if needed).

Need first enabled it set DISPLAY_VLCD_CONTROL_FUNCTIONS to 1.
Turning on light (holding light button) will switch on / off (toggle)

Code: Select all

0 - lights
1 - street mode
2 - boost mode
3 - power limit enable
4 - switch to show data
after switching 4
0 - lights
1 - show pedal power / 10
2 - show voltage
3 - show current
4 - switch back to controls
Demion wrote:
Dec 11 2019 12:09pm
You select assist level 1 hold lights button screen backlight should lighten up. That means street mode is enabled.
If you want to disable street mode then you should hold lights button (still on assist level 1) until screen backlight turns off.
If you want to keep street mode but turn off backlight or turn on/off lights you need to switch to assist level 0 and then press lights button.
After you switched feature on / off you can select any assist level you want to ride.
Same for other features.
After you turn on lights at level 4 your 1-2-3 levels switches will show some data as error code. For instance 52v voltage will be E52, 10a current will be E10.
It will not show speed in that mode though. That is the limit of VLCD screen, unfortunately.

P.S. maybe on VLCD5 you need to press power button twice to turn on / off lights and backlight and toggle features.
On VLCD6 it is hold assist up to turn on lights and backlight, hold assist down to turn on walk / cruise mode.
Demion wrote:
Jan 02 2020 2:58am
Code is triggered when light switch state is changed (from on to off or vice versa) then checks if assist level 4 was previously set on for data display. Then corresponding function (or data display) is switched on if lights on or switched off if lights off, accordingly. Assist level 0 (off) is reserved for switching backlight and/or lights on/off without changing any settings.
Btw I plan working on esp8266 module for TSDZ2 to control ebike from phone with bluetooth next spring / summer.
I might as well add VLCD support to v0.20.0, but it may take a while (about month).
If someone interested to make GUI (Java) to change configs, contact me PM.
Thanks.
Last edited by Demion on Jan 02 2020 3:03am, edited 1 time in total.

User avatar
stancecoke   100 kW

100 kW
Posts: 1170
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 29 2019 5:50am

famichiki wrote:
Dec 28 2019 6:30pm
On the Jobike forum the discussion is about the configurator being based on work by Stancecoke

https://translate.google.com/translate? ... hpage%3D57
Of course you can find the link to the GNU licence in the readme of the Kunteng repo.
We developers are all hobbyists and spend many hours of our sparetime with this hobby. We all publish our code, so anyone can improve the work and share it with the community...

regards
stancecoke

Elinx   100 W

100 W
Posts: 187
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 29 2019 6:08am

Demion wrote:
Dec 29 2019 1:14am
Hi. I made fork a while ago too. There was no much interest in it, but famichiki tested it, and contacted me in PM recently.
If someone interested, I will quote here more information about it......
Nice to see you here again, you say then that your fork only was a temperary one and that you go with sw102, so I thought you ended the project then with v0.19
I know about your fork for vlcd5-6 display's and on regulary base I have mentioned this too to others (like famichiki) in this topic.
I was especially surprised by the simplicity you had forked v18 and v19 to vlcd5/6. (only two different files with kt-lcd3 OSF)
I have xh18 display and know that the behavior isn't the same as the vlcd5-6 displays, that is why I never had tried and stay with marcoq's build, that has smoothed out this behaviour. Marcoq build has a lot more different files than your build.
I am no developer so I didn't know how and what was done for solving that xh18 behaviour.
I am certainly interested in your build and will be satisfied too with editing config.h only.
If there is a template with default settings it looks to me that changing these settings is not the most difficult part as famichiki already stated here. The java gui is the most easiest method for that, but in the first place not necessary.
stancecoke wrote:
Dec 29 2019 5:50am
....
Of course you can find the link to the GNU licence in the readme of the Kunteng repo.....
I can imagine that some things can be overseen. I hope marcoq will see this too and will pick up development of the Java gui again.
As said, nobody has used or stolen his intelectual work, so everyone have respected what he has done.

Demion   10 mW

10 mW
Posts: 27
Joined: Jun 10 2018 3:42am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Demion » Dec 29 2019 6:54am

It is not only basically modifying single file ebike_app.c but actually just changing few functions.
1. add init_default_config() to set default configs that are not configurable with VLCD;
2. change uart_receive_package() & uart_send_package() to support VLCD protocol;
3. config.h just configuration defines.
My idea was using original OSF with little modifications as possible.
I havent followed forum much since end of summer. I myself still using VLCD6 with v0.19.0 fork.
I was planning to use SW102, but now thinking soldering small esp8266 to serial TX, RX and controlling from Android with Bluetooth (which will be optional) would be more interesting for me.
I think VLCD fork might be useful who still want to just use VLCD5/VLCD6/XH18 (or no display at all).

As I know, Marcoq, done more modifications such as motor tuning, implementing eMTB mode even before v0.20.0, changing behavior of walk assist and other.
I havent looked in all changes, although Marcoq VLCD protocol code was very useful to get started.
Although I think first one who actually documented VLCD protocol is hurzhurz.
https://github.com/hurzhurz/tsdz2/blob/ ... ication.md

Regarding XH18. Looking at Marcoq vM0.19.C only difference between XH18 and VLCD6 is Error Code numbers. What problems do you encounter?
I only have VLCD6, so can not test myself VLCD5 and XH18.

Porting to v0.20.0 should not be that difficult, I will look into it when I have more free time.

Java Configurator should be as easy as modifying text in config.h, setting path and calling compile_and_flash.bat.
I just have no much experience in Java and GUI designing.
If someone wants to help with that feel free to PM me. Or I will give it a try myself later. I guess we can use stancecoke OSEC Parameter Configurator as GUI template.

Update: btw with differences in error codes and battery levels, curious how original firmware detects display model? Probably some bit in packet, anyone figured that out?
Last edited by Demion on Dec 29 2019 7:11am, edited 1 time in total.

Elinx   100 W

100 W
Posts: 187
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 29 2019 7:10am

Demion wrote:
Dec 29 2019 6:54am
It is not only basically modifying single file ebike_app.c but actually just changing few functions.
.......
I think VLCD fork might be useful who still want to just use VLCD5/VLCD6/XH18 (or no display at all).
.....
Regarding XH18. Looking at Marcoq vM0.19.C only difference between XH18 and VLCD6 is Error Code numbers. What problems do you encounter?
I only have VLCD6, so can not test myself VLCD5 and XH18.

Porting to v0.20.0 should not be that difficult, I will look into it when I have more free time.

Java Configurator should be as easy as modifying text in config.h, setting path and calling compile_and_flash.bat.
.....
I refer indeed to the different error nrs., but I thought something more was also different as mbrusa did encountered with his mods to display the measured values. I don't know how he solved this with his last mod for the configurator.
Ofcourse is an "all in one" solution the most easy method and I thank marcoq for that what he had done, but for porting in the first place it is not especially needed.

User avatar
stancecoke   100 kW

100 kW
Posts: 1170
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 29 2019 8:50am

Elinx wrote:
Dec 29 2019 6:08am
As said, nobody has used or stolen his intelectual work
Sorry, the ones who should be angry are Xnyle, Casainho and me, as marcoq uses our "intellectual work" ignoring the rules of common open source developing...

@Demion: I'll write a short tutorial how to get started with Netbeans and the editing of the GUI! :D
regards
stancecoke

Elinx   100 W

100 W
Posts: 187
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 29 2019 9:00am

stancecoke wrote:
Dec 29 2019 8:50am
......
Sorry, the ones who could be angry are Xnyle, Casainho and me, as marcoq uses our "intellectual work" ignoring the rules of common open source developing........
Ofcourse you are right.
I was not talking about the use of your sources, but of marcoq's "tsdz2 OSF design " with java.
For what I know, nobody has used his "design" as a base as he did with yours.
I still don't understand how marcoq could overseen the open source commitment by using the source code.

thineight   100 W

100 W
Posts: 228
Joined: Oct 05 2018 3:53am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by thineight » Dec 29 2019 9:17am

I think we are all interested in the best development of TSDZ2 original displays with OSF, therefore I want to thank marcoq for the configurator and all the other programmers that made the porting possible.
I think the best way forward is to focus the work on the buba's v0.20, which is to date the most complete. We are here to help with our tests, impressions and suggestions.
Hope you guys keep working to bring this project even further.
Happy end of 2019!
MTB KTM Ultra 29" - City bike DAYTONA 28"

marcoq   1 W

1 W
Posts: 63
Joined: Dec 17 2018 3:55am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by marcoq » Dec 29 2019 9:24am

stancecoke wrote:
Dec 29 2019 8:50am
Elinx wrote:
Dec 29 2019 6:08am
As said, nobody has used or stolen his intelectual work
Sorry, the ones who should be angry are Xnyle, Casainho and me, as marcoq uses our "intellectual work" ignoring the rules of common open source developing...

@Demion: I'll write a short tutorial how to get started with Netbeans and the editing of the GUI! :D
regards
stancecoke
You're right Stancecoke ... the GUI that I created was born from your source code ... but this does not justify that you can take my work to decompile it ... edit it and publish it without asking me ... I would have been glad that I had involved myself because I believed in a cooperation between users ... acknowledged that the GUI is a GPL and not simply an Open Source I would have personally sent you my source code ... let me be clear I have always worked for the community !!!!

Elinx   100 W

100 W
Posts: 187
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 29 2019 9:45am

marcoq wrote:
Dec 29 2019 9:24am
........ let me be clear I have always worked for the community !!!!
Hello Marcoq, glad to see you here.
I can imagine you are upset about the publication without letting you know before this happens.
But on the other hand. You was the only one that worked on it.
Nobody of the community has used your configurator as "his/her" work, so IMHO everyone has respected your work and still do.
I hope you want to work further on your configurator for the community.

User avatar
stancecoke   100 kW

100 kW
Posts: 1170
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 29 2019 11:10am

marcoq wrote:
Dec 29 2019 9:24am
I would have been glad that I had involved myself because I believed in a cooperation between users ...
So, just make your Java code public, then everybody is happy. There is really no secret in it.

regards
stancecoke

marcoq   1 W

1 W
Posts: 63
Joined: Dec 17 2018 3:55am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by marcoq » Dec 29 2019 11:23am

stancecoke wrote:
Dec 29 2019 11:10am
marcoq wrote:
Dec 29 2019 9:24am
I would have been glad that I had involved myself because I believed in a cooperation between users ...
So, just make your Java code public, then everybody is happy. There is really no secret in it.

regards
stancecoke
Stancecoke ... I will be wrong ... but if you think you have acted correctly towards me ... then we have nothing more to say to each other.

regards
marcoq

User avatar
stancecoke   100 kW

100 kW
Posts: 1170
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 29 2019 11:46am

marcoq wrote:
Dec 29 2019 11:23am
but if you think you have acted correctly towards me
If I had kown, that you would react like you do actually, I would have asked you first. :)
I was really happy, that you brought my idea of the Java GUI to the TSDZ2 project, thank you for that. But I'm not happy, if someone uses my code and then doesn't publish his sources. That's not my understanding of open source development.
I hope you will contribute to the project in an open manner in the future.

regards
stancecoke

marcoq   1 W

1 W
Posts: 63
Joined: Dec 17 2018 3:55am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by marcoq » Dec 29 2019 12:51pm

stancecoke wrote:
Dec 29 2019 11:46am
marcoq wrote:
Dec 29 2019 11:23am
but if you think you have acted correctly towards me
If I had kown, that you would react like you do actually, I would have asked you first. :)
I was really happy, that you brought my idea of the Java GUI to the TSDZ2 project, thank you for that. But I'm not happy, if someone uses my code and then doesn't publish his sources. That's not my understanding of open source development.
I hope you will contribute to the project in an open manner in the future.

regards
stancecoke
There are many things to do in this project ... including the porting of the 0.20 version ... better if with the implementation of bluetooth (as mentioned by Demion) ... now I will rest for 2 weeks ... for a some time I have to disconnect the plug ... eventually we update in January.

Regards.
marcoq

Elinx   100 W

100 W
Posts: 187
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 29 2019 1:23pm

marcoq wrote:
Dec 29 2019 12:51pm
...........
There are many things to do in this project .... .... ... eventually we update in January.
..........
:bigthumb: Then it will be a happy new year
Last edited by Elinx on Dec 30 2019 6:58pm, edited 2 times in total.

Demion   10 mW

10 mW
Posts: 27
Joined: Jun 10 2018 3:42am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Demion » Dec 29 2019 1:56pm

stancecoke wrote:
Dec 29 2019 8:50am
@Demion: I'll write a short tutorial how to get started with Netbeans and the editing of the GUI! :D
I looked through OSEC.java code. It seems pretty simple to use. I edited few JLabel in Notepad++. It also compiles well without Netbeans using makeJar.bat.
I think adding your repository as git submodule to TSDZ2 fork just for JavaConfigurator tool not best idea.
I hope adding links in app to your repository stancecoke/BMSBattery_S_controllers_firmware and original OpenSource-EBike-firmware/TSDZ2-Smart-EBike will be sufficient.
Thanks all for great work.

User avatar
stancecoke   100 kW

100 kW
Posts: 1170
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Dec 29 2019 3:03pm

Demion wrote:
Dec 29 2019 1:56pm
I looked through OSEC.java code. It seems pretty simple to use.
:thumb:
Demion wrote:
Dec 29 2019 1:56pm
I hope adding links in app to your repository stancecoke/BMSBattery_S_controllers_firmware and original OpenSource-EBike-firmware/TSDZ2-Smart-EBike will be sufficient.
Yes of course, if you share your resulting java code :wink:

regards
stancecoke

famichiki   100 W

100 W
Posts: 130
Joined: Jul 12 2019 9:00am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by famichiki » Dec 29 2019 3:40pm

IMHO making a new configurator should be the lowest priority, and anyway the config.h file needs to be finalised first. Much of the angst around Marcoq's fork has been because of the inability for others to update the configurator and Marcoq not having time to make changes to it. Even if a new one was built for Demion's version and it was opensource, it's extra complexity that may hinder further development.

Simplicity is the beauty of Demion's versions and allow anyone to easily build on his work. If you look at his config.h file, it's nicely laid out and is very simple to understand and edit. It could probably be made even easier by minor work such as separate basic & advanced settings and adding further explanations.

I find it difficult to think that anyone who has got to the stage of being able to flash the OSF firmware would actually need a separate configurator and could not edit the config file directly.

A configurator was necessary to use Marcoq's version because there was no other way to edit the settings, there was no user editable config file that put all the settings into one place. All the defines were only inserted into the code at configurator run-time and then removed again immediately after. Even if a user wanted to hard code a setting they could not. And in fact I found the 2-step Compile then Program buttons to be a little annoying, over the simpler original Compile & Program batch file.

If a new configurator was to be built it should output a config.h in exactly the same beautiful format as Demion's user editable file. A configurator should be a bonus feature, not one that is essential. This gives users the choice of manually editing the file or automatically generating one, or even manually tweaking a previously automatically generated one.

That all said, I had a brief look at the possibility of making a simple configurator as a single html file that could be run locally in any browser using a form that outputs to a text file. It was trivial and I had a basic example working in a few minutes. Possibly this could be the way to go, make a quick-start configurator for new users with only essential settings like battery and options like lights, brakes etc. Then later if they want to change advanced settings they will be more familiar with the process and can edit the config.h file instead.

But probably the best thing that could be done initially is to ensure there is a concise Readme explaining how to edit the config file and compile & flash. Because information like this is spread all over and hard to find for a new user. The config.h file itself should be self explanatory as much as possible.

So please consider whether a configurator is really needed as we all only have limited resources and need to keep focused, plus keeping things simple will allow for quicker and easier updates in the future.

Elinx   100 W

100 W
Posts: 187
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Dec 29 2019 5:39pm

I like the idea of famichici.
I too was suprised by the simplicity Demion has ported v0.18 and v.019 to vlcd/no displays. Only missing part was support for xh18 display, but that shouldn't be a big problem.
Eventually a minimal gui/script for import config.h, compiling and flashing should be handy, but not needed in the first place.
Every development have their bugs. The more complex, the more bugs. But also less easy to find.

IMHO for the layout of config.h we could maybe be as close as the list of v.020 configurations for lcd3.
Configuration Menu TSDZ2 FW v020.pdf
(533 KiB) Downloaded 97 times

andrea_104kg   100 W

100 W
Posts: 181
Joined: Mar 05 2018 5:51pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by andrea_104kg » Dec 30 2019 6:58am

It's always easy after someone thought about it and made it first. For this reason it was not correct not to ask marcoq for anything.
Here in Italy there are now hundreds of those who use the marcoq system and are simple mountain bikers who know nothing about compilers, java, etc. This was the big advantage. If you do not think about this you risk that it remains a beautiful thing but only for IT technicians who go mountain biking. An ordinary cyclist doesn't even think about learning how a compiler works, nor does he start studying all the parameters. The web is full of many beautiful projects understandable only to a small group of people. This is what makes the difference. With the gui of marcoq a cyclist with minimal effort programs the engine, with other systems it doesn't. You have to decide who the project is intended for, then everything is possible. this is my opinion ..

Post Reply