Page 1 of 6

BT Interface for TSDZ2 Open Source firmware - Work in progress

Posted: Nov 17 2019 8:36am
by mspider65
Simulation test done successful.

https://youtu.be/vp3WN9OPtdk

Now i'm waiting a new spare controller to start the field test.

When done, using an Android you will be able to:
  • Monitor all the parameter sent by the controller.
  • Setup all the motor parameters.
  • Wireless update the module firmware
  • Wireless update the Controller Firmware
And much more in future...

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

Posted: Nov 17 2019 9:01am
by john61ct
The list is invisible here
mspider65 wrote: When done, using an Android you will be able to:

- Monitor all the parameter sent by the controller

- Setup all the motor parameters

- Wireless update the module firmware

- Wireless update the Controller Firmware

And much more in future...

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

Posted: Nov 17 2019 10:20am
by stancecoke
Great! Cool work! :thumb:

This stops the messing around with just three buttons of a display to adjust all the parameters!
Are you using BLE or "normal" BT for communication? Why don't you use a simple HC-05/06 or HM-10 BT-module?

regards
stancecoke

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

Posted: Nov 17 2019 11:02am
by mspider65
stancecoke wrote:
Nov 17 2019 10:20am
Great! Cool work! :thumb:

This stops the messing around with just three buttons of a display to adjust all the parameters!
Are you using BLE or "normal" BT for communication? Why don't you use a simple HC-05/06 or HM-10 BT-module?

regards
stancecoke
Hi, the interface is based on BLE.
HC-05/06 are just repeaters. ESP32 instead is a poweful MCU. WIth HC-0X it would not possible implements OTA FW update, protocol conversion between Controller and Display and the DS18B20 temperature sensor.
In future it would be possible add much more features.

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

Posted: Nov 18 2019 5:59am
by stancecoke
mspider65 wrote:
Nov 17 2019 11:02am
protocol conversion
So you don't use casinhos data protocol to commuicate with the app?! Why?

regards
stancecoke

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

Posted: Nov 18 2019 6:34am
by mspider65
stancecoke wrote:
Nov 18 2019 5:59am
mspider65 wrote:
Nov 17 2019 11:02am
protocol conversion
So you don't use casinhos data protocol to commuicate with the app?! Why?

regards
stancecoke
On the controller side you should use the Official Open Source Firmware (casinhos data protocol) and actually the ESP32 translates the messages to the OEM LCD Protocol (I have the VLCD5 display).
But there are no restrictions and you can easily change the ESP32 firmware to talk to any other LCD. As long as his protocol is known.
Maybe in the future i will add other LCD protocols an made the type of LCD selectable from the Android app

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

Posted: Nov 18 2019 8:02am
by stancecoke
OK, I see. For the VLCD5 you can use Marcoqs adaption also. But for BT-connection, you need something additional, of course.

In the Kunteng-project, Xnyle uses the modbus protocol for the communication with the mobile app.

https://github.com/stancecoke/BMSBatter ... Odisplay.c

Will you publish your work as open source?

regards
stancecoke

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

Posted: Nov 18 2019 9:06am
by mspider65
stancecoke wrote:
Nov 18 2019 8:02am

Will you publish your work as open source?
Yes

https://github.com/TSDZ-ESP32

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

Posted: Nov 19 2019 9:55pm
by casainho
mspider65 wrote:
Nov 17 2019 8:36am
Simulation test done successful.

https://youtu.be/vp3WN9OPtdk

Now i'm waiting a new spare controller to start the field test.

When done, using an Android you will be able to:
  • Monitor all the parameter sent by the controller.
  • Setup all the motor parameters.
  • Wireless update the module firmware
  • Wireless update the Controller Firmware
And much more in future...
Nice, as also because it is OpenSource.

The main project is going with SW102 display that has Bluetooth and will need an app like this.

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

Posted: Nov 25 2019 5:27pm
by mspider65
Finally the controller is arrived!

Image

All the tests went well and, after some minor adjustments, also the firmware update of the STM8 controller from the Android app works perfectly.
I would say that at the moment I did not encounter any problems and I am confident that, once mounted on the bike, everything will work properly.

As soon as the cables/connectors arrive, and I have some time, I will start to assemble everything on the bike and i will do the first test-ride!

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

Posted: Nov 26 2019 5:00am
by stancecoke
Really cool! :-)

Do you have to change some optionbyte settings, or will the UART bootloader work from the default settings of the stock firmware for flashing?

regards
stancecoke

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

