[TSTIL] Cowboy e-Bike Remote Control

[ This is a part of "The Software That I Love", a series of posts about Software that I created or had a small part in ]

2022 - Cowboy e-Bike Remote Control

In early 2021 I was a bit down. It was winter, some team members had just quit and I needed to distract myself. Due to covid lockdowns and boredom I gained more weight and drank more. I needed exercise (yes I had a water rower but I was too lazy to use it. I had to cycle every day so a bicycle would be a good idea).

I started looking at e-bikes, because having experienced the rentals on a trip to Berlin I was sold. It makes cycling even more fun, and you end up taking the bike for most of your trips.

The two options were the VanMoof S3 and the Cowboy V3. The Cowboy won. Less quality issues, sleeker look & minimalistic approach. I love this bike. It brings a smile to my face whenever I step on it.

Sometimes the smile turned upside down because my phone would not connect to bluetooth though. Stephanie also uses the bike and her phone would be connected instead, or something else went wrong. It was just not super reliable. If things that are almost magical don't work reliably, it's very annoying for some reason. You know how great it can be, so why can't it be that great all the time? If you already read about InstaDeploy you can see that I'm guilty of this as well in my own creations.

Anyway, I learned about the "hacking" apps for the Cowboy bikes, and because some were open source, I saw they used bluetooth. I then started a 1 year quest to create a bluetooth-powered car key for my e-bike.

I had already dabbled a bit with ESP8266 and ESP32, but only using some simple wifi apps using Arduino IDE. Here I was out of my comfort zone.

It's a small-sized hardware solution, no prototyping boards allowed. I had never done that before. The key should work from a coin cell for 1+ year and optimized for ultra low power. Not done before. It also needed to work with Bluetooth, BLE, whatever. No experience whatsoever. Fun, let's go!

I quickly saw the the ESP32 would not work, it used too much power for a coin cell and was quite bulky. So, the nRF52 series might be an option.

I had to learn a lot. Ordered a nRF52-DK (Development Kit) and started creating some code for connecting to BLE devices. As the Nordics team is transitioning between two versions of their SDK, I was very confused most of the time. The documentation seemed to apply and then not apply to my situation at random.

Anyway, I persevered. I did it in evenings and weekends, and I believe it took me about 2 or 3 full time weeks of work. You can view the end result here: https://blog.waleson.com/2022/03/the-worlds-first-cowboy-key-fob.html

I'm still working on getting the version with the PCB to work. For some reason the power cuts out after an hour or two, even though there should be no current. Still debugging that one.

I'm currently using my prototype. It's beautiful on the outside but ugly inside. Every day I walk to my bike, press the button on my key and unlock it. Love it.




next: this is the end (for now)

Comments

Popular posts from this blog

"Security Is Our Top Priority" is BS

AI programming tools should be added to the Joel Test

The unreasonable effectiveness of i3, or: ten years of a boring desktop environment