printing gatttool notification data in file

I am running sensortag 2650 to read notification from sensor to my computer.I am using gatttool (bluez) to do this.My output gets displayed on the console, while the sensor is on the run. BTW I am using ubuntu 14.0.4.

Now the issue is I am not able to make the output data get written in a file instead of displaying on the console. I tried the normal re-direct >>/> operator but that doesnt work.

I am using the following link, just that I am using Linux on my system instead of Raspberry Pi.

https://github.com/codeplanner/TI-CC2650-1

Any clue would be highly appreciated.

Thanks, Shankhadeep


Solution 1:

Do the following:

sudo gatttool -b XX:XX:XX:XX:XX:XX >> output.txt

Then the terminal won´t show anything. BUT! type connect and press enter. Now the bluetoothmodule is paired with your device!

Normaly, everytime when you get a notification, this will be write in the output.txt.

I tested it with my bluetooth module HM-10 and a Raspberry Pi and it works!