tho whom it may concern
howto connect an el cheapo bluetooth-serial module (e.g. HC-06)
Connect a usb-serial to the bluetooth module (5v, gnd, rx<->tx, tx<->rx)
AT commands to setup baud rate, name, pin.
When there's no active bluetooth connection the HC-06 defaults to "AT" mode and you can set it up to your needs.
You can test the bt-serial connection e.g. if you have a built-in bt module in your pc.
Check if there's /dev/rfcomm after establishing a bt connection to the module.
If not you need to setup the bluetooth-serial connection e.g. in ubuntu like this:
Code:
hcitool scan
#comment ^^ get the mac (e.g. 00:12:06:DE:E1:B3)
sudo rfcomm connect /dev/rfcomm0 <mac>
#comment try the connection:
#comment console 1: bluetooth serial (built in bluetooth module)
sudo minicom –device /dev/rfcomm0 –baudrate 9600
#comment console 2: usb serial connected to hc-06 module
sudo minicom -device /dev/ttyUSB0 -baudrate 9600
#comment if you add your user to dialout group you don't need root permissions ;-)
#comment ^^ type some stuff (should display in both minicom sessions)
So after setting up the module connect the bluetooth module to the VESC P3 connector. P3: [5V, not4us , gnd, not4us, tx, rx]
I setup the HC-06 with 9600 baud - so you need to set the UART baud rate for the VESC UART to 9600 and
additionally you need to change the baud rate for bldc-tool in mainwindow.cpp in bldc-tool line 1799 to
Code:
mSerialPort->setBaudRate(QSerialPort::Baud9600);
and recompile with "make -j4" (or however many cores you have to speed up things).
Afterwards you can connect to your VESC with bldc-tool through e.g. /dev/rfcomm0
bldc-tool connected through bluetooth
vedder controller with hc-06 bluetooth module
^^ feel free to use this as a starting point putting it in the
VESC FAQ
or a proper wiki (hint hint @vedder)
Now it would really be awesome to be able to connect to the VESC with jacobbloy's android app (
thread here).
of course the hc-06 is a shitty module - but that's what I had at hand.