You are here

I have the BLUEZ... Or rather... I don't.

7 posts / 0 new
Last post
Roger Wolff
Offline
Last seen: 2 years 6 months ago
VESC Original
Joined: 2017-05-24 12:27
Posts: 202
I have the BLUEZ... Or rather... I don't.

VESC_TOOL 0.87 (and not 0.84) has support for something called "BLUEZ". I suspect it has something to do with bluetooth. I've never used bluetooth,

 

So when I start vesc_tool, I have to wait 30 seconds for the message: "Cannot find a running Bluez. Please check the Bluez installation.". 

 

So... for the todolist: Either: Speed up the detection of the "running bluez". But I suspect that htis is just a library call. The library assumes that the calling app has no business running if the connection cannot be found, so waiting is reasonable. 

The workaround would be to detect: bluez not found last time, require user interaction to retry the connection.... 

 

TheFallen
Offline
Last seen: 4 weeks 1 day ago
VESC FreeVESC Original
Joined: 2017-09-11 11:46
Posts: 222

Bluez is the 'official' Linux Bluetooth stack. What OS are you using?

Roger Wolff
Offline
Last seen: 2 years 6 months ago
VESC Original
Joined: 2017-05-24 12:27
Posts: 202

Linux. Ubuntu. 

 

The message indicates that I don't have BLUEZ installed. The reason is: I don't use bluetooth. So that makes sense. But at times I have to restart VESC_TOOL a few times in a row and if it takes 30 seconds to start up, that's a waste-of-time. 

benjamin
Offline
Last seen: 1 week 3 days ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

This is probably because of the added BLE support, which is build into Qt. I haven't experienced any delay myself when starting on a computer without bluetooth on a default ubuntu installation, but I will have a look.

arvidb
Offline
Last seen: 5 years 5 months ago
Joined: 2018-01-16 23:09
Posts: 77

I have the same problem.

I'm using a VESC Tool built by myself on a Linux Mint 18.1 machine. I don't seem to be able to attach a file to this post, but I've added a patch below that hides the problem for me. It seems to be the call to "new QBluetoothDeviceDiscoveryAgent(this);" that triggers the delay.

(I don't know why the forum decides to format only half of the code-tagged text as monofont - oh well...)


diff --git a/bleuart.cpp b/bleuart.cpp
index 53f4229..277383a 100644
--- a/bleuart.cpp
+++ b/bleuart.cpp
@@ -32,7 +32,7 @@ BleUart::BleUart(QObject *parent) : QObject(parent)
mServiceUuid = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
mRxUuid = "6e400002-b5a3-f393-e0a9-e50e24dcca9e";
mTxUuid = "6e400003-b5a3-f393-e0a9-e50e24dcca9e";
-
+/*
mDeviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent(this);

connect(mDeviceDiscoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&)),
@@ -40,12 +40,13 @@ BleUart::BleUart(QObject *parent) : QObject(parent)
connect(mDeviceDiscoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)),
this, SLOT(deviceScanError(QBluetoothDeviceDiscoveryAgent::Error)));
connect(mDeviceDiscoveryAgent, SIGNAL(finished()), this, SLOT(scanFinished()));
+*/
}

void BleUart::startScan()
{
mDevs.clear();
- mDeviceDiscoveryAgent->start();
+ //mDeviceDiscoveryAgent->start();
}

void BleUart::startConnect(QString addr)

rpasichnyk
Offline
Last seen: 4 months 2 days ago
VESC Free
Joined: 2017-09-05 08:18
Posts: 3

@arvidb you are welcome to create a pull request https://github.com/vedderb/vesc_tool/pulls

arvidb
Offline
Last seen: 5 years 5 months ago
Joined: 2018-01-16 23:09
Posts: 77

Thanks, but I don't think you would want this patch in the official code? It "fixes" the problem rather heavy-handedly by commenting out the scan for Bluetooth devices completely. So it's more of a quick fix, and for showing others where the problem lies.