TSDZ2 EBike wireless standard (like Specialized Turbo Levo) - OpenSource

I decided to embedded the board in translucent silicone, inside the case, so fully water prof. The LED light is ok and the button also as silicone is flexible:

image.png


beemac said:
Very nice and compact. Why did you expose the button though? I didn't think it did anything...
There not yet firmware developed for that button. The plan is to use the button to:
- change assist level: button press
- turn on/off TSDZ2 motor: button long press

This way, if the wireless remote fails and the user has no mobile phone, will always be able to ride as usual.

And that button is also needed to startup the bootloader for firmware update.
 
Caisinho wrote:
All the firmware builds ok on my computer and I see I have no extra files that are not on the repository, so, it should build ok for everyone.

Yeah, well it doesn't for me!!

If you read my messages you will see that there are plenty of issues!!! Or just one single one?, but clearly you don't want to help, so forget it.

:(

Gordon
 
gfmoore said:
Caisinho wrote:
All the firmware builds ok on my computer and I see I have no extra files that are not on the repository, so, it should build ok for everyone.

Yeah, well it doesn't for me!!

If you read my messages you will see that there are plenty of issues!!! Or just one single one?, but clearly you don't want to help, so forget it.

:(

Gordon
So, one problem at a time. Tell what is the very first error happens when you build the firmware on EBike_wireless_TSDZ2/firmware.
 
I did a good update to documentation about how to build the TSDZ2 Ebike wireless controller using the small DC-DC. I kept the instructions (on a different page) for the bigger DC-DC as it is cheaper, easier to buy and the case has more space for the ones that prefer not build in such tight volume that makes it harder to do
image.png
 
casainho said:
So, one problem at a time. Tell what is the very first error happens when you build the firmware on EBike_wireless_TSDZ2/firmware.

Okay let's try this. Just so there were no issues around windows and wsl2 etc I took a box running Lubuntu (Intel NUC core i3) and loaded the latest Ubuntu 20.04 distribution on it.

(I use x11vnc to remote into it and it took me 5 re-installs till I learnt that you can't auto run x11vnc on latest and greatest - oh man. I kept crashing the machine so it wouldn't boot. Not that that is of any concern, but you wondered what was happening and why I hadn't responded !)

So I followed the instructions in the development doc - https://github.com/OpenSourceEBike/TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md (and there's some stuff missing on installing git and the github extension - I've written it down and will update docs at a later stage.)

So I have a pure, clean linux machine with VS Code.

I cloned the github repository https://github.com/OpenSourceEBike/TSDZ2_wireless into a clean empty directory (ebike).

I then opened a workspace for ~/ebike/TSDZ2_wireless/EBike_wireless_TSDZ2/firmware.
There is a workspace.code-workspace file there which I select for opening the workspace.
(I also tried opening the folder, but you don't get the common_firmware directory!!)

So the first problem (as you asked) is as shown in image:

VSCode problem 1.png

Now this is basically the same as my original problem when using the wsl2 and windows tool chain.
I believe it is because it cannot find the nRF5_SDK?

Now whatever the solution is, I think that you as owner of the repository should clone the repository to some new location on your machine, fix the problem(s) and then re-upload.

The reason for this is because we could spend too much time going back and forth with you telling me what to do, whereas it will probably takes you much less time to do it yourself and then I can test your solution.

Does that seem reasonable? I hope so.

Thanks for your help. It really is appreciated and I'm in no rush.

I hope you have a small laptop (ready for fixing problems) to take to the hospital whilst you await the birth of your baby! :D
I understand these things can take some time...

Warm regards,

Gordon.
 
You need to run "make" on the terminal, on the folder where is the Makefile. Ignore Visual Code Studio for building the code.
 
casainho said:
You need to run "make" on the terminal, on the folder where is the Makefile. Ignore Visual Code Studio for building the code.

+1 for this - i've never got vs code to work as anything more than an editor. I can't get all the wiggly lines to disappear despite seemingly correct include paths and much trying. Things work ok enough for editing - but to build use make clean & make from the command line - or the included batch files.

the $SREC path you were asking about - I assume is for the tool srec_cat - needed to build binaries. I use windows - so found a win32 build - but if it's not mentioned in the docs - you need srec_cat and then make sure there is a path to that so the linker can find it.
 
beemac said:
casainho said:
You need to run "make" on the terminal, on the folder where is the Makefile. Ignore Visual Code Studio for building the code.

+1 for this - i've never got vs code to work as anything more than an editor.
Sure you can flash the firmware and debug using command line, but I do it in Visual Code Studio and makes the process much easier. I use the command line at begin when I want to make sure everything is working as expected, then I move to Visual Code Studio.
 
I updated the site documentation with new pictures of the final process of build and install the TSDZ2 EBike wireless controller on my ebike:

5 - Making water prof and install on EBike

I did fill be box with translucid silicone and inserted the board - my objective is to have a robust and water prof device:
TSDZ2_wireless_board_small-10.jpg


After 24 hours waiting for silicone to dry. I did fully cover the holes with the silicone and it works very well to see the LED light and also to be able to click on the button as the silicone is flexible:
TSDZ2_wireless_board_small-11.jpg


Checking to see if it still works:
TSDZ2_wireless_board_small-12.jpg


Final instalation on the frame of my EBike:
TSDZ2_wireless_board_small-13.jpg
 
gfmoore said:
casainho said:
So, one problem at a time. Tell what is the very first error happens when you build the firmware on EBike_wireless_TSDZ2/firmware.

Okay let's try this. Just so there were no issues around windows and wsl2 etc I took a box running Lubuntu (Intel NUC core i3) and loaded the latest Ubuntu 20.04 distribution on it.

(I use x11vnc to remote into it and it took me 5 re-installs till I learnt that you can't auto run x11vnc on latest and greatest - oh man. I kept crashing the machine so it wouldn't boot. Not that that is of any concern, but you wondered what was happening and why I hadn't responded !)

So I followed the instructions in the development doc - https://github.com/OpenSourceEBike/TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md (and there's some stuff missing on installing git and the github extension - I've written it down and will update docs at a later stage.)

So I have a pure, clean linux machine with VS Code.

I cloned the github repository https://github.com/OpenSourceEBike/TSDZ2_wireless into a clean empty directory (ebike).

I then opened a workspace for ~/ebike/TSDZ2_wireless/EBike_wireless_TSDZ2/firmware.
There is a workspace.code-workspace file there which I select for opening the workspace.
(I also tried opening the folder, but you don't get the common_firmware directory!!)

So the first problem (as you asked) is as shown in image:

VSCode problem 1.png

Now this is basically the same as my original problem when using the wsl2 and windows tool chain.
I believe it is because it cannot find the nRF5_SDK?

Now whatever the solution is, I think that you as owner of the repository should clone the repository to some new location on your machine, fix the problem(s) and then re-upload.

The reason for this is because we could spend too much time going back and forth with you telling me what to do, whereas it will probably takes you much less time to do it yourself and then I can test your solution.

Does that seem reasonable? I hope so.

Thanks for your help. It really is appreciated and I'm in no rush.

I hope you have a small laptop (ready for fixing problems) to take to the hospital whilst you await the birth of your baby! :D
I understand these things can take some time...

Warm regards,

Gordon.


Yeah, success, managed to get this to compile and build.

The first issue was that the c_cpp_properties.json file forced-include section wasn't looking in the correct place, it was missing the include subdir.
Code:
            "forcedInclude": [
                "${workspaceFolder}/include/sdk_config.h"
            ],

At the same time I changed the intellisenseMode from clang to gcc-arm - stops annoying messages :)
Code:
"intelliSenseMode": "gcc-arm"

I also had to sudo apt install make (or could you use sudo apt-get install build-essential ??)

That would allow a build, but then I had to install nrfutil (not so easy)
Python3 is already installed on minimal ubuntu 20.04 but...

Code:
sudo apt install python3-pip
pip3 install nrfutil

but this installs in your local bin directory ~/.local/bin so you need to add to the $PATH variable. To do this permanently for my user I changed the .bashrc file
Code:
sudo nano .bashrc

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

then
. .bashrc

Restart vscode ctrl + shift + p (developer: reload window or exit then restart)

Then the thing compiled built and nrfutil to create the zip.
 
Great!!

Can you improve now the documentation??

And to where did you put your last changes? I expected them to be on developers link at the end of project page https://opensourceebike.github.io/
 
@casainho - could you just edit your last post where you quote my ctrl + xxxx P please - I don't like swear words :)

@beemac
I can't get all the wiggly lines to disappear despite seemingly correct include paths and much trying.

Indeed and they've not gone away, either under Ubuntu or my windows wsl2 Ubuntu attempt.
main.c error.png

oh well, keep trudging on

@casainho I will update docs ... eventually when I get everything (Ubuntu and windows wsl ubuntu working completely.)

The file is linked to by the document that ranana? wrote on installing vs code is TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md
and my file is TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development_Windows10.md

Note the link from https: TSDZ2_wireless/blob/master/documentation/README.md is 404 not found. I think this should link to TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md
But your repo and I'm not sure what you might have intended?
 
I've noted that there are quite a lot of warnings in the compilation process (Let's deal with pure Ubuntu)

I don't like warnings and suspect they may be linked to the red wavy lines too?

Do you get this when you build?

warning and wavey.png
 
No, sorry, my joy was premature! :oops: I am still getting too many errors in my files and warnings, so my changing the forced include hasn't really helped.

So I'll revert back to original, i.e. clone the rep again and I'll screenshot the error - at least my toolchain is much improved.
 
gfmoore said:
@casainho I will update docs ... eventually when I get everything (Ubuntu and windows wsl ubuntu working completely.)

The file is linked to by the document that ranana? wrote on installing vs code is TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md
and my file is TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development_Windows10.md

Note the link from https: TSDZ2_wireless/blob/master/documentation/README.md is 404 not found. I think this should link to TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md
But your repo and I'm not sure what you might have intended?
I need to delete that documentation files on TSDZ2_wireless repo as all the documentation should now be on https://github.com/OpenSourceEBike/OpenSourceEBike.github.io / https://opensourceebike.github.io/

Please add your documentation improvements ONLY to https://opensourceebike.github.io/
 
gfmoore said:
@casainho I will update docs ... eventually when I get everything (Ubuntu and windows wsl ubuntu working completely.)

The file is linked to by the document that ranana? wrote on installing vs code is TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md
and my file is TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development_Windows10.md

Note the link from https: TSDZ2_wireless/blob/master/documentation/README.md is 404 not found. I think this should link to TSDZ2_wireless/blob/master/EBike_wireless_TSDZ2/documentation/development-flash_and_debug_firmware.md
But your repo and I'm not sure what you might have intended?
I need to delete that documentation files on TSDZ2_wireless repo as all the documentation should now be on https://github.com/OpenSourceEBike/OpenSourceEBike.github.io / https://opensourceebike.github.io/

Please add your documentation improvements ONLY to https://opensourceebike.github.io/

And yes, there are warnings while building the firmware, still, it builds correctly.
 
gfmoore said:
No, sorry, my joy was premature! :oops: I am still getting too many errors in my files and warnings, so my changing the forced include hasn't really helped.

So I'll revert back to original, i.e. clone the rep again and I'll screenshot the error - at least my toolchain is much improved.

So this is what I get when I open the cloned https://github.com/OpenSourceEBike/TSDZ2_wireless

original clone.png

Do you have this?

Gordon
 
Hello.
In my spare time, I finally managed to design an internal PCB
based on the TSDZ2 EBike Wireless Controller with some small additions :)
I added Relay for lights with a voltage higher than 5V
(you can choose whether it should be controlled from nRF or from the motor controller), solder pads
for the temperature sensor and Ufl connector for an external antenna.

Unfortunately, in order to connect it, I plan to slightly modify the nRF.
(https://devzone.nordicsemi.com/f/nordic-q-a/58983/nrf52840-dongle-matching-network-for-ext-antenna)

I am not only sure if the PCB dimensions will be perfect, unfortunately I am waiting
for a spare controller and I do not want to disassemble the engine :)

I hope people will like the project!
I am also waiting for constructive criticism, maybe someone will manage to notice some error for which I will be able to fix!

Link created in EasyEDA
link:
https://easyeda.com/woojak666/tsdz2-wireles-board_copy
Github:
https://github.com/woojak/TSDZ2-Internal-Wireles-Board

d578191964af04d6med.png


061baf7992c5fff2med.png


7f113ee466bc0085med.png


61608f84c9f4ba9bmed.png


Greetings!
 
gfmoore said:
gfmoore said:
No, sorry, my joy was premature! :oops: I am still getting too many errors in my files and warnings, so my changing the forced include hasn't really helped.

So I'll revert back to original, i.e. clone the rep again and I'll screenshot the error - at least my toolchain is much improved.

So this is what I get when I open the cloned https://github.com/OpenSourceEBike/TSDZ2_wireless

original clone.png

Do you have this?

Gordon
As I told before, just ignore the Visual Code Studio warning / errors, etc. If you want to correct them, that is ok, otherwise use the time to develop.
 
casainho said:
As I told before, just ignore the Visual Code Studio warning / errors, etc. ...

Uhmmm, not my style. Don't like errors, don't like warnings. It may take some time to fix them, but it's a good game. I've found in my life that they eventually come back to bite you and as this gets forked and adapted then others might get bitten too. But c'est la vie.

Nice work on the bike and new board though I don't know if it's correct, sorry.

I'll move on.
Gordon
 
woojak said:
Hello.
In my spare time, I finally managed to design an internal PCB
based on the TSDZ2 EBike Wireless Controller with some small additions :)
I added Relay for lights with a voltage higher than 5V
(you can choose whether it should be controlled from nRF or from the motor controller), solder pads
for the temperature sensor and Ufl connector for an external antenna.
I would like to keep current project as it is, not adding more choices to users but I think it is really great to have other development happening!! So, I would suggest for you to document your work on your repository and I would put a link to it, so users can know about it and decide.

About the temperature sensor, I think the the TSDZ2 motor controller V2 has extra pads for analog inputs, so users will be able to keep the throttle and the temperature sensor simultaneously.

Please share pictures of your build, I am really curious.
 
casainho said:
woojak said:
Hello.
In my spare time, I finally managed to design an internal PCB
based on the TSDZ2 EBike Wireless Controller with some small additions :)
I added Relay for lights with a voltage higher than 5V
(you can choose whether it should be controlled from nRF or from the motor controller), solder pads
for the temperature sensor and Ufl connector for an external antenna.
I would like to keep current project as it is, not adding more choices to users but I think it is really great to have other development happening!! So, I would suggest for you to document your work on your repository and I would put a link to it, so users can know about it and decide.

About the temperature sensor, I think the the TSDZ2 motor controller V2 has extra pads for analog inputs, so users will be able to keep the throttle and the temperature sensor simultaneously.

Please share pictures of your build, I am really curious.


I perfectly understand that you want to stay with the current idea.
Simplicity is beautiful!
Following your advice, I'm starting to create a repository on the git hub:]
I added the jumpers option because I was not sure if it would be added to the nRF software (I can't program :( ), so it is
always controlled by the internal controler :]
An additional temperature sensor will always be useful.
We can use it, for example, to measure the temperature of the controller.
Of course, without adding to the software it will only be an option :]

