canibalimao
Posts: 557
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal

HFP for Linux (Bluetooth Handsfree) - can't install

Fri Apr 17, 2015 9:14 am

Hi,

I'm trying to make a little bluetooth handsfree "client" with a raspberry pi. I found a software already made that gives access to make and receive calls from RPi connected to a phone via Bluetooth (http://nohands.sourceforge.net/index.html).

However, I can't install that software. I've got all the packages needed installed from apt-get, I've run the ./autogen and ./configure commands, but when I try to "make install" I get this error:

Code: Select all

pi@raspberrypi ~/hfp/trunk $ sudo make install
Making install in libhfp
make[1]: Entering directory '/home/pi/hfp/trunk/libhfp'
g++ -DHAVE_CONFIG_H -I. -I.. -I../include -include config.h   -Wshadow -fno-exceptions -g -Wall -MT bt.o -MD -MP -MF .deps/bt.Tpo -c -o bt.o bt.cpp
In file included from bt.cpp:48:0:
../include/libhfp/bt.h: In member function âvoid libhfp::BtDevice::DisconnectAll()â:
../include/libhfp/bt.h:1081:50: warning: converting âfalseâ to pointer type for argument 1 of âvoid libhfp::BtDevice::__DisconnectAll(libhfp::ErrorInfo*)â [-Wconversion-null]
bt.cpp: In static member function âstatic int libhfp::SdpAsyncTaskHandler::SdpLookupChannel(libhfp::SdpTaskParams&)â:
bt.cpp:81:20: error: taking address of temporary [-fpermissive]
bt.cpp: In member function âbool libhfp::BtHub::Start(libhfp::ErrorInfo*)â:
bt.cpp:1226:22: error: taking address of temporary [-fpermissive]
bt.cpp:1226:34: error: taking address of temporary [-fpermissive]
Makefile:377: recipe for target 'bt.o' failed
make[1]: *** [bt.o] Error 1
make[1]: Leaving directory '/home/pi/hfp/trunk/libhfp'
Makefile:471: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
Can anyone help me?

Thank you all!

canibalimao
Posts: 557
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Mon Apr 20, 2015 11:18 am

Anyone, please?

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Mon Apr 20, 2015 11:45 am

If you search the Internet for BDADDR_ANY you can see that this error is common. I would assume the code does compile with some version of g++. I would try installing g++4.8 and try compiling with that:-

Code: Select all

make CXX=g++-4.8
Then if that is successful do

Code: Select all

sudo make install

canibalimao
Posts: 557
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Mon Apr 20, 2015 12:10 pm

Thank you very much. I'll try that later today.

adrasPi
Posts: 2
Joined: Thu Apr 23, 2015 12:29 am
Location: France

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Thu Apr 23, 2015 12:47 am

Hi,
I've just managed to install libhfp on my rasPi a+, so you can do it ;) .

I've solved the issue by going into the different Makefiles in the folders and adding -fpermissive after
'CXXFLAGS=' (ctr+F to search in leafpad). I know it is not good to compile like this, but at the end it worked.

I assume that you'll have another problem with the compilation, due to a bad link with the pthread library. You can solve by adding -lpthread after the 'CXXFLAGS=' or the ' LIBHFD_LIBS=' in the différent Makefiles.

I hope it helped, give me some feedbacks if you succeed to make it work .

canibalimao
Posts: 557
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Fri Apr 24, 2015 10:25 am

Thank you all for the tips.

I've passed these days trying to find soluntions and I can't get none.
I've also tried to make using g++4.8 and I get a lot of errors. The end of that list is something like this:

Code: Select all

../include/libhfp/events.h:903:13: note: declarations in dependent base âlibhfp::CallbackAdapter<void, libhfp::ArgSet<libhfp::BtDevice*, const char*, libhfp::ErrorInfo*, libhfp::Nil, libhfp::Nil, libhfp::Nil> >â are not found by unqualified lookup
../include/libhfp/events.h:903:13: note: use âthis->Invokeâ instead
Makefile:377: recipe for target 'bt.o' failed
make[2]: *** [bt.o] Error 1
make[2]: Leaving directory '/home/pi/hfp/trunk/libhfp'
Makefile:471: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/hfp/trunk'
Makefile:401: recipe for target 'all' failed
make: *** [all] Error 2
I was here now searching for "LIBHFD_LIBS=" and "CXXFLAGS=" on the different makefiles and I didn't get any result. Can you (adrasPi) tell me if that is supposed to be present in all the files?

Skivholme
Posts: 2
Joined: Sat Apr 25, 2015 11:09 am

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Sat Apr 25, 2015 11:15 am

Hi,

I had the same problem, as you canibalimao.

After reading adrasPi post i managed to install HFP on my Pi.
what i did was:

edit configure.in
change this line (line 71)
CXXFLAGS="$CXXFLAGS -Wall"
to
CXXFLAGS="$CXXFLAGS -Wall -fpermissive -lpthread"

