BT Interface for TSDZ2 Open Source firmware - Work in progress

Electric Motors and Controllers
casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Sep 30 2020 1:28pm

mspider65 wrote:
Sep 27 2020 12:54pm
It will be also fine if the Android app could be used for your project.
You app is Android only? I am an Android user and I understand it is much more expensive to develop IOS. Did you though on IOS when you started this project??

I think I will need soon to use the app, I will need an app to show me the available devices for pairing on the wireless board, because I want to pair a Bluetooth remote to the wireless board... There are no buttons not display on the wireless board so I think the app is the only possibility to show a list and user choose from the list of available devices to pair.

By the way, would not be interesting for you to use a wireless remote, that also include the connection to the brake sensors?
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

mspider65   10 W

10 W
Posts: 70
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Oct 01 2020 9:08am

casainho wrote:
Sep 30 2020 1:28pm
You app is Android only? I am an Android user and I understand it is much more expensive to develop IOS. Did you though on IOS when you started this project??
No, i didn't. I don't have any knowledge about IOS.
I think I will need soon to use the app, I will need an app to show me the available devices for pairing on the wireless board, because I want to pair a Bluetooth remote to the wireless board... There are no buttons not display on the wireless board so I think the app is the only possibility to show a list and user choose from the list of available devices to pair.

By the way, would not be interesting for you to use a wireless remote, that also include the connection to the brake sensors?
This is a completely different scenario from the current one where the pairing is done between the Android Phone and the ESP32 board.
In the current setup i don't think a wireless remote would be useful since the Display cannot be removed. To remove the display the ESP32 firmware need to be changed and also some external hardware would be needed in order to be able at least to switch on/off the system.

casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Oct 01 2020 9:26am

mspider65 wrote:
Oct 01 2020 9:08am
This is a completely different scenario from the current one where the pairing is done between the Android Phone and the ESP32 board.
I see. The only difference with the board I am using is that my board supports also ANT. I guess you could, if you wanted, to connect Bluetooth devices to your board, like the remote.
mspider65 wrote:
Oct 01 2020 9:08am
In the current setup i don't think a wireless remote would be useful since the Display cannot be removed. To remove the display the ESP32 firmware need to be changed and also some external hardware would be needed in order to be able at least to switch on/off the system.
On my board and firmware, I already have the switch on/off the system working and controlled on the wireless display. My board firmware, I see it as a virtual display. If someday you want to try the on/off switch wireless in your board, go and grab the one we did and tested.

I see, the big difference on this project is that does not try to use an external wireless display, that may be done only using ANT - all other things are common between the projects. On my project, the wireless display should be optional and I think both project could just be really one.

So, the wireless display is optional and advanced users may want it because, it is a bit hard to describe but I will share some pictures and notes from my recent real experience - sorry for spam your thread:

Comparing a Specialized EBike with TSDZ2 EBike

Image

On last days, me and my wife, we were far from home, on holidays. We had planned two full days riding our ebikes with TSDZ2. On first day my ebike TSDZ2 did fail and I had to rent an ebike and I had the luck to be able to have a nice Specialized EBike that I was happy to compare with TSDZ2 EBike.

Experiencing EBike wireless standard with the Specialized EBike

While I was riding I realized that this Specialized EBike is turned on in the battery and not on the display, like if the display is not really needed and quickly I figured out this model could implement the EBike wireless standard. See that I am in the middle of developing the same EBike wireless standard for TSDZ2.

I had my Garmin GPS unit on the handle bard already because I had our route planned and we were following it. I just had to go to wireless sensors configuration and click on discover new sensors and I got this ones from the Specialized EBike:

Image

Note that the heart rate sensor is the one from my watch:
Image

Then automatically the following main screens were added:

Image

EBike main screen to control assist level, see battery status and light status:
Image

At the end of our ride, on the Garmin app, we can see graphs of fitness and cycling metrics but also the pedal human power, speed and cadence were recorded:
Image

Image

And interesting is that there is a map showing the route but with color gradients that we can select for some variables and the pedal human power was available:

Image

Image
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Oct 08 2020 5:14am

