send custom data using ble
Closed this issue · 3 comments
I have device which receives any data (digits) using ble and showing it on lcd
I'm using sketch in arduino ide for now.
Is it possible to send any data using ble with your module? I see only switch implementation
Thanks in advance
Hi,
Are you thinking about using my module for receiving digits and displaying them on LCD? Well, then you could use a custom command like „receive-digits“, which can receive strings.
esp32_ble_controller:
commands:
- command: receive-digits
description: just a test
on_execute:- logger.log:
format: "I have received some digits: %s"
args: 'arguments[0].c_str()'
- logger.log:
So if you send „receive-digits 1234“ over BLE Command channel characteristic, then you should see „ I have received some digits: 1234“ in the logging output. So the digits are in the arguments[0] variable and you could show them on the LCD as well.
I have xiaomi thermometer LYWSD03MMC. I use custom firmware ( https://github.com/pvvx/ATC_MiThermometer ) to send any data to thermometer for showing it on its lcd.
this is the sketch i'm currently using: https://gist.github.com/bonuzzz/8b69f821d850d7cb2f8ac3b1b5b0fa06
I use this thermometer just like display. Esp32 receives data from mqtt and send it to thermometer.
Oh, I see. Your sketch is implementing a BLE client (see line 159), my component provides a BLE server. So I am afraid you cannot use it to replace your sketch with ESP Home. Maybe you can use the BLE client and the BLE client sensor from the standard ESPHome. But I think they can only receive and not send data, but I am not sure. So please contact the author of these components.