3
\$\begingroup\$

Short question - how do I send data as GATT characteristics from a peripheral BLE device (Android UNO + HM-10) to a central device (i.e. an android smartphone?)


I'm working on a BLE peripheral as a learning project right now - I'm using an Arduino Uno and an HM-10. It's going well so far - sensors are working and I can send this data from the Arduino Uno to Android using an HM-10 BLE module (actually a CC2541 clone) on the standard service and characteristic for this device:

  • Service UUID: 0000ffe0-0000-1000-8000-00805f9b34fb
  • Characteristic: UUID: 0000ffe1-0000-1000-8000-00805f9b34fb

Working in this way the HM-10 emulates a traditional bluetooth serial connection. All good so far!

What I would now like to do is send the data using accepted GATT services and characteristics. For example lets say I would like to use the Running Speed and Cadence service to send my data in a way that can be viewed by any compatible app. I would need to change the service to 0x1814 and the characteristics to:

  • Cadence: 0x27A8
  • Velocity: 0x27A6
  • Gradient: 0x2763

I believe I could do this by using the AT commands:

  • AT+UUID0x1814
  • AT+CHAR0x2763

I think I'm OK with all of this so far, but what I cannot find guidance on is how to define multiple characteristics, and how to send my sensor data to my central device as GATT characteristics.

For example my speed is 10kmh-1 and my cadence is 80 - how do I specify the GATT characteristics for this and notify the central device when they change? Also bonus question - can I include an additional characteristic for gradient?

I've thoroughly searched but cannot find anything on this. Thanks!

\$\endgroup\$
1
  • \$\begingroup\$ This has been edited to remove the arduino tag, but if any respondents could keep in mind that I'm working in the Arduino IDE I'd appreciate it :) I'm new to this and likely to be confused easily! haha. \$\endgroup\$
    – c.early
    Aug 9 '17 at 11:55
1
\$\begingroup\$

AT+NOTI unfortunately is not the correct command. The manual states:

AT+NOTI[P1]

If this value is set to 1, when link ESTABLISHED or LOSTED module will send OK+CONN or OK+LOST string through UART.

I believe, it's not possible to do what you want. I've been searching my whole day, but there is only this one custom characteristics, and you can change only the short UUID. I found no way to get data from other UUIDs in Central mode.

Here is some more info: BLECentral - HM-10 BLE Module

Edit: With new Firmware version > V546, there is a possibility to use 128 Bit UUIds. A readme + the needed software is located here: jnhuamao Website. And V605 states:

hm-10 readme

Unfortunately, I did not succeed to update the Firmware yet.

\$\endgroup\$
0
\$\begingroup\$

I think you're looking for AT+NOTI. Check the datasheet for specifics, but notify is what pushes from slave to master.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.