I got the very first firmware working for the wireless board and now I need an Android app... seems your is the best and I will simple fork your code -- many thanks for your work!! I could not develop such an app, structure it, etc but I fully understand your app and I can now develop it for my needs, thanks!!

I think we are looking for different approaches and so I do not expect to fork your code and make any pull request as it should not go ok with your objectives.

I want to go fully wireless, using standards:
- wireless display
- wireless remote
- wireless brake sensors

Where the system can still work without any of this. A mobile phone or a watch, are optional to the display or the remote, to change the assist level. But if user keep always the same assist level, then, nothing is needed, only the wireless board and the TSDZ2 motor.


I did a minimalist very first version that only changes the assist level - on the wireless firmware I setup the default settings for my ebike, like the wheel size, assist level factors, etc. Once I turn on the system, it is ready to work and I just need to change the assist level on the GPS display, using the touch screen or the wireless remote.

Here a picture of the wireless board connected to the TSDZ2 LCD connector:

Image
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

shaddi   100 mW

100 mW
Posts: 47
Joined: May 30 2018 3:20pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by shaddi » Oct 08 2020 9:48am

sorry, don't want to be offensive, but please can you stop cross-posting? You always complain about guys posting off-topic into your thread but you cross-post every achievement in ALL tsdz2 related threads...

casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Oct 08 2020 9:52am

shaddi wrote:
Oct 08 2020 9:48am
sorry, don't want to be offensive, but please can you stop cross-posting? You always complain about guys posting off-topic into your thread but you cross-post every achievement in ALL tsdz2 related threads...
Yes I will. I would like to give some context. And I wish this could be only one project but now I guess it is not possible because of different objectives, but I hope to learn and reuse max possible from this project.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

mspider65   10 W

10 W
Posts: 70
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Nov 03 2020 9:45am

New Release:
Small update for only ESP32 board firmware and Android App.

As usual all the files could be downloaded from https://github.com/TSDZ2-ESP32/TSDZ2-ES ... master/bin
https://github.com/TSDZ2-ESP32/TSDZ2-ES ... v2.1.5.apk
https://github.com/TSDZ2-ESP32/TSDZ2-ES ... v1.1.3.zip


The only new feature, is the possibility to change the Riding Mode from the Android App (long press the riding mode icon)

casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Nov 11 2020 9:38am

@mspider65, many thanks for this Android app -- I just go it working for my configurations, that was my priority because as soon I have all of them implemented, I will be able to finally install the wireless board on my TSDZ2 and remove the big 860C display :-)

- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

mspider65   10 W

10 W
Posts: 70
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Nov 21 2020 3:53am

casainho wrote:
Nov 11 2020 9:38am
@mspider65, many thanks for this Android app -- I just go it working for my configurations, that was my priority because as soon I have all of them implemented, I will be able to finally install the wireless board on my TSDZ2 and remove the big 860C display :-)
Hi Casainho, glad to see that some parts of my Android app are useful for your project.
I saw that your project is going well.
Last edited by mspider65 on Nov 21 2020 3:36pm, edited 1 time in total.

casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Nov 21 2020 4:06am

mspider65 wrote:
Nov 21 2020 3:53am
casainho wrote:
Nov 11 2020 9:38am
@mspider65, many thanks for this Android app -- I just go it working for my configurations, that was my priority because as soon I have all of them implemented, I will be able to finally install the wireless board on my TSDZ2 and remove the big 860C display :-)
Hy Casainho, glad to see that some parts of my Android app are useful for your project.
I saw that your project is going well.
If you are following the thread, you can see that are intentions to try defined a standard for mobile app so the various OpenSource firmwares, even for other motor controllers as KT and Lishui, will work with the same app. Maybe this can also be good in future for your project if that mobile app gets more developed than yours.

And theoricaly there is a big plus that is the same app working on IPhone but still seems none of the developers have experience with Iphone...
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

Wimpy747   1 mW

1 mW
Posts: 14
Joined: Apr 25 2020 12:02pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Wimpy747 » Nov 30 2020 8:30am

Anyone in europe who still has a finished board in stock?

casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Dec 07 2020 4:02pm

Hi.

