Page 1 of 1

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.