Jump to content

Pebble App and Data Logger for King Song [RELEASED]


JumpMaster

Recommended Posts

Hi,

Should be getting my KS16 in the next couple of weeks and I plan to make a companion app for the Pebble Smart Watch.

I have downloaded the Android app and successfully decompiled it so I can see what requests it sends and receives to the wheel.

As this requires an app for the phone it will only work with Android as I don't write software for Apple devices.

I plan on displaying speed and temperature on the watch. Are there any other fields important enough to be displayed? There isn't much space on the watch so it will properly only be possible to display 3 metrics at a reasonable size.

Looking forward to getting my wheel!

Kev

EDIT:

Now available in stores.

https://play.google.com/store/apps/details?id=com.cooper.wheellog

https://apps.getpebble.com/en_US/application/5793c91150c75291fa00026e

All releases for Android and Pebble

https://drive.google.com/drive/folders/0B_qIN0Xd80hCbGh6NWFVOFlKeTg?usp=sharing

Source Code

https://github.com/JumpMaster/WheelLogAndroid

Link to comment
Share on other sites

  • Replies 236
  • Created
  • Last Reply

Hi, will the app be only functional with the watch or  it will be like normal app that just adds support for the watch? If usable without watch could you add logging? (speed, battery, wattage, mileage)

Link to comment
Share on other sites

Yep that should be easy enough to implement.  The plan will be

  1. Make crappy Pebble PoC using decompiled code.
  2. Using Googles BLE Example as a template create a well made app and service for talking to the wheel. (auto-connects when the connections drops and runs in the background)
  3. Add logging support.

The time between steps 1 and 3 should be pretty short. Looks like my wheel is on track to arrive next week so hopefully this should happen before then end of the month.

Link to comment
Share on other sites

On 14. Juni 2016 at 10:25 AM, Michael David de Gans said:

I'd like the challenge of designing an app for the Apple Watch, but only if the forum actually have these..?

i mean that i would DIRECTLY buy a pebble if the appwould also work with my Iphone...

 

i think an IOS watch from apple you will hardly find any EUC users....

Link to comment
Share on other sites

The Pebble app is already open source although unfinished.  For example setting speed warning levels including vibrate levels are not configurable yet.  But everything that is there is finished.

https://github.com/JumpMaster/KingSongPebble

Speaking to the wheel seems to use standard Bluetooth LE commands.  The Android app actually seems to be built around Google's BluetoothLE Example application.  It still has lots of example code in it.  Excluding settings changes there are only 4 commands sent to the wheel before it keeps automatically sending updates, but I don't believe all are required.  Handling the response is also pretty easy.

For example, responses are always 20 bytes, mostly in blocks of two.  Voltage is byte 2 and 3. Speed is byte 4 and 5. Total mileage is longer so uses bytes 6, 7, 8, and 9. Current is 10, and 11. Lastly temperature is 12, and 13.  There are 4 types of response which I've called "live data" (although this included total mileage), "totals data" (current mile, current time, max speed, and strangely whether the fan is on or not), "wheel details" (model, name, version), and lastly serial number has a response of it's own.

Once I have my wheel I can test each command and document what they do which should make it fairly easy to make a companion app for Apple.

If you would like to start work on talking to the Pebble app there's a PBW file available below and the app UUID is 185c8ae9-7e72-451a-a1c7-8f1e81df9a3d
https://drive.google.com/file/d/0B_qIN0Xd80hCUFRBZnlOZHRLZDA/view?usp=sharing

Are there any changes to the wheel that would be useful to make from the watch?  I can see there are 3 modes called play, ride, and learn.  Is there any reason to change these on a regular basis?

Link to comment
Share on other sites

  • 2 weeks later...

Picked up my KS16 on Friday so here is the first beta. Only three buttons. Scan to find your KingSong. If you're using in Android M and up you'll need to allow the location request. For some reason it's required for Bluetooth LE. Then click connect. Lastly if you want to start the Pebble App click Start.

Both the apk and pbw file for Pebble can be downloaded from GitHub.

 

Let me know your thoughts.

https://github.com/JumpMaster/WheelLogAndroid/releases/tag/0.1

Link to comment
Share on other sites

@JumpMaster Awesome programming skills! Congrats!

Putting a dowpayment on a KS16 tomorrow at EWheel. Want something a bit faster than the NB1. Won't be available till end of August. Was hoping the NB Pro would become available in the US but Segway put the brakes on.

 How does the KS16 handle?

Link to comment
Share on other sites

LOL....is this my second wife speaking? Figure I have 2-3 months to Roomba my brain of the first conscience before my 2nd conscience or a little static hunka voice kicks in.?

Link to comment
Share on other sites

Hey we're Flamebot bros so I have to help relay messages from your conscience to you.  Just picture me as a little Elvis with a halo riding a Ninebot balanced on your right shoulder.

<Reeeeehaaaab1.... this is your conscience again.... was the first hole you duuuuuug not deeeeep enough.... this second hole is almooooooost to China where you can go pick up your wheeeeel in peeeerson if the little woooooman ever fiiiiinds ooooooutttttt.....  she miiiight also fill in the hole beeeefore you geeeeetttt a chaaaance to riiidddeeee ittttt.  This peeeeebbble appp woooon't ssaaaave yooou froooooom the faaaaaceplant that sheeeee wiiiillll giiiive yoooou iiiiifff shhhheeee fiiinds oooooouuuuttttt > ;)

new APP:

wife.png

Link to comment
Share on other sites

Beta 2 - https://github.com/JumpMaster/WheelLogAndroid/releases/tag/0.2

  • Launch the android app from the Pebble app. Hold the select button for 1 second. Android app launches, connects, and starts the Pebble service. Even when your phone is locked!
  • Added a data logger. Logs at 10Hz which is the update speed of the wheel. Saves the csv to Downloads/wheelLog/
  • Auto-connects on launch if there's been a previous successful connect. It also auto-reconnects if you have to turn the wheel on and off again.  Connections may take 10-30 seconds.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...