And then there was no problem running "make" and "sudo make install"

Hope it helps

Skivholme
Posts: 2
Joined: Sat Apr 25, 2015 11:09 am

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Sat Apr 25, 2015 11:19 am

Hi,

I had the same problem as you, after reading adrasPi's post i got it working.

i edited configure.in
changed line 71 from
CXXFLAGS="$CXXFLAGS -Wall"
to
CXXFLAGS="$CXXFLAGS -Wall -fpermissive -lpthread"

then
./configure
make
sudo make install


hope it helps

adrasPi
Posts: 2
Joined: Thu Apr 23, 2015 12:29 am
Location: France

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Sat Apr 25, 2015 10:05 pm

Well, I've finally found how to install properly hfpd on linux:
  • 2 Install g++-4.4 (it is the version of g++ that was used when the library was released) :

    Code: Select all

    sudo apt-get install g++-4.4 
  • 3 In the file configure.in, modify the line 303 (add '-lpthread'),

    Code: Select all

    libhfp_LIBS="$libhfp_LIBS $BLUEZ_LIBS  
    --> libhfp_LIBS="$libhfp_LIBS $BLUEZ_LIBS  -lpthread"
(thanks to Skivholme for this smart solution)
  • 4 Then, you can run the generation files

    Code: Select all

    sudo ./autogen.sh
    sudo ./configure
    make 
    sudo make install
    
If you follow these steps you shouldn't have issues with the compilation. They were caused by the use of changes in the g++ standards and autogen.

canibalimao
Posts: 557
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Sun Apr 26, 2015 9:25 am

Thank you both for the help.

I followed the tips from adras and I get the same error when I execute "make" comand. Then I also changed the file like Skivholme told the error still there.

What packages have you installed? I installed the ones on the HFP webpage:

Code: Select all

sudo apt-get install subversion g++ autoconf libtool libspeexdsp-dev libasound2-dev libbluetooth-dev libaudiofile-dev libdbus-1-dev
EDIT: Wait, I've checked now the last edit on configure.in file and I found a mistake. Now I have compiled it once again and it seems to have worked. I just need to figure out now how to run the GUI :oops:

adrasPi, on those steps you have there, there is just one more thing I have done: what Skivholme said before you!

Thank you booth once again. Let's see if this is working now!

nautiyal-ashish
Posts: 2
Joined: Wed Jul 15, 2015 5:25 pm

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Wed Jul 15, 2015 5:32 pm

Hi Guys,
thanks to your help, i was finally able to start up the console application. However the application is not able to find my phone device. I have made sure that the bluetooth is ON and discoverable. Is neone else facing the same problem :?:
I tried to find the reason, and i believe that the problem is because of the bluez version. I am using bluez version 4.101. I read that with bluez v.4 some major changes were done and the configuration files have been changed( and also their location).
for ex. the library looks for the hcid.conf in /etc/bluetooth while my system does not have any such kind of file in that directory. I would really appreciate if some one can suggest what ideally can be done to deal with this.
I tried looking in the code for the location where it looks for values in these configurations files with the idea of replacing them with correct ones, however i was not able to find it.
Any help will be deeply appreciated.
Thank You :)

flyinghappy
Posts: 115
Joined: Mon Nov 05, 2012 5:31 pm

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Mon Oct 05, 2015 5:38 pm

You guys could possibly try this out

https://github.com/heinervdm/nohands

It has been updated much more recently than the sourceforge version.
Pi with ArchLinux running a minidlna/samba home server

tuongnguyen
Posts: 2
Joined: Thu Nov 05, 2015 2:54 am

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Thu Dec 17, 2015 12:09 pm

Dear All,

I also can run hfconsole on my raspi, but I can not scan my IP4S. Below is my environment:
- Raspi B+ (512M), Raspbian Wheezy
- Kernel 4.1.13+, bluez 4.99-2
- Bluetooth dongle USB CSR8510 A10

I aslo tried another USB CSR bluetooth 2.0 dongle, but hciconfig cannot set it up!

I then try to instal HFP on a Ubuntu 12.04LTS PC, I can run hfconsole and can pair with my IP4S, make call from that PC as well, but I can only do those things with the 2.0 CSR bluetooth dongle! The 4.0 CSR8510 usb bluetooth dongle is again can not scan and see my IP4S!!! This seams like there are some HCI codes too old to be supported by the 4.0 CSR dongle. If this is correct, then how can I move forward? Upgrade kernel or bluez or both?

As the PC's kernel is 3.13.0-32-generic, I turn back to my Raspi, install a fresh Raspbian Wheezy 2015-05-05, which has kernel 3.18, then hfconsole can run with my 2.0 CSR dongle, with scomtu 64:8, but again, I cannot scan my IP4S?! Should I need to downgrade kernel to 3.13? Then how can I do that?