I have a release of mobile app based on yours, MANY THANKS!!!!!

I implemented some new things that you may like and if so, just go and reuse the code in your app:
- variable customization: long press on each field to open a list and choose a variable (the configuration is saved in persistent memory)
- removed fab button and added action to options menu as also click on the Bluetooth icon on top left
- full screen
- added About page, where I link to project page as also I refer and link to your app as I reused you app

Note that I disabled graphs and the Debug fragment, because I need a quick app for now.

If you want you can download to test: https://github.com/OpenSourceEBike/TSDZ ... tag/v0.1.0

See that there is only one main screen but I added (this feature is not available on the ESP32 project) customization on the fields, a bit like on the 860C display:



Image

Image
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

Wimpy747   1 mW

1 mW
Posts: 14
Joined: Apr 25 2020 12:02pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Wimpy747 » Dec 10 2020 9:04am

casainho wrote:
Dec 07 2020 4:02pm
Hi.

I have a release of mobile app based on yours, MANY THANKS!!!!!

I implemented some new things that you may like and if so, just go and reuse the code in your app:
- variable customization: long press on each field to open a list and choose a variable (the configuration is saved in persistent memory)
- removed fab button and added action to options menu as also click on the Bluetooth icon on top left
- full screen
- added About page, where I link to project page as also I refer and link to your app as I reused you app

Note that I disabled graphs and the Debug fragment, because I need a quick app for now.

If you want you can download to test: https://github.com/OpenSourceEBike/TSDZ ... tag/v0.1.0

See that there is only one main screen but I added (this feature is not available on the ESP32 project) customization on the fields, a bit like on the 860C display:



Image

Image
Just for info:
I tried the app on a sw102, as this has the same nrf. It does connect but freezes after about 30 secs.
But is probably because I run the bart 0.20 beta 1 software.

fietstasss   1 µW

1 µW
Posts: 4
Joined: Dec 08 2020 1:41pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by fietstasss » Dec 11 2020 4:13am

Hi all, i'm about to order some of the (ESP32-based) PCB's needed for this project at PCBWay (https://github.com/TSDZ2-ESP32).
Is there anyone interested in some as well? The boards will be assembled and delivered in the Netherlands, shipping to EU is possible.
If wanted I could make a full set with all the required cables, antenna, connectors included. Also pre-flashed would be an option.

Let me know if there is any interest to this.

casainho   10 GW

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

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Dec 18 2020 2:32pm

This message is to show / give ideas to the ESP32-TSDZ2 users, that is possible to quick DIY and with very few components, a Bluetooth board for TSDZ2. Maybe this can be a help for the ones that can find difficult to get the PCB.

ESP32-TSDZ2 project went on the path to design a custom board, probably with more components that are needed, like the level shifters. I decided to go DIY and use the less possible components: a small board with the Bluetooth microcontroller (would need to be ESP32 board), a popular DC-DC board and no level shifters (as some displays do like the 860C and SW102). I think this can be a good alternative because all the items are easy to buy on Ebay or Aliexpress.

I put the wireless board under the DC-DC converter board. I used a perfboard to hold one board in one side and other on the other side and giving enough space to solder the only 2 extra components (mosfets).

DC-DC converter boar (60V battery -> 5V for the wireless board):
Image

Wireless board with all the needed wires soldered:
Image

The board is quite small, here the final cable to connect to TSDZ2 display connector:
Image

Finally I soldered the wires for STLinkV2 and connected to my PC, so I could flash the Bluetooth bootloader and finally the firmware using the bootloader:
Image

And finally testing by connecting the mobile app as also the Garmin GPS display.
As you can see, my Android app is based on the ESP32-TSDZ2 Android app, thanks!!
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, 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 to help my developments: paypal.me/jorgecasa

Pooyan   1 µW

1 µW
Posts: 1
Joined: May 20 2018 10:44am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Pooyan » Dec 20 2020 3:32pm

fietstasss wrote:
Dec 11 2020 4:13am
Hi all, i'm about to order some of the (ESP32-based) PCB's needed for this project at PCBWay
Let me know if there is any interest to this.
I'm interested in 1 PCB, i live in NL

Post Reply