**Question**
How do i properly write a characteristic to an attribute?
**Add…itional context**
I have a Thermopro TP-25 meat thermometer that i am trying to use in my home automation system.
I did some sniffing on the Bluetooth protocol between the thermometer and the provided app, and i can see that the Thermometer requires that a string be written to a characteristic to connect to it. After that, you can subscribe to the notifications in the thermometer.
The packet sent to the thermometer in order to connect is as follows (Screenshot taken from wireshark)
![image](https://user-images.githubusercontent.com/7197023/198174746-14ee3ba3-ec5d-4066-98ec-773f43c060b2.png)
I am running esp32-ble-mqtt on an esp32-wroom-32. The device detects my Thermometer, as shown by the logs:
```
I (2479817) BLE2MQTT: Connected to device: ee:ca:79:d7:d4:27, scanning
I (2480437) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/GenericAccess/DeviceName = Thermopro
I (2480497) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/GenericAccess/Appearance = 0
I (2480537) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/GenericAccess/PeripheralPreferredConnectionParameters = 120,200,4,400
I (2480597) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/GenericAccess/CentralAddressResolution = 1
I (2480737) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/1086fff0-3343-4817-8bb2-b32206336ce8/1086fff1-3343-4817-8bb2-b32206336ce8 = 1,0,62,143,138,108,53,238,38,227,248,241,126,253,94,238,180,20,24,0
I (2480797) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/1086fff0-3343-4817-8bb2-b32206336ce8/1086fff2-3343-4817-8bb2-b32206336ce8 = 224,2,1,2,229,108,53,238,38,227,248,241,0,32,72,0,0,32,2,0
I (2480897) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/1086fff0-3343-4817-8bb2-b32206336ce8/1086fff2-3343-4817-8bb2-b32206336ce8 = 224,2,1,2,229,108,53,238,38,227,248,241,0,32,72,0,0,32,2,0
I (2480937) BLE2MQTT: Publishing: ee:ca:79:d7:d4:27/1086fff0-3343-4817-8bb2-b32206336ce8/1086fff1-3343-4817-8bb2-b32206336ce8 = 1,0,62,143,138,108,53,238,38,227,248,241,126,253,94,238,180,20,24,0
I (2483897) BLE2MQTT: Discovered BLE device: 42:79:48:2b:ad:6e (RSSI: -73), connecting
```
I also have a messaged published through mqtt-explorer that has the retain flag on, to write to this characteristic on connect:
![image](https://user-images.githubusercontent.com/7197023/198175127-4473871f-55bf-4785-8169-8be7e083f099.png)
However, i do not see the device staying connected to esp32-ble-mqtt. I also don't see anywhere in the logs (as shown above) where is this message published. So i am not sure if it is published, and if it is, it is not working.
What would be the best way to troubleshoot this issue?
Thanks