WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Bluetooth problem  (Read 7710 times)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #15 on: September 05, 2016, 04:38:23 AM »
I guess you get the connection refused error because you've been unable to pair.

The import error would seem to be some kind of incompatibility between dbus-python/pygobject and glib2 in the tc-5.x repo.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #16 on: September 05, 2016, 05:13:22 AM »
I just burnt an x86 tc-5.4 cd and booted from it.

I can pair with the same bluetooth headphones without any error.

Did you use "tce-load -w bluez dbus-python pygobject" orginially to ensure you got all of the deps (there are quite a few of them)?

(I ask this because you were missing gobject-introspection, which would have been downloaded by the command above)

Offline bukashka

  • Newbie
  • *
  • Posts: 18
Re: Bluetooth problem
« Reply #17 on: September 05, 2016, 06:00:10 AM »
My tce dir contains all needed modules: dbus-python, pygobject, gobject-introspection, bluez and all its deps. My onboot.lst contains dbus-python, pygobject, gobject-introspection, bluez (in same order). Is there not the same as tce-load -w bluez dbus-python pygobject?

Juanito, are you using blueman or just bluez or there is no difference in 5.4?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #18 on: September 05, 2016, 06:28:08 AM »
In tc-5.4  I only used bluez (blueman is not present in the tc 5.x repo).

Since I booted from a cd, I had to download the extensions from scratch and after using the following:
Code: [Select]
$ tce-load -w bluez dbus-python pygobject
$ tce-load -i bluez dbus-python pygobject

..to download and load the extensions I was able to pair without the error message you get.

As mentioned previously, the fact that you did not have gobject-introspection loaded might also mean that you do not have one of the other deps loaded since the two commands above load gobject-introspection automatically.

BTW, your onboot.lst does not need to contain gobject-introspection since it is a dep of pygobject
« Last Edit: September 05, 2016, 06:32:22 AM by Juanito »

Offline bukashka

  • Newbie
  • *
  • Posts: 18
Re: Bluetooth problem
« Reply #19 on: September 05, 2016, 07:58:23 AM »
Juanito, now I comment most extensions in onboot.lst and manually repeat 2 tce-load from your last example. Wheln I try to run "tce-load -i bluez dbus-python pygobject" I get the message: bluez.tcz not found! So I need "tce-load -w bluez" and only after that "tce-load -i bluez dbus-python pygobject" work fine. It seems strange for me.

BTW, is "sudo rfcomm bind /dev/rfcomm0 11:22:33:44:55:66" right command for pairing in TCL? When I do this on ubuntu and after start my app that open rfcomm0 serial port I can exchange with my device. When I repeat the same in TCL I can't. After continous pause I get:
Can't connect RFCOMM socket: Operation now in progress
Thank you for your patience!

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #20 on: September 05, 2016, 09:52:02 AM »
No, I don't think that is the correct command for pairing with bluez-4.x, but I don't know for sure - I suspect ubuntu uses bluez-5.x

Offline bukashka

  • Newbie
  • *
  • Posts: 18
Re: Bluetooth problem
« Reply #21 on: September 05, 2016, 10:30:52 AM »
I am sorry for stupid question) but what the difference between
"tce-load -w bluez dbus-python pygobject
tce-load -i bluez dbus-python pygobject"
and
"tce-load -wi bluez dbus-python pygobject"?

and also is there important the order in "tce-load -w bluez dbus-python pygobject"? Is it the same as "tce-load -w dbus-python pygobject bluez"?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Bluetooth problem
« Reply #22 on: September 05, 2016, 05:05:14 PM »
The order of the extension names doesn't matter.
However,
if you do  tce-load -w ... , it will just download.
If you do  tce-load -i ... , it will just install (if already downloaded).
If you do  tce-load -iw ... , it will download + install, if NOT already downloaded but WON'T install if already downloaded.
The latter one is actually counter intuitive, in my opinion. As much as I would like, I wasn't able to provide a patch for this so far, neither do I know if this is intentional nor where it is actually controlled.
« Last Edit: September 05, 2016, 05:07:19 PM by Misalf »
Download a copy and keep it handy: Core book ;)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #23 on: September 05, 2016, 09:58:05 PM »
I use the tce-load command like that because I can never remember if it's -wi or -wil that adds the extension to onboot.lst.

Note also that, in general, the order of extensions in the tce-load command does not matter. This being said, there are a few extensions whose start-up script depends on commands present in other extensions.

Did you check if ubuntu uses bluez-5.x?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #24 on: September 06, 2016, 01:17:23 AM »
BTW, I went back to the TinyCore-5.4 cd and rebooted to check which extensions get loaded.