So far it's only a concept but I think it may be liked by more advanced users.
As soon as I polish the design and order the PCB, I will add photos from the assembly :]

So far I tried to make a DIY version of BT controller but one board does not respond to programming attempts (probably I broke it)
and the other one managed to program the bot loader, throw soft via the Nordic APP
but unfortunately after the nRF52840 reset I cannot find the BT device; /
So far I have ordered another 2 nRF52840, in the meantime I will try to upload the software to a working device.

Greetings!
 
woojak said:
casainho said:
woojak said:
Hello.
In my spare time, I finally managed to design an internal PCB
based on the TSDZ2 EBike Wireless Controller with some small additions :)
I added Relay for lights with a voltage higher than 5V
(you can choose whether it should be controlled from nRF or from the motor controller), solder pads
for the temperature sensor and Ufl connector for an external antenna.
I would like to keep current project as it is, not adding more choices to users but I think it is really great to have other development happening!! So, I would suggest for you to document your work on your repository and I would put a link to it, so users can know about it and decide.

About the temperature sensor, I think the the TSDZ2 motor controller V2 has extra pads for analog inputs, so users will be able to keep the throttle and the temperature sensor simultaneously.

Please share pictures of your build, I am really curious.


I perfectly understand that you want to stay with the current idea.
Simplicity is beautiful!
Following your advice, I'm starting to create a repository on the git hub:]
I added the jumpers option because I was not sure if it would be added to the nRF software (I can't program :( ), so it is
always controlled by the internal controler :]
An additional temperature sensor will always be useful.
We can use it, for example, to measure the temperature of the controller.
Of course, without adding to the software it will only be an option :]

