Bletool on Convexa S

Hello,

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 https://docs.gl-inet.com/en/3/app/ble2mqtt/) 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?

Thanks
Maciej

The bletool project has been updated here https://github.com/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 http://mosquitto.org/blog/2011/08/mosquitto-on-openwrt/.

@yao thanks for reply

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.

What’s the erro or log when the connection failed? And what’s your steps when you attemp to connect some devices?

bletool enable
bletool discovery
bletool listen
.....// prints found devices

bletool connect -a address -t 0

the connect simply ends up with
code -1 (json string)

nothing more is returned. I tried the same going directly via ubus call ble… but the result is exactly the same.

The cgi api is just a demonstration for BLE feature. It will be replaced by bletool.

ok, good to know