Wednesday, 12 December 2012

Perl Net::Bluetooth on Raspberry Pi

I wanted to use Perl to communicate via Bluetooth on my Raspberry Pi and a key module for that is Net::Bluetooth.

So I downloaded CPAN and attempted to install Net::Bluetooth from the prompt. It failed on the make part and suggested I download and install manually. This site is excellent for a walk through on how to install manually:

http://www.thegeekstuff.com/2008/09/how-to-install-perl-modules-manually-and-using-cpan-command/

Following these instructions also failed, with the install failing to find:

bluetooth/bluetooth.h

I tried everything to get this to work - even down to finding a 2011 version of Net::Bluetooth and trying that. In the end, it was an obscure post that suggested installing libc6-dev which you can do with apt-get install.  I don't know what this install does but it seems to deal with header files in some way.

Anyway, CPAN still would not install Net::Bluetooth, but when I tried manually installing again it worked. I wish I still had the URL of the post that helped me, but I couldn't find it again.

By the way, I suspect there may be something else up with my CPAN install on the Pi since it fails to install quite a lot of stuff so do try it first with CPAN because then you get all the dependencies as well whereas a manual install will mean that you have to also install the dependencies yourself.

No comments:

Post a Comment