danielnilsson9 / bbs-fw

Open source firmware for multiple electric bike motor controllers.
GNU General Public License v3.0
190 stars 38 forks source link

Req: Android config tool #73

Open rayholland opened 2 years ago

rayholland commented 2 years ago

Would love to see an android config tool.

Bluetooth communication would be possible with this cheap Ble Bluetooth to Uart Transceiver Module : https://www.go2tech.nl/winkel/componenten/at-09-bluetooth-4-0-ble-module-cc2540-cc2541/

addon: for now i'm going to try this method using above uart2ble module (have to test if this works):

  1. creating a virtual "Standard Serial over Bluetooth link" on my windows pc (see https://community.element14.com/technologies/internet-of-things/b/blog/posts/standard-serial-over-bluetooth-on-windows-10)
  2. starting the config tool on my pc and assigning the com port i assigned in step 1

Cheers, Ray

danielnilsson9 commented 2 years ago

Would be nice yes, I don't have time to work on an android app. But if anyone wants to do it I'm available for questions, protocol is not docummented but the messages can be found in extcom.c.

As for Bluetooth, you will probably have to power off or disconnect you Bluetooth module while display is connected or it will interfere with the controller -> display communication.

I solved that by connecting Bluetooth module on a UART proxy, code for the proxy is in src/logger but it is not really maintained atm. I only used the Bluetooth for viewing event logs on my phone while riding. An Arduino was used for the proxy implementation. The best implementation for a proxy like that would probably be to use an ESP32 which has both Bluetooth and 3 UARTS (which is needed) in the same chip.

Everything was powered of the 5V line from the controller which worked well, there seems to be enough current.

jvz1990 commented 1 year ago

Hi @danielnilsson9,

I'm kinda keen on this idea. I have a few cc25xx dev boards lying around. Or an ESP type device is more user friendly?

Q. Could you explain what the PL line is for and how it works?

Conceptionally the hw solution would involve a splitter between the BLE device and with a switch between the P+ lanes.

SW would indeed be time consuming to develop another firmware for the BLE device and Android app.

danielnilsson9 commented 1 year ago

@jvz1990

PL sends power to the controller. P+ is connected directly between battery and display. When display is powered on through a button it pulls a transistor which connects P+ to PL and then controller also powers on.

I had a private project like that before I wrote this firmware which replaced it. I didn't really have any use for the android app, only used it to unlock unrestricted limits. The controller was reconfigured in the same way as EggRider does it nowadays.

It used a ESP32, I will attach the drawings for my pcb to give you an idea what would probably be needed.

On the other hand, if you can accept that your controller is always on when battery switch is on you might get away with using 5V line from controller to power external microcontroller/bluetooth. Then everything is much simpler. But I'm not sure how much power the 5V line can deliver, the 6V light output is also an option though.

IMG_0427 board.pdf schematic.pdf

My own interest for doing something like this together with this firmware is low but I will help with implementation of necessary data export and new commands for the controller firmware if someone decides to work on this.

Damien0505 commented 11 months ago

Someone looks like they are already planning a new mobile app. Sounds good if/when it comes to fruition! https://github.com/S-CODE-pl/ChainBreaker