HM-10: Add a second Custom Characteristic
By default the HM-10 comes with a single custom characteristic under a custom service. A second write only characteristic can be added using the “AT+FFE2” command. “AT+FFE2” was added in firmware 5.45 and extended in version 5.50.
The second custom characteristic only has a WRITE property no READ and the value of this characteristic is sent to the serial UART connection the same as the FFE1 characteristic.
AT+FFE2?
Query the status of the second custom characteristic. Returns either 0 or 1.
0 = not active.
1 = active.
AT+FFE21 start the second custom characteristic
AT+FFE20 stop the second custom characteristic
AT+RESP
Although the second custom characteristic is WRITE only you can set it to have a response or not using the “AT+RESP” command.
AT+RESP?
Query the write response status. Returns 0 or 1.
0 = Write without a response.
1 = Write with a response.
AT+RESP0 set the second custom characteristic to no response
AT+RESP1 set to have a response.
Arduino sketch
Note: I am using sketch SerialIn_SerialOut_HM-10_01.ino which can be downloaded here or copied from below. This sketch adds line end characters to the serial monitor window to make the commands easier to see. The sketch also removes any line end characters before sending the data to the HM-10. This means you can have “Both NL & CR” set in the serial monitor.
After connecting and uploading the sketch, make sure the HM-10 is working by using the AT command. Then use “AT+RENEW” to restore factory settings.
“AT+FFE21” starts the second custom characteristic. I am also adding a write with a response with “AT+RESP1”.
Cycle the power or reset the HM-10 for the changes to take effect.
The second custom characteristic is WRITE only. This means we can use it to send data to the HM-10 but we cannot use it to READ data. Anything we send to the HM-10 is output is the serial UART the same as the first custom characteristic.
To see it in action we can use the BLE Scanner app. Start the app, find and connect to the HM-10, expand the custom service and you should now see 2 custom characteristics:
In the FFE2 characteristic section click the W button and a text input window pops up. Enter “HELLO” and tap send.
The characteristic value should change to “HELLO” and “HELLO” should also appear in the serial monitor: