Reading from a Bluetooth device
Petter Adsen
petter at synth.no
Sun Aug 23 10:01:58 UTC 2015
On Sun, 23 Aug 2015 19:15:57 +1000
Phil <phil_lor at bigpond.com> wrote:
> On 23/08/15 17:53, Petter Adsen wrote:
>
> It all worked correctly Petter the first time. I unplugged the arduino
> to see what the range would be and now I cannot get /dev/rfcomm created
> again.
>
> So, at what point should /dev/rfcomm0 be created?
I would assume the device node gets created as soon as the rfcomm
module is loaded and working.
> The first time that I ran this command "bluetooth-agent --adapter hci0"
> a dialog box popped up asking me for the password. This doesn't happen
> now. Maybe the password is only required once?
It could be cached somewhere - I don't really know. Otherwise, it could
mean that it can't contact the device you are trying to connect to, so
it has nothing to authenticate to.
> The returned message
> reads something like device already exists.
Maybe there is already a bluetooth-agent process running that hasn't
terminated. Run 'ps ax | grep bluetooth' to check, and kill it if it is
running.
> The next command is "sudo rfcomm connect 0&". The first time, and only
> time that any of this worked, I had /dev/rfcomm0. Now I don't.
What does 'lsmod | grep rfcomm' say?
> All of this is happening under Kubuntu where I can see that hc-05 is
> paired with my laptop.
What version of Kubuntu are you running? Also, what kernel? ('uname -r')
> Can you think of any reason that this would only work once? Does
> something need to be reset? I wouldn't have thought so.
My suspicion would be that the correct module(s) have not been loaded
for some reason. Run the lsmod command above to see if it is loaded.
Also take a look at /var/log/dmesg for any suspicious messages related
to bluetooth and/or rfcomm.
It could also be that something has just crashed or hung, in which case
a reboot might be the quickest and easiest way to fix it.
As I said earlier, I'm not all that familiar with bluetooth, so these
are just guesses. Maybe someone else has any better ideas.
Petter
--
"I'm ionized"
"Are you sure?"
"I'm positive."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20150823/5b2bc426/attachment.sig>
More information about the ubuntu-users
mailing list