This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thingy and blutoothctl - How to read data via Linux console?

Hello everybody!

How can i read the temperature, the battery-% or other data from the Thingy when using the Linux console and not the SDK? My steps so far

1. With

sudo hcitool lescan
i was able to find the Thingy, a device with unknown name (but same MAC as the Thingy) and a third one which turns off with the Thingy.

2. start bluetoothctl and run

info [MACofThingy]
displays the name, an alias and trust/block/connect status

3. pairing with the Thingy did not work, but

connect [MACofThingy]
(still in the bluetoothctl environment) did work and showed me nine UUIDs

4. diving into gatt submenu: one should be able to list the attributes and read/write them. But this does not work because no attributes are listed.

Another option i tried was the

gatttool -b [MACofThingy] --char-read --uuid=2800
command with the Thingy still connected (green breathing light). The connection got refused (Error 111) for each UUID i tried.

Operating system is Ubuntu 16.04 on a Thinkpad with its Standard, BLE-capable, Wifi module.

Parents Reply
  • HI

    I thought so after trying with my phone (which has no problems reading the data). After searching the web for ages i found: hcitool and gatttool no longer distributed with standard BlueZ packages

    One has to use btmgmt now which is in the bluez packet. The newest packet (right now 5.49) can be downloaded at bluez.org

    This help for using btmgmt is also displayed in the console. But i did not manage to connect to the Thingy yet.

    1. Before calling this tool a "sudo rfkill unblock all" is needed.
    2. bgmgmt has to be opened as sudo
    3. Make sure BLE is on (Call "power on" and "le on") and connectable ("connectable on")
    4. use "find" to scan for devices --> list with MACs and RSSIs is displayed
    5. try pair [MACofThingy] and receiver a 0x04 error (connect failed).

    FAIL - I have to work some more on this problem. Not beeing able to connect bugs me.

Children
Related