Here's the list:
Code: [Select]
$ tce-load -i bluez dbus-python pygobject
sbc.tcz: OK
bluetooth-3.8.13-tinycore.tcz: OK
udev-lib.tcz: OK
libusb.tcz: OK
libffi.tcz: OK
glib2.tcz: OK
expat2.tcz: OK
dbus.tcz: OK
dbus-glib.tcz: OK
bluez.tcz: OK
readline.tcz: OK
ncurses-common.tcz: OK
ncurses.tcz: OK
gdbm.tcz: OK
tcl.tcz: OK
libXss.tcz: OK
fontconfig.tcz: OK
libXft.tcz: OK
tk.tcz: OK
openssl-1.0.0.tcz: OK
bzip2-lib.tcz: OK
sqlite3.tcz: OK
python.tcz: OK
dbus-python.tcz: OK
libpciaccess.tcz: OK
libdrm.tcz: OK
libXxf86vm.tcz: OK
libXfixes.tcz: OK
libXdamage.tcz: OK
libGL.tcz: OK
pixman.tcz: OK
cairo.tcz: OK
pycairo.tcz: OK
gobject-introspection.tcz: OK
pygobject.tcz: OK

I might be good to double-check that you have all of those extensions loaded.

Offline bukashka

  • Newbie
  • *
  • Posts: 18
Re: Bluetooth problem
« Reply #25 on: September 06, 2016, 03:44:25 AM »
Thank you for comments about tce-load rules. Now it is clear for me)
Juanito, I use old ubuntu (10) so version of bluez is 4.60
Now I will try to check my output of "tce-load -i bluez dbus-python pygobject"

Offline bukashka

  • Newbie
  • *
  • Posts: 18
Re: Bluetooth problem
« Reply #26 on: September 06, 2016, 06:08:55 AM »
There is my output
Code: [Select]
sbc.tcz: OK
bluetooth-3.8.13-tinycore.tcz: OK
udev-lib.tcz: OK
libusb.tcz: OK
libffi.tcz: OK
glib2.tcz: OK
expat2.tcz: OK
dbus.tcz: OK
dbus-glib.tcz: OK
bluez.tcz: OK
readline.tcz: OK
ncurses-common.tcz: OK
ncurses.tcz: OK
gdbm.tcz: OK
tcl.tcz: OK
libXss.tcz: OK
/usr/share/fonts: caching, new cache contents: 1 fonts, 0 dirs
/usr/lib/X11/fonts: caching, new cache contents: 0 fonts, 2 dirs
/usr/lib/X11/fonts/75dpi: caching, new cache contents: 48 fonts, 0 dirs
/usr/lib/X11/fonts/misc: caching, new cache contents: 48 fonts, 0 dirs
/usr/local/share/fonts: skipping, no such directory
/usr/local/lib/X11/fonts: skipping, no such directory
/.local/share/fonts: skipping, no such directory
/usr/share/fonts: caching, new cache contents: 1 fonts, 0 dirs
/usr/lib/X11/fonts: caching, new cache contents: 0 fonts, 2 dirs
/usr/local/share/fonts: skipping, no such directory
/usr/local/lib/X11/fonts: skipping, no such directory
/.local/share/fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/.cache/fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
fontconfig.tcz: OK
libXft.tcz: OK
tk.tcz: OK
openssl-1.0.0.tcz: OK
bzip2-lib.tcz: OK
sqlite3.tcz: OK
python.tcz: OK
dbus-python.tcz: OK
libpciaccess.tcz: OK
libdrm.tcz: OK
libXxf86vm.tcz: OK
libXfixes.tcz: OK
libXdamage.tcz: OK
libGL.tcz: OK
pixman.tcz: OK
cairo.tcz: OK
pycairo.tcz: OK
gobject-introspection.tcz: OK
pygobject.tcz: OK

It seems identical except messages about font cache

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #27 on: September 06, 2016, 06:30:18 AM »
I deleted the font cache part  :)

I'm not sure what I can suggest to try next - I don't have a bluetooth serial device to test with, which limits my options.

If your device PIN is set to 1234 permanently, It's a little suprising that "echo "1234" | simple-agent hci0 11:22:33:44:55:66" doesn't work, but maybe this command only works with "dumb" devices like headphones.

Offline bukashka

  • Newbie
  • *
  • Posts: 18
Re: Bluetooth problem
« Reply #28 on: September 06, 2016, 08:43:04 AM »
Juanito, and what did you think about sequence for setup virtual serial port for BT? As I understand pairing (with simple-agent) is the first step in that, or not? And what the next step? If my ubuntu have bluez-4.6 and serial work with
"sudo rfcomm bind /dev/rfcomm0 11:22:33:44:55:66"
Is this step right for TCL too?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14544
Re: Bluetooth problem
« Reply #29 on: September 06, 2016, 10:29:02 AM »
Taking the example of bluetooth headphones, first you have to pair and then set them as an audio sink - you cannot set them as sink without pairing first.

The above being said, I don't have any experience of bluetooth serial ports, so why not try what works on ubuntu and see what happens?