So far it's only a concept but I think it may be liked by more advanced users.
As soon as I polish the design and order the PCB, I will add photos from the assembly :]

So far I tried to make a DIY version of BT controller but one board does not respond to programming attempts (probably I broke it)
and the other one managed to program the bot loader, throw soft via the Nordic APP
but unfortunately after the nRF52840 reset I cannot find the BT device; /
So far I have ordered another 2 nRF52840, in the meantime I will try to upload the software to a working device.

Greetings!
I usually solder the 4 wires from STLinkV2 to a new board and then I program the bootloader and then flash the firmware by wireless. All this with the 4 wires, since the STLInkV2 provides power to the board.
 
casainho said:
I usually solder the 4 wires from STLinkV2 to a new board and then I program the bootloader and then flash the firmware by wireless. All this with the 4 wires, since the STLInkV2 provides power to the board.

I also always solder to the pads when I connect STlink.
e880be7a66052402med.jpg

Unfortunately, I put the whole board together in the first place and only then I figured out that it would have to be programmed.

It programs the same way "I program the bootloader and then flash the firmware by wireless."
The whole process runs smoothly to the momet when trying to find the TSDZ2 BT device.
I probably use the wrong software or the wrong combination.
 
Sorry for off topic
Casainho, could I ask for the dimensions of the controller PCB?
I saw that in the topic "TSDZ2 48v 2020 new firmware" you had to do with a removed PCB from a metal housing :)
I would be grateful for the information.
Greetings!

Edit
Thxx
 
Back
Top