I am trying to use convexa-s to connect to ble thermometer. When using the Admin Panel → Applications → Bluetooth than it can find it and connect to it.
But when using bletool (following this docs BLE MQTT Bridge - GL.iNet Docs) it does cannot connect. It returns -1 code. I also noticed that the mentioned above guide (ble2mqtt) is outdated as it refers to commands that do no exist anymore.
Is there any more complete guide that help to build ble to MQTT bridge?
The bletool project has been updated here GitHub - gl-inet/bletool.
It provide more flexible programming interface including CLI and C/C++ API. And the source code is open source. Refer to the new document in src/docs of this repository.
MQTT is a independent function module, you can use our gl_mqtt or some other mqtt plugin in openwrt like mosquito-mqtt. If using gl_mqtt you can refer the link you have metioned, mosquitto-mqtt refer here Mosquitto on OpenWrt | Eclipse Mosquitto.
the bletool from linked GitHub repo is exactly what I used. I actually had to remove the gl-bletool-api (which I believe is used by the Admin Panel) to make the Bletool work.
So it can discover, list local address etc but somehow it does not connect to the device.
Any hints on what to use to troubleshoot the connection issue?
In meantime I used the Admin Panel cgi endpoints to connect to the device. Will it be considered safe choice to rely on the cgi api instead?
What’s the erro or log when the connection failed? And what’s your steps when you attemp to connect some devices?
The cgi api is just a demonstration for BLE feature. It will be replaced by bletool.