Posted: Nov 26 2019 5:39am
by mspider65
stancecoke wrote:
Nov 26 2019 5:00am
Really cool! :-)

Do you have to change some optionbyte settings, or will the UART bootloader work from the default settings of the stock firmware for flashing?

regards
stancecoke
I had to enable the STM8 bootloader using the usual "ST Visual Programmer" by changing the corresponding option byte because the bootloader is factory disabled.
But you only have to do it once, and then, you are free to OTA update from the Android app.
Care must be taken that, in normal operation, no data is sent to the controller UART during the first second after power-on, otherwise it enters in bootloader mode. But the ESP32 module also takes care of this.

This is the reference bootloader code i ported to ESP32. Big thanks to Georg Icking-Konert (alias gicking)
https://github.com/gicking/stm8gal

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

Posted: Nov 28 2019 3:51am
by stancecoke
Do you plan to write a tutorial how to use your ESP32 and app? e.g. in the wiki page of your github repo?
https://github.com/TSDZ-ESP32/ESP32_TSDZ2/wiki

regards
stancecoke

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

Posted: Nov 28 2019 12:41pm
by mspider65
stancecoke wrote:
Nov 28 2019 3:51am
Do you plan to write a tutorial how to use your ESP32 and app? e.g. in the wiki page of your github repo?
https://github.com/TSDZ-ESP32/ESP32_TSDZ2/wiki

regards
stancecoke
Yes, as soon as everything is tested and i have time i will start to add a wiki.

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

Posted: Mar 03 2020 9:51am
by mspider65
Since the tests went well I decided to move on to phase 2 of the project which provides for a better integration of all the electronics inside the motor.

Finally, despite the delays for COVID-19, the PCBs arrived from China.

The small PCB board will be placed over the controller inside the motor.

As soon as I have time I move on to assembly and the final test.
I hope I have not made mistakes in the design of the board

Project homepage (WIP):
https://github.com/TSDZ2-ESP32

Image

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

Posted: Mar 04 2020 3:40am
by casainho
mspider65 wrote:
Mar 03 2020 9:51am
Since the tests went well I decided to move on to phase 2 of the project which provides for a better integration of all the electronics inside the motor.
Nice to see!!

I put a link to this project on my project wiki page: https://github.com/OpenSource-EBike-fir ... d-projects

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

Posted: Apr 21 2020 5:50pm
by mspider65
A small update on the project.
The test of the first version of the PCB Board went quite well.
Some small problems have emerged in the design of the PCB board that I have already corrected and I have just ordered the new version with the necessary modifications.

The board also is open source and it will be possible for everyone to order the board assembled directly from a PCB manufaturer.
I'm using PCBWay at he moment and the ordering process is much simpler than you might think. (I will add also this on the wiki)
The first 3 samples cost me 90$ but obviously the cost decrease if you order more boards. I have ordered 10 boards for the new version and, if after the test someone is interested, i could sell some of them for the cost i have paid.

In any case, even with the current version I was able to continue with the tests of the SW part.
At the moment all functions are working correctly but i will need some more ride tests (the current lokdown in Italy does not allow me to use the bike)
At the moment all the following functions are implemented and working correctly on the Android App:
- Monitor of all the controller operating parameters (update frequency configurable from 1s to 1/5sec. Speed, cadence, battery volt/current, power, torque, motor temperature, pcb temperature, motor ERPS, ecc...)
- Configuration of all the controller FW parameters.
- ESP32 firmware OTA update
- STM8S Controller firmware OTA Update
- Controller data History Log (All data sent by the coontroller is stored with a sample rate of 1sec. Log data retention is 7 days )
- History log data Charts visualization (up to 3 series on the same chart, with pan, zoom, scroll)

As soon i have spare time i will start to update the wiki.

The home page of the projet is:
https://github.com/TSDZ2-ESP32

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

Posted: Apr 25 2020 6:56am
by gomyles
mspider65 wrote:
Apr 21 2020 5:50pm
A small update on the project.
The test of the first version of the PCB Board went quite well.
Some small problems have emerged in the design of the PCB board that I have already corrected and I have just ordered the new version with the necessary modifications.

The board also is open source and it will be possible for everyone to order the board assembled directly from a PCB manufaturer.
I'm using PCBWay at he moment and the ordering process is much simpler than you might think. (I will add also this on the wiki)
The first 3 samples cost me 90$ but obviously the cost decrease if you order more boards. I have ordered 10 boards for the new version and, if after the test someone is interested, i could sell some of them for the cost i have paid.

