Native SF Cowboy Bike Application to lock/unlock bike

Maybe this can help someone get started:

Lots of BLE/GATT magic numbers in that code, and it has something about speed limits at lines 208 and 228

Also, this Android app is open source:

and has command codes here:

10 Likes

That’s probably all I would need

@explit Mind joining my telegram group? conversing on forum is not too fast

5 Likes

@nephros Thank you very much for finding the right lines of source code!
@Mister_Magister Sure, thank you!

1 Like

Ladies and Gentleman! my Friends, we have a working app now.
https://github.com/Michal-Szczepaniak/decibici

Its a great small app with the funny name

“decibici”

decibici can switch the bike on/off. Tested on Cowboy 2 bike.
All credits go to @Mister_Magister who wrote this app in 2 6 hours. After just 4 iterations, the app worked like it should. My Cowboy 2 bike could be switched on and off.

For me it is not only one handy SailfishOS app, its also an Open Source Replacement for the closed original Android Application, which never worked in Android App Support, because of the direct Bluetooth connection. Its an SailfishOS App which might be the base for further eBikes or another BTLE connected devices. And this make me very happy.

It makes me very happy, that after i got so much shitstorm only for a simple Question / Idea, there were still some good and talented people around, like @nephros - who found the right lines of code in the Android app, and of course @Mister_Magister who decided to step-in and to write this app.

This shows again, how the community should work, when we work #together and not against each other.

I am very thankful to you guys, who made this happen.

And to my fellow haters who trolled me and made fun of my posting, who wrote, that “nobody will make an app for you and your dumb bike” - look here, someone did it. And he did it not only for me. Not for fame, not for money…He did it for the Sailfish Community…

Thank you once again, Michal…

Edit1 - Who want to try the ready compiled RPM - ping @Mister_Magister
I hope he will put on Storeman later.

Edit2 - Short Video how the app works

31 Likes

It will land in storeman once my man gregguh makes icon for it

also i’ll add thanks to @piggz for qble and helping me with qble

*cough* that’s generous (it took like 6)

15 Likes

Users always see only the top of the iceberg :grin:
Sorry, man…

3 Likes

Lovely, lovely!

+1 @piggz is awesome, and so are his creations (like qble and many more)

10 Likes

It is amazing see community doing so great work! Shout out to @Mister_Magister for being so valuable member of the community and providing multiple native apps to the Sailfish :100:

7 Likes

Interesting stuff. I will certainly have a look at this app when it lands in openrepos. I wonder if I can adapt it for my Specialized ebike. Nice work guys!

1 Like

Thats also my hope. I think, all the BLE bikes work more or less the same way (of course with some special magic, but basic functionality like ON/OFF should be IMHO similar)

1 Like

If you got service uuid
and you got characteristic uuid
and you know what to write to it (in this case it was literally 0 or 1)

thats all you need. Worst case scenario you can just list them and try one by one lol. It’s very basic but expanding it to support entire functionality is also… well… very basic (which I said multiple times I’m not gonna do, because musikilo awaits me, but its so easy someone else can do it)

4 Likes

I made notes many months ago while playing with bluetoothctl and discovering info on my ebike battery.
I’m reaquainting myself with bluetoothctl as i write this. I got connected to my bike battery and have device info/uuid’s/etc as screenshot.
I may ask for pointers, but I’m not asking or expecting you/others to do it for me. I know how to make apps, so I’ll take cues from your cowboybike app when it lands in openrepos. I also note your github for the said app.
I don’t need an app for my bike in reality, but quite enjoy the process of making an app that works, even if it does only turn something on and off.

4 Likes

Just join my group and spam as much as you want lol

1 Like

I now have 6 service codes and multiple characteristics codes.
I have got as far as connecting to the bike by bastardising parts of decibici app, but not able to complete pairing (as expected), some weird Specialized Sourcery foo there.
My bike has a row of numbers stamped onto the bottom of the frame, I’m to understand that the first 6 digits are the bluetooth pin?. There is no prompt when using bluetoothctl to add a pin, pairing is refused as a result. Maybe it can pair via a script?, need to play.
I wonder if I can still interact with the bt features of the bike without being paired?
Thanks for the decibici (so whip?) app, its a great insight for me having not really played with any of it in qml. Nice!!

2 Likes

@Edz Could you pair your bike and your SF phone under Settings → Bluetooth? Like any other BT device? Pairing code for my Cowboy bike is always constant (6 digits) and shown in the original ios/android app. The trick is to delete the bike from the ios/android phone, try to pair → You will be shown the pairing code.
Now . you know the pairing code and could pair it with the SailfishOS device. All further communication will work only after the device is paired. (that is the case on my bike), but it can be that Specialized works another way…

decibici
deci = 10^-1
bici = bike in italian/spanish

2 Likes

No, direct connection with sfos bluetooth has never been possible. Connection/Pairing is done via Specialized app called Mission Control, what a pile of unreliable shit that is!, the newest version doesnt detect my bike at all, Specialized couldnt give a toss, zero support, zero fucks given!, typical corporatio n!

2 Likes

well, with Cowboy its pretty the same shit. But somehow pairing is working. its needed only to be debugged. I would try to setup wireless adb connection from the notebook to the android phone and than check the adb log to try to find out what happens during pairing. @Mister_Magister please correct me, when i am wrong, somehow we need to understand what happens in the background to be able to rebuild the same process via Sailfishos app.

@Edz communicating with BTLE device without pairing is possible. Please check the VoltFish App (i have a fork on OpenRepos). VoltFish is Sailfish App for the Mooshimeter BTLE Multimeter. Sailfish connects to this Multimeter via BT address without pairing.

1 Like

Sometimes pairing manually via bluetoothctl works better than through the UI.

2 Likes

Tried that, but I’m not prompted to enter a pin.
Im in touch with Specialized, as I cannot connect using their app, which also now says “pin missing” when attempting to pair.

1 Like