andrey-pr / OpenBafangTool

Open-source e-bike service tool for Bafang (even with CAN!) - tune your bike (BBS01, BBS02, BBSHD, M500, M600 or any other)
MIT License
59 stars 7 forks source link

Open Bafang Tool does not retrieve values #9

Open boopdadm opened 1 month ago

boopdadm commented 1 month ago

After selecting a serial port and connecting to it, the interface is loading for a while (~60s) image

But values are mostly empty or wrong image

If clicking on refresh, the firmware value appears: CRR2093624E010022.3

When switching to parameters tab, most values are set to 0, and upon refresh it quickly says image

any idea why ?

boopdadm commented 1 month ago

@andrey-pr when clicking several times on refresh, some values are retrieved on the info tab, the firmware version for example. The Read successful pop up appear in that case. With further refreshes, sometimes Read successfull appear, sometimes Error during reading appears.

With picocom, the output of picocom /dev/ttyUSB0 says Terminal ready, when typing in, a blue LED is blinking on the USB TTL converter.

I read a bit the documentation about the UART protocol and bafang APIs, to try to query the controller directly from the terminal, but I was unsuccessfull so far :(

I will try further to query the controller directly from a terminal, if you have a few command examples that would be great :)

andrey-pr commented 1 month ago

Try to connect to serial port with baudrate 1200 and send 0x11 0x52. Also, complete list of this commands avaliable in docs right inside program (tab "manual")

boopdadm commented 1 month ago

I tried to use picocom -b 1200 /dev/ttyUSB0, and once terminal is ready, typing 0x11 0x52 but nothing is happening. I see a blue LED blinking on the USB converter each time I am typing something (when I launch your program, I see two LEDs blinking, I assume one blinks when sending, the other when receiving).

I also tried with moserial, an utility with GUI to communicate over serial port, below the config and trials, unsuccessful as well 😞

Screenshot from 2024-07-10 19-41-58 Screenshot from 2024-07-10 19-42-21 Screenshot from 2024-07-10 19-43-04

I am a bit clueless... I will try to find people with UART and/or serial port communication experience, if you think of other things in the meantime, feel free ! :)

andrey-pr commented 1 month ago

I tried to use picocom -b 1200 /dev/ttyUSB0, and once terminal is ready, typing 0x11 0x52 but nothing is happening. I see a blue LED blinking on the USB converter each time I am typing something (when I launch your program, I see two LEDs blinking, I assume one blinks when sending, the other when receiving).

I also tried with moserial, an utility with GUI to communicate over serial port, below the config and trials, unsuccessful as well 😞

Screenshot from 2024-07-10 19-41-58 Screenshot from 2024-07-10 19-42-21 Screenshot from 2024-07-10 19-43-04

I am a bit clueless... I will try to find people with UART and/or serial port communication experience, if you think of other things in the meantime, feel free ! :)

You sent "01 10 52", but not "11 52"

boopdadm commented 1 month ago

Here is the result of the 11 52 command image

Given 0x11 0x52 read query, I have the feeling the response should be way longer 🤔

andrey-pr commented 1 month ago

Here is the result of the 11 52 command image

Given 0x11 0x52 read query, I have the feeling the response should be way longer 🤔

Looks like response is correct, I will think what to do with your problem

boopdadm commented 1 week ago

hello @andrey-pr, by chance, did you have any thoughts about my issue ?

andrey-pr commented 4 days ago

Sorry, currently I have no time