In any case, even with the current version I was able to continue with the tests of the SW part.
At the moment all functions are working correctly but i will need some more ride tests (the current lokdown in Italy does not allow me to use the bike)
At the moment all the following functions are implemented and working correctly on the Android App:
- Monitor of all the controller operating parameters (update frequency configurable from 1s to 1/5sec. Speed, cadence, battery volt/current, power, torque, motor temperature, pcb temperature, motor ERPS, ecc...)
- Configuration of all the controller FW parameters.
- ESP32 firmware OTA update
- STM8S Controller firmware OTA Update
- Controller data History Log (All data sent by the coontroller is stored with a sample rate of 1sec. Log data retention is 7 days )
- History log data Charts visualization (up to 3 series on the same chart, with pan, zoom, scroll)

As soon i have spare time i will start to update the wiki.

The home page of the projet is:
https://github.com/TSDZ2-ESP32

Well I'm very excited. I would buy a board off of you once you don't need it anymore.

Just to clarify, would this enable the throttle to be used while simultaneously using the temperature sensor on the motor and being able to operate at safe temperatures?

Thank you for your contributions! This looks very exciting.

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

Posted: May 08 2020 2:09am
by mspider65
gomyles wrote:
Apr 25 2020 6:56am
Well I'm very excited. I would buy a board off of you once you don't need it anymore.

Just to clarify, would this enable the throttle to be used while simultaneously using the temperature sensor on the motor and being able to operate at safe temperatures?

Thank you for your contributions! This looks very exciting.
Yes with the new board it will be possible to have both the throttle and the motor temperature control. The ESP32 fw will send to the controller new max current value based on motor themperature value.

The final (i hope) board is arriving from PCBWay. As soon it arrives i will do a final test and update the wiki.

In the meantime i have also added to the board FW the BT 4.0 Cycling Power profile and now you can connect the bike to an app like Oruxmaps.

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

Posted: May 08 2020 2:15am
by casainho
I have the firmware on SW102 sending and receiving data over Bluetooth UART, Would be nice if at sometime we could make SW102 work with your app - would you be interested to have this on your mobile app?

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

Posted: May 08 2020 7:13am
by mspider65
casainho wrote:
May 08 2020 2:15am
I have the firmware on SW102 sending and receiving data over Bluetooth UART, Would be nice if at sometime we could make SW102 work with your app - would you be interested to have this on your mobile app?
Hi Casainho ,
I have no plans to buy the SW102, my eyes like the big characters of the VLCD5 :( .
I'm working now to make the current version stable. It is based on the v20 controller firmware with some small improvements like slower ADC conversion speed (like i suggested to you some days ago), UART TX interrupt based and some other small things.
Then i have in plan to switch to your current Firmware implementation as soon it becomes final.

Massimo

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

Posted: May 08 2020 7:24am
by mspider65
gomyles wrote:
Apr 25 2020 6:56am
Well I'm very excited. I would buy a board off of you once you don't need it anymore.
Yes i will receive few extra cards (the cost difference between 10 board was only 20% more than 5 and i'we ordered 10 boards) , and I gladly give them at the cost I paid.
But I would like to clarify that I am not going to sell the boards directly or to create a business about it.
It's just a hobby for me.
In any case, ordering the boards directly on a site like PCBWay is much easier than you might think.
It is sufficient to fill in some fields, upload 3 files that are present on the Github repository and pay with PayPal. Once this is done, you will receive the boards already assembled and ready for use.
I will add also a guide on this on the Wiki.

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

Posted: May 09 2020 7:10am
by gomyles
mspider65 wrote:
May 08 2020 7:24am
gomyles wrote:
Apr 25 2020 6:56am
Well I'm very excited. I would buy a board off of you once you don't need it anymore.
Yes i will receive few extra cards (the cost difference between 10 board was only 20% more than 5 and i'we ordered 10 boards) , and I gladly give them at the cost I paid.
But I would like to clarify that I am not going to sell the boards directly or to create a business about it.
It's just a hobby for me.
In any case, ordering the boards directly on a site like PCBWay is much easier than you might think.
It is sufficient to fill in some fields, upload 3 files that are present on the Github repository and pay with PayPal. Once this is done, you will receive the boards already assembled and ready for use.
I will add also a guide on this on the Wiki.

Glad to hear it's that easy. That's awesome. Thank you again! Looking forward to the project and its development :D

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

Posted: May 13 2020 10:06am
by mspider65

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

Posted: May 18 2020 11:58am
by gomyles
Can you sell me a board?