BLE4 as a RFCOMM/serial interface for $RC2/$RC3

edited August 2019 in DIY builds
Hello,
i have an Arduino prototype for my car project and one of the features is to read raw CAN-bus data and send it via Bluetooth to Racechrono for logging.

The issue is that i cannot connect to my BLE4 device (HM-10 clone with CC2541 chip) from Racechrono. However, with the same setup, i was able to get it working with older Bluetooth2 and HC-05 module without issues, but connecting with RFCOMM method from Racechrono.

My findings:
I have the same issue as in this thread: https://racechrono.com/forum/discussion/1590/diy-data-collection-with-link-to-working-code-for-arduino-and-bluetooth
Cite: "tried AT09 (BT4/BLE) module in stead of HC05 (BT2). When using "Serial Bluetooth Terminal" on my Android phone I can see data is arriving (same with AT09 as with HC05), but with AT09: RaceChrono (on the same phone) always and forever get stuck with message "Connecting to Data logger..." and "Connecting... (waiting)"."

I'm able to connect via BLE if i change the UUID of my module to the one mentioned in your DYI:00001ff8-0000-1000-8000-00805f9b34fb
but then, i have only option of CAN-BUS and GPS. But i need the RFCOMM/Serial (RC2/RC3) option.

Finally: What is the SERVICE UUID for being able to connect LE device as RC2/RC3 into RaceChrono ? :)
according to: https://www.bluetooth.com/specifications/assigned-numbers/service-discovery/
both 0x1101 (serialport) and 0x0003 (rfcomm) does not show up my LE in the list to being able to connect.

my sample data:
$RC2,,1457,,,,2107,2,,,,,,,,*3E
$RC2,,1458,,,,2100,2,,,,,,,,*36
$RC2,,1459,,,,2100,2,,,,,,,,*37
$RC2,,1460,,,,2100,2,,,,,,,,*3D
$RC2,,1461,,,,2100,2,,,,,,,,*3C
$RC2,,1462,,,,2100,2,,,,,,,,*3F
$RC2,,1463,,,,2107,2,,,,,,,,*39
$RC2,,1464,,,,2100,3,,,,,,,,*38
$RC2,,1465,,,,2100,3,,,,,,,,*39
$RC2,,1466,,,,2100,3,,,,,,,,*3A
$RC2,,1467,,,,2107,3,,,,,,,,*3C
$RC2,,1468,,,,2107,3,,,,,,,,*33
$RC2,,1469,,,,2100,3,,,,,,,,*35

Comments

  • RaceChrono does not support streaming $RC2/RC3 data through Bluetooth LE. It is supported only through Bluetooth RFCOMM. I guess there's no big reason why it could not be supported, but there probably will be some problems with bandwidth. I will consider this.
  • Thanks. I can go with raw CANbus, but I have also few sensors that are out of CANbus in the car, so anyway, I'll be processing the CANbus data on Arduino, mix it with the rest and then send it via $RC2/3 to RaceChrono.

    In my opinion, the bandwidth of CAN will be still higher on BLE anyway. I'm aiming for 10Hz on serial $RC2/3 of BLE that should be still fine.

    Looking forward to have this feature on BLE in upcoming releases, if you will consider it is worth it ;-) I expect the UUID will be the same, but there will be one more option for the $RC2/3.

  • Hello...RFCOMM is a set of simple transport protocols built on top of L2CAP and sometimes referred to as serial port emulation. The Bluetooth serial port profile, or SPP is based on this protocol.

    SPP is RFCOMM based profile for Bluetooth Classic BR/EDR connections only. SPP over BLE is not theoretically possible.
  • Yes, you are right, but many vendors have this feature implemented in their chips via simple 2 UIDs that accepts text/byte values for "TX/RX channels" respectively.

    For example i was testing with the Android app connected to BLE device quite easily with my CC2541 chip in Arduino: https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal

    This thread is really old, i get it implemented via old Bluetooth chip and RFCOMM, while now i'm targeting to use ESP32 natively, but strugeling with the 3.3V vs 5V peripherals.

    from the App developer:
    ________________________________________________________
    Bluetooth LE (implementing vendor specific Bluetooth GATT services):
    - predefined:
    * Nordic Semiconductor nRF51822, … (e.g. BBC micro:bit)
    * Texas Instruments CC254x (e.g. HM-10, CC41-A, … modules)
    * Microchip RN4870/71, BM70/71 'transparent UART service'
    * Telit Bluemod
    - custom profile:
    * Texas Instruments CC2640 serial service, except config characteristics
    * Silabls BLE113
    * uConnect BLE serial adapter
  • Just as @ankel says. Many OBD-II readers use this style of serial stream over Bluetooth LE. It's just extra protocol layer, non-standard, but already sort of "de-facto standard". But for a GPS with high update rate its too slow.
  • Hi,

    I have the same problem with MLT-BT05 4.0 module (clone of CC2541 which is a clone of HM-10). I have it connected through hardware serial on my Arduino Mega 2560.

    When I change using AT commands the BT's module UUID to '1FF8' and characteristics to '0001' I can see this device when adding "Add other device" -> "RaceChrono DIY" -> "Bluetooth LE" -> "Add other device" -> "MLT--BT05" -> "CAN-Bus".

    I can send and receive text messages when connected through Android "Serial Bluetooth Terminal".

    But in RaceChrono Live session it is always "Connecting... (waiting)" to "Connected" and back again over and over again with "Waiting for data...".

    I'am trying to send simple 5 byte array data where 4 bytes contain PID = 1 and 5th byte = 100.
    Equation in RaceChrono bytesToUInt(raw, 0, 1) for source code 0x64.

    byte msg[5]={0x01,0x00,0x00,0x00,0x64};
    Serial1.write(msg, 5);

    Am I doing something wrong? Or is it that this BT module is lacking some functionality?

Sign In or Register to comment.