Please share the Bloothoth communication protocol.



  • Hello there,

    i do not have a smartphone, but a bluetooth receiver an Atmega controller and asmall display. i would love to display max speed and some other statistics while riding.

    Please provide a specification sheet for the Bluetooth communication.



  • In the hope that someone reads this and is willing to help.

    Meanwhile i connected my PC to the HC05 Device (Bluetooth Module from Arduino) and entered the AT-Mode

    I entered

    AT+ROLE=1 (This switches the device into Master Mode)

    Normally then i have to use the Bind command to bind to the onewheel

    e.g.
    AT+BIND=13,3,191407

    But where do i get the Address of the Onewheel ?

    If i ran AT+STATE? i always get "+STATE:INQUIRING"

    Until now i was not able to find out the AT Command that can show which devices are near do my antenna..



  • @corpsman if you have an Android phone, you can use an app called BLE Scanner to find the bluetooth device address of the OneWheel.

    Hope that helps!



  • Thanks i am making progress.

    By using the following AT+Commands in that order i can scan for devices:

     'AT+RMAAD'    // Löschen des bisherigen Speichers
     'AT+CMODE=1' // Enable connect to any device
     'AT+ROLE=1' // Set to master in order to enable scanning
     'AT+INQM=1,10,24' //RSSI, Max 10 devices, ~30s
     'AT+CLASS=0' // Disable COD filter
     'AT+INIT' // Init
     'AT+INQ' // Suche Starten
    

    This gives me a list of all Bluetooth devices near, i get a list of 2, where it should be 3. If i use the scan tool that i installed on a tablet, i get a list of 3, and yes the missing one is the onewheel, so it seems that the hc05 Module is not able to "find" the onewheel but my other devices :(

    By the way i tried to pair to the onewheel from my tablet using the default passwords "0000" and "1234" and got the message, that pairing was failed.

    So i have now 2 problems to solve.

    1. Find a module that is able to detect the OneWheel
    2. Find out the password that is needed to pair with the OneWheel..


  • Maybe this source code helps to figure some things out: https://github.com/ponewheel/android-ponewheel



  • So i am back again, here is what i get so far.

    I thought i bought a HM10 module, but unfortunately i got only one of this fake devices, so i bought a Arduino Nano and followed this instructions : https://www.youtube.com/watch?v=ez3491-v8Og

    Now i am able to detect and connect to the onewheel. (The red LED is not flashing anymore, this means i am paired).

    Next step will be understanding the code that windaddict posted, but this is java code and by now i don't speak java so this could take a bit g. As far as i understood until now, i have to send some request for a address and the result is what i need eg. 0x0045 should stand for the lighting mode. But what exactly to send, i don't know until now.

    i will inform you when i make more progress...



  • Hello, Back again, ..
    i am making slowly progress ;).
    First i found out, that Bluetooth works in a thing that is called characteristics / handels with values.
    So i decided to split my work into 2 parts.

    1. get a connection to the onwheel from PC and proove that i am able to get values

    2. do the same via µ-controller

    3. connect the onewheel to PC (to my luck i am a Linux user so i can use the bluez tools)

    • first i needed to get the Mac Address of my onehweel, this is done via the HM10 Module
      to scan for the onewheel connect the uart to the HM10module and enter the following commands

    How to Scan for devices: ( http://www.martyncurrey.com/hm-10-bluetooth-4ble-modules/#HM-10 scan )

    AT - Test if device is in AT-Mode
    AT+RENEW - Reset to Factory defaults
    AT+RESET - Restart Module
    AT+IMME1 - Disable Autoconnect in Slave mode
    AT+ROLE1 - Switch to master Mode
    AT+RESET - Restart Module
    AT+DISK? - Scan for devices

    This results in: DIS0:9C1D58145E74OK+DISCE

    So the mac address of my Onewheel is: 9C:1D:58:14:5E:74

    connect to the onewheel connect 9C:1D:58:14:5E:74

    read all characteristics: characteristics

    handle: 0x0002, char properties: 0x0e, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
    handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
    handle: 0x0006, char properties: 0x0a, char value handle: 0x0007, uuid: 00002a02-0000-1000-8000-00805f9b34fb
    handle: 0x0008, char properties: 0x08, char value handle: 0x0009, uuid: 00002a03-0000-1000-8000-00805f9b34fb
    handle: 0x000a, char properties: 0x02, char value handle: 0x000b, uuid: 00002a04-0000-1000-8000-00805f9b34fb
    handle: 0x000d, char properties: 0x20, char value handle: 0x000e, uuid: 00002a05-0000-1000-8000-00805f9b34fb
    handle: 0x0011, char properties: 0x10, char value handle: 0x0012, uuid: e659f3fe-ea98-11e3-ac10-0800200c9a66
    handle: 0x0015, char properties: 0x08, char value handle: 0x0016, uuid: e659f3ff-ea98-11e3-ac10-0800200c9a66
    handle: 0x0018, char properties: 0x1a, char value handle: 0x0019, uuid: e659f301-ea98-11e3-ac10-0800200c9a66
    handle: 0x001c, char properties: 0x1a, char value handle: 0x001d, uuid: e659f302-ea98-11e3-ac10-0800200c9a66
    handle: 0x0020, char properties: 0x1a, char value handle: 0x0021, uuid: e659f303-ea98-11e3-ac10-0800200c9a66
    handle: 0x0024, char properties: 0x1a, char value handle: 0x0025, uuid: e659f304-ea98-11e3-ac10-0800200c9a66
    handle: 0x0028, char properties: 0x1a, char value handle: 0x0029, uuid: e659f305-ea98-11e3-ac10-0800200c9a66
    handle: 0x002c, char properties: 0x1a, char value handle: 0x002d, uuid: e659f306-ea98-11e3-ac10-0800200c9a66
    handle: 0x0030, char properties: 0x1a, char value handle: 0x0031, uuid: e659f307-ea98-11e3-ac10-0800200c9a66
    handle: 0x0034, char properties: 0x1a, char value handle: 0x0035, uuid: e659f308-ea98-11e3-ac10-0800200c9a66 (Winkel Fusspitze / Verse)
    handle: 0x0038, char properties: 0x1a, char value handle: 0x0039, uuid: e659f309-ea98-11e3-ac10-0800200c9a66 (Winkel Vorwärts Rückwärts)
    handle: 0x003c, char properties: 0x1a, char value handle: 0x003d, uuid: e659f30a-ea98-11e3-ac10-0800200c9a66
    handle: 0x0040, char properties: 0x1a, char value handle: 0x0041, uuid: e659f30b-ea98-11e3-ac10-0800200c9a66
    handle: 0x0044, char properties: 0x1a, char value handle: 0x0045, uuid: e659f30c-ea98-11e3-ac10-0800200c9a66
    handle: 0x0048, char properties: 0x1a, char value handle: 0x0049, uuid: e659f30d-ea98-11e3-ac10-0800200c9a66
    handle: 0x004c, char properties: 0x1a, char value handle: 0x004d, uuid: e659f30e-ea98-11e3-ac10-0800200c9a66
    handle: 0x0050, char properties: 0x1a, char value handle: 0x0051, uuid: e659f30f-ea98-11e3-ac10-0800200c9a66
    handle: 0x0054, char properties: 0x1a, char value handle: 0x0055, uuid: e659f310-ea98-11e3-ac10-0800200c9a66
    handle: 0x0058, char properties: 0x1a, char value handle: 0x0059, uuid: e659f311-ea98-11e3-ac10-0800200c9a66
    handle: 0x005c, char properties: 0x1a, char value handle: 0x005d, uuid: e659f312-ea98-11e3-ac10-0800200c9a66
    handle: 0x0060, char properties: 0x1a, char value handle: 0x0061, uuid: e659f313-ea98-11e3-ac10-0800200c9a66
    handle: 0x0064, char properties: 0x1a, char value handle: 0x0065, uuid: e659f314-ea98-11e3-ac10-0800200c9a66
    handle: 0x0068, char properties: 0x1a, char value handle: 0x0069, uuid: e659f315-ea98-11e3-ac10-0800200c9a66
    handle: 0x006c, char properties: 0x1a, char value handle: 0x006d, uuid: e659f316-ea98-11e3-ac10-0800200c9a66
    handle: 0x0070, char properties: 0x1a, char value handle: 0x0071, uuid: e659f317-ea98-11e3-ac10-0800200c9a66
    handle: 0x0074, char properties: 0x1a, char value handle: 0x0075, uuid: e659f318-ea98-11e3-ac10-0800200c9a66
    handle: 0x0078, char properties: 0x1a, char value handle: 0x0079, uuid: e659f319-ea98-11e3-ac10-0800200c9a66
    handle: 0x007c, char properties: 0x1a, char value handle: 0x007d, uuid: e659f31a-ea98-11e3-ac10-0800200c9a66
    handle: 0x0080, char properties: 0x1a, char value handle: 0x0081, uuid: e659f31b-ea98-11e3-ac10-0800200c9a66
    handle: 0x0084, char properties: 0x1a, char value handle: 0x0085, uuid: e659f31c-ea98-11e3-ac10-0800200c9a66
    handle: 0x0088, char properties: 0x1a, char value handle: 0x0089, uuid: e659f31d-ea98-11e3-ac10-0800200c9a66
    handle: 0x008c, char properties: 0x1a, char value handle: 0x008d, uuid: e659f31e-ea98-11e3-ac10-0800200c9a66
    handle: 0x0090, char properties: 0x1a, char value handle: 0x0091, uuid: e659f31f-ea98-11e3-ac10-0800200c9a66
    handle: 0x0094, char properties: 0x1a, char value handle: 0x0095, uuid: e659f320-ea98-11e3-ac10-0800200c9a66

    Jehaa suceess, the onewheel is talking to me.

    In the sources i found this file: https://github.com/ponewheel/android-ponewheel/blob/master/app/src/main/java/net/kwatts/powtools/model/OWDevice.java

    which is explainging most of the uuids, but be carefull the handle numbers are sometimes not correct, the list above is a copy from the gatttool output so this should be ok.

    So lets see if we can get some informations:

    e659f308-ea98-11e3-ac10-0800200c9a66 should be the rolling angle, so lets read the value:

    command: char-read-uuid e659f309-ea98-11e3-ac10-0800200c9a66
    the same can be done by: char-read-hnd 39
    here is what i get, while turning the Onewheel from left to right

    [9C:1D:58:14:5E:74][LE]> char-read-uuid e659f309-ea98-11e3-ac10-0800200c9a66
    handle: 0x0039 value: 0a 86
    [9C:1D:58:14:5E:74][LE]> char-read-uuid e659f309-ea98-11e3-ac10-0800200c9a66
    handle: 0x0039 value: 0a ba
    [9C:1D:58:14:5E:74][LE]> char-read-uuid e659f309-ea98-11e3-ac10-0800200c9a66
    handle: 0x0039 value: 03 8b
    [9C:1D:58:14:5E:74][LE]> char-read-uuid e659f309-ea98-11e3-ac10-0800200c9a66
    handle: 0x0039 value: 03 77
    [9C:1D:58:14:5E:74][LE]> char-read-uuid e659f309-ea98-11e3-ac10-0800200c9a66
    handle: 0x0039 value: 0a 85

    So the next step would be to do the same through the HM10-Module