And the last thing, as there are some incompatible issues, so there should be some warning or error messages, how can I see those kind of information when running hfconsole?

Thanks for your time!
TuongNguyen

tuongnguyen
Posts: 2
Joined: Thu Nov 05, 2015 2:54 am

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Tue Dec 22, 2015 3:43 am

Dear All,

I would like to update a bit on my progress....

So I chose to test with the 2.0 CSR bluetooth dongle on Raspbian Wheezy 2015-05-05, bluez 4.99-2. After installing HFP-nohands solution from source, r-88, from hfconsole, I can scan and add my IP4S, but I cannot pair with it. The console says RFCOMM connection refused. I tried "sudo hfconsole" but got same result. And again, trying "rfcomm connect" also receive the same message!

After hours googling, trying... I can pair my IP4S from hfconsole, below are my steps:

Code: Select all

pi@raspberrypi ~ $ sudo rm -rf /var/lib/bluetooth/*
pi@raspberrypi ~ $ sudo /etc/init.d/bluetooth restart
[ ok ] Stopping bluetooth: rfcomm /usr/sbin/bluetoothd.
[ ok ] Starting bluetooth: bluetoothd rfcomm.
pi@raspberrypi ~ $ hciconfig scan
hci0:	Type: BR/EDR  Bus: USB
	BD Address: 00:15:83:15:A1:EA  ACL MTU: 672:4  SCO MTU: 48:1
	UP RUNNING PSCAN 
	RX bytes:9338 acl:113 sco:0 events:256 errors:0
	TX bytes:4428 acl:103 sco:0 commands:107 errors:0

pi@raspberrypi ~ $ sudo hciconfig hci0 piscan scomtu 64:8
pi@raspberrypi ~ $ hcitool scan
Scanning ...
	0C:77:1A:37:24:0D	BiBo
pi@raspberrypi ~ $ sudo rfcomm bind hci0 0C:77:1A:37:24:0D
pi@raspberrypi ~ $ sudo rfcomm connect hci0 0C:77:1A:37:24:0D 1
Can't connect RFCOMM socket: Connection refused
pi@raspberrypi ~ $ bluez-simple-agent hci0 0C:77:1A:37:24:0D
RequestPinCode (/org/bluez/2703/hci0/dev_0C_77_1A_37_24_0D)
Enter PIN Code: 1234
Release
New device (/org/bluez/2703/hci0/dev_0C_77_1A_37_24_0D)
pi@raspberrypi ~ $ ls -l /var/lib/bluetooth/00\:15\:83\:15\:A1\:EA/
total 48
-rw-r--r-- 1 root root   27 Dec 22 03:03 classes
-rw-r--r-- 1 root root   47 Dec 22 03:03 config
-rw-r--r-- 1 root root   38 Dec 22 03:05 did
-rw-r--r-- 1 root root   29 Dec 22 03:03 eir
-rw-r--r-- 1 root root   35 Dec 22 03:04 features
-rw-r--r-- 1 root root   42 Dec 22 03:03 lastseen
-rw-r--r-- 1 root root   42 Dec 22 03:05 lastused
-rw------- 1 root root   55 Dec 22 03:05 linkkeys
-rw-r--r-- 1 root root   29 Dec 22 03:04 manufacturers
-rw-r--r-- 1 root root   23 Dec 22 03:04 names
-rw-r--r-- 1 root root  388 Dec 22 03:05 profiles
-rw-r--r-- 1 root root 3424 Dec 22 03:05 sdp
pi@raspberrypi ~ $ 
After having the linkkeys, hfconsole will autonatically pair with my IP4S without asking for the passcode. I can call someone from the hfconsole, but I have not yet tested the voice sending / receiving as my RPI B+ does not have the micro!!!

Moving forward, I need advices from you, the experts and mentors:
- How can we have the hfconsole run properly without applying this manual fix?
- How can I add micro feature to the RPI, hardware and software?

Thanks & best regards,
TuongNguyen

wangjjraspi
Posts: 1
Joined: Wed Jun 08, 2016 6:41 am

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Wed Jun 08, 2016 7:07 am

Hi,
According to your suggestion, i successfully installed the HFP for Linux.But i get some mistakes when i open it .
it shows:
(hfconsole:17119):libglade-WARING **:could not find glade file './hfconsole.glade'
(hfconsole:17119):libglade-WARING **:could not find glade file './data/hfconsole.glade'

At the bottom of UI shows 'Bluetooth Unavailable' and all buttons are gray so i can't use it.
the terminal shows: hpdf: Error connecting to local SDP
Please give me some advice,Thanks

BeckersJ
Posts: 1
Joined: Wed Mar 29, 2017 7:49 pm

Re: HFP for Linux (Bluetooth Handsfree) - can't install

Wed Mar 29, 2017 7:51 pm

Hi,

I have the same issue as wangjjraspi, does anyone have an answer yet?

Thnx for all the help!

Return to “General discussion”