Tiny Core Linux
		Tiny Core Extensions => TCE News => TCE 2.x => Topic started by: Juanito on April 15, 2010, 08:54:34 AM
		
			
			- 
				the first pass at a blueman extension - something of a work in progress, but it may make bluetooth more "accessible": Title:          blueman.tcz
 Description:    gtk2 bluetooth manager
 Version:        1.21
 Author:         see list of sites below
 Original-site:  see list of sites below
 Copying-policy: see list of sites below
 Size: 544KB
 Extension_by:   juanito
 Comments:       gtk2 bluetooth manager designed to be simple and intuitive for everyday bluetooth tasks
 ----------
 Howto:
 $ sudo /usr/local/etc/init.d/bluez start
 use blueman to manage bluetooth connections
 ----------
 optionally can be used with hicolor-icon-theme
 ----------
 This extension contains:
 blueman-1.21 - GPLv3 - http://download.tuxfamily.org/blueman/blueman-1.21.tar.gz
 ----------
 Change-log:     first version
 Current:        2010/04/11
 
- 
				Juanito,
 
 for me don work blueman, it brings this error:
 tc@box:~$ blueman-manager
 Loading configuration plugins
 _________
 <module> (/usr/local/lib/python2.6/site-packages/blueman/main/Config.py:20)
 Skipping plugin Gconf
 No module named gconf
 Skipping plugin file
 org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-la205Wlnyl: Connection refused
 No suitable configuration backend found, exitting
 Exception AttributeError: "'File' object has no attribute 'Monitor'" in <bound method File.__del__ of <File object at 0x86c94b4 (blueman+plugins+ConfigPlugin+ConfigPlugin at 0x8626840)>> ignored
 _________
 save (/usr/local/lib/python2.6/site-packages/blueman/plugins/config/File.py:117)
 Saving config
 
 
 despite that Gconf extension is loaded and is not in the dep file
 
 My process is load blueman extension and his deps
 then I execute a script:
 #!/bin/sh
 # activacion de Bluetooth
 
 sudo modprobe bluetooth
 sudo modprobe hci_usb
 sudo modprobe l2cap
 sudo modprobe rfcomm
 sudo modprobe bnep
 sudo modprobe sco
 sudo mkdir -p /var/lib/dbus
 sudo dbus-uuidgen --ensure
 sudo mkdir /var/run/dbus
 sudo dbus-daemon --system
 sudo mkdir /etc/dbus-1
 sudo mkdir /etc/dbus-1/session.d
 sudo bluetoothd
 sudo /usr/local/etc/init.d/bluez start
 
 
 the modules loaded are:
 tc@box:~$ lsmod
 Module                  Size  Used by    Not tainted
 btusb                   5876  3
 sco                     4228  2
 bnep                    5768  4
 rfcomm                 18376  4
 l2cap                  11332 18 bnep,rfcomm
 bluetooth              27048 13 btusb,sco,bnep,rfcomm,l2cap
 i915                  101560  2
 drm                    84616  3 i915
 i2c_algo_bit            2956  1 i915
 ipv6                  148040 10
 ipt_REJECT              1268  1
 xt_state                 620  1
 ipt_LOG                 3100  0
 nf_conntrack_ftp        3664  0
 iptable_nat             1928  0
 etc...
 
 
 Am I making something wrong?
 
 I tried also to do after it paired through bluez-gnome and still giving the same error.
 
 
- 
				Assuming you're using tc/mc-2.10 (I'm not sure if this makes a difference, but it might due to udev changes), and the latest bluez extension then this works for me:
 
 1. Load blueman using appbrowser (i.e. all the recursive deps load)
 2. "sudo /usr/local/etc/init.d/bluez start"
 
 On my system, when the bluetooth module extension is loaded, the bt and btusb modules load automatically and starting bluez loads the rest of the bt modules
 
 3. Start blueman using the icon or menu item
 
 Note that blueman was not compiled against GConf, although "python-gconf" is listed as a "run-time dependency" - I supose this implies using GConf and gnome-python, but blueman works for me without these extensions.
 
 I have seen the error of the form "Failed to connect to socket /tmp/dbus-la205Wlnyl: Connection refused". I no longer see this, but it could be cured by with starting blueman using "dbus-launch blueman &" or by issuing "sudo /usr/local/etc/init.d/bluez start" prior to "startx".
 
 I don't believe you'll need your script if you follow the three steps above - let me know how you get on
- 
				I'm getting the same error, using the steps you outlined.
			
- 
				What permissions are on ~/.dbus and it's subdirectories? Maybe: $ sudo chown -R tc:staff  ~/.dbus..will help?
- 
				I got this:
 tc@box:~$ sudo chown -R tc:staff  ~/.dbus
 tc@box:~$ blueman-manager
 Loading configuration plugins
 _________
 <module> (/usr/local/lib/python2.6/site-packages/blueman/main/Config.py:20)
 Skipping plugin Gconf
 No module named gconf
 Using file config backend
 Traceback (most recent call last):
 File "/usr/local/bin/blueman-manager", line 296, in <module>
 Blueman()
 File "/usr/local/bin/blueman-manager", line 178, in __init__
 dbus.SystemBus().watch_name_owner('org.bluez', on_bluez_name_owner_changed)
 File "/usr/local/lib/python2.6/site-packages/dbus/_dbus.py", line 202, in __new__
 private=private)
 File "/usr/local/lib/python2.6/site-packages/dbus/_dbus.py", line 108, in __new__
 bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
 File "/usr/local/lib/python2.6/site-packages/dbus/bus.py", line 125, in __new__
 bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
 dbus.exceptions.DBu.ception: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
 _________
 save (/usr/local/lib/python2.6/site-packages/blueman/plugins/config/File.py:117)
 Saving config
 Exception AttributeError: "'NoneType' object has no attribute 'Bus'" in <bound method File.__del__ of <File object at 0x8d8d464 (blueman+plugins+ConfigPlugin+ConfigPlugin at 0x8b6d040)>> ignored
 
 
- 
				Hmm - there's obviously something I've missed here, but when I try: $ lsusb | grep Bluetooth
 Bus 002 Device 004: ID 413c:8140 Dell Computer Corp. Wireless 360 Bluetooth
 
 $ tce-load -i /mnt/sda1/tmp/blueman/blueman.tcz
 libxcb.tcz: OK
 libxcb-util.tcz: OK
 libstartup-notification.tcz: OK
 Xlibs_support.tcz: OK
 libxml2.tcz: OK
 glib2.tcz: OK
 pango.tcz: OK
 graphics-libs-1.tcz: OK
 expat2.tcz: OK
 fontconfig.tcz: OK
 pixman.tcz: OK
 cairo.tcz: OK
 atk.tcz: OK
 gtk2.tcz: OK
 bzip2-lib.tcz: OK
 tcl_tk.tcz: OK
 mkdir: cannot create directory '/usr/local/etc/ssl/private': File exists
 mkdir: cannot create directory '/usr/local/etc/ssl/certs': File exists
 openssl-0.9.8.tcz: OK
 sqlite3.tcz: OK
 python.tcz: OK
 pycairo.tcz: OK
 libffi.tcz: OK
 pygobject.tcz: OK
 pygtk.tcz: OK
 dbus.tcz: OK
 dbus-glib.tcz: OK
 libnotify.tcz: OK
 notify-python.tcz: OK
 dbus-python.tcz: OK
 bt-2.6.29.1-tinycore.tcz: OK
 libusb.tcz: OK
 bluez.tcz: OK
 blueman.tcz: OK
 
 $ lsmod
 Module                  Size  Used by    Not tainted
 btusb                   5876  0
 bluetooth              27048  1 btusb
 
 $ sudo /usr/local/etc/init.d/bluez start
 no /usr/local/bin/dbus-daemon found; none killed
 rm: cannot remove '/var/run/dbus/pid': No such file or directory
 
 $ lsmod
 Module                  Size  Used by    Not tainted
 rfcomm                 18376  4
 sco                     4228  2
 bnep                    5768  2
 l2cap                  11332 16 rfcomm,bnep
 btusb                   5876  2
 bluetooth              27048  9 rfcomm,sco,bnep,l2cap,btusb
 
 $ ps aux | grep dbus
 1820 tc       /usr/local/bin/dbus-daemon --system
 
 $ dmesg
 ...
 Bluetooth: Core ver 2.14
 NET: Registered protocol family 31
 Bluetooth: HCI device and connection manager initialized
 Bluetooth: HCI socket layer initialized
 Bluetooth: Generic Bluetooth USB driver ver 0.4
 usbcore: registered new interface driver btusb
 intel_rng: FWH not detected
 Bluetooth: L2CAP ver 2.11
 Bluetooth: L2CAP socket layer initialized
 Bluetooth: BNEP (Ethernet Emulation) ver 1.3
 Bluetooth: BNEP filters: protocol multicast
 Bluetooth: SCO (Voice Link) ver 0.6
 Bluetooth: SCO socket layer initialized
 Bluetooth: RFCOMM socket layer initialized
 Bluetooth: RFCOMM TTY layer initialized
 Bluetooth: RFCOMM ver 1.10
 
 $ blueman-manager &
 tc@box:~$ Xlib:  extension "Generic Event Extension" missing on display ":0.0".
 Xlib:  extension "Generic Event Extension" missing on display ":0.0".
 Xlib:  extension "Generic Event Extension" missing on display ":0.0".
 Loading configuration plugins
 Using file config backend
 Using file config backend
 /usr/local/lib/python2.6/site-packages/blueman/gui/manager/ManagerToolbar.py:46: GtkWarning: Could not find the icon 'blueman-trust'. The 'hicolor' theme
 was not found either, perhaps you need to install it.
 You can get a copy from:
 http://icon-theme.freedesktop.org/releases
 size = self.b_trust.size_request()
 [and blueman window appears]
 
 $ ps aux | grep dbus
 1820 tc       /usr/local/bin/dbus-daemon --system
 1862 tc       /usr/local/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
 1863 tc       dbus-launch --autolaunch c51ff84d8bb3e5f3ae77fcc74bc87490 --binary-syntax --close-stderr
 blueman window attached showing the laptop paired with bluetooth headphones
- 
				OK, I removed the bluez-gnome from onboot, rebooted and went through the steps above. Now it works - great and thank you!  :) I can only guess it had something to do with sequencing, the fact that I had bluez-gnome already started from .xsession.
 
 edit: I was able to pair my phone and the GPS pod.
- 
				yes my tc is 2.10.
 
 I have prove with base no restore and it works!, perhaps I have to actualize my extensions in /optional
 
 In this condition (base no restore) when I want to browse my PPC it says that it can't find Nautilus as browser and that I can change it in the setup services, but in the device setup in blueman don't ask about the browser. What to do?
 
 Thanks.
 
- 
				I have prove with base no restore and it works!, perhaps I have to actualize my extensions in /optional
 
 good  :)
 
 In this condition (base no restore) when I want to browse my PPC it says that it can't find Nautilus as browser and that I can change it in the setup services, but in the device setup in blueman don't ask about the browser. What to do?
 
 short answer, I don't know...
 
 I haven't got this far yet, let me have a look and see if there's a way to switch this to emelfm or similar
- 
				I see the same browse error.
 
 Blueman has obex-data-server as a run-time dep, but after compiling this, I still cannot browse the phone - it looks to be some kind of dbus or perhaps permissions error.
 
 I tried linking nautilus -> emelfm, so emelfm is launched by blueman's browse, but I cannot browse the phone due to the obex-data-server error.
 
 In the meantime, if you want to browse the phone, you can use the obex extension and:$ obexftp -l
 Scanning for (null) ...
 Found: 34:7E:39:AE:69:98
 Browsing 34:7E:39:AE:69:98 ...
 Connecting..\done
 Receiving "(null)".../<?xml version="1.0"?>
 <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"
 [ <!ATTLIST folder mem-type CDATA #IMPLIED> ]>
 <folder-listing version="1.0">
 <folder name="NO NAME" user-perm="RW" mem-type="MMC"/>
 <folder name="Tones" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 <folder name="Graphics" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 <folder name="Music files" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 <folder name="Themes" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 <folder name="Video clips" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 <folder name="Images" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 <folder name="Recordings" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 <folder name="Received files" created="20070101T000000" user-perm="R" mem-type="DEV"/>
 </folder-listing>
 done
 Disconnecting..-done
 
 ..or:$ sudo mkdir /mnt/phone
 $ sudo obexfs -b 34:7E:39:AE:69:98 /mnt/phone
 $ sudo ls /mnt/phone
 Graphics        Music files     Received files  Themes          Video clips
 Images          NO NAME         Recordings      Tones
 
- 
				In the meantime, if you want to browse the phone, you can use the obex extension and: 
 
 
 yes that is what I normally do, after paired with blue-gnome I exec this script:
 
 #!/bin/sh
 # montar emparejamiento
 # bluetooth2-nav
 
 if [ "$1" == "" ]; then
 echo ""
 echo " especificar el MAC del aparato, por ej. 00:xx:xx:xx:xx:xx"
 else
 sudo mkdir /mnt/pda
 sudo obexfs -b $1  /mnt/pda
 sudo ls /mnt/pda
 echo "usar en este momento emelfm en version root para acceder a los ficheros"
 fi
 
 
 in the form:
 tc@box:~$ ./bluetooth2-nav 00:AA:BB:CC:DD:EE
 
 
 and then surf with emelfm2 as root
 
 but if it is possible to do all the connection and surf with blueman I prefer it because is more easy and quickly.  :D
 
 
- 
				I have things running OK-ish now... still the success depends on what I load when (this is my own ondemand script)
 
 
 #!/bin/sh
 TCE_DIR=`cat /opt/.tce_dir`
 THIS_APP="blueman"
 [ ! -f "$TCE_DIR"/optional/"$THIS_APP".tcz ] && tce-load -i -w "$THIS_APP"
 [ ! -f /usr/local/tce.installed/"$THIS_APP" ] && tce-load -i "$TCE_DIR"/optional/"$THIS_APP"
 [ ! -f "$TCE_DIR"/optional/rox-filer.tcz ] && tce-load -i -w rox-filer
 [ ! -f /usr/local/tce.installed/rox-filer ] && tce-load -i "$TCE_DIR"/optional/rox-filer.tcz
 sudo /usr/local/etc/init.d/bluez start
 sleep 1 && [ ! -f /usr/local/tce.installed/obex ] && tce-load -i "$TCE_DIR"/optional/obex.tcz
 sleep 1 && blueman-manager
 [  ! -d /mnt/pda ] && sudo mkdir /mnt/pda
 sudo obexfs -b 00:24:7C:31:DD:29  /mnt/pda &
 sleep 2 && sudo rox /mnt/pda
 
 
- 
				I played around with this some more - maybe this will help:
 
 1. Boot with the "text" bootcode.
 2. load the blueman extension and deps
 3. "sudo /usr/local/etc/init.d/bluez start"
 4. Modify .xsession as follows:...
 [ -x ./.setbackground ] && ./.setbackground
 dbus-launch --sh-syntax --exit-with-session
 [ "$ICONS" == "wbar" ] && /usr/bin/wbar.sh
 ...
5. "startx"
 
 This seems to have the effect that apps like blueman, rhythmbox, obex-data-server manage to communicate with each other without dbus errors.
 
 I doubt this will work (and I won't have a suitable device to test it for for several days), but you could try making a symlink nautilus -> emelfm (or your chosen file manager, it may need to be dbus "aware"), loading obex-data-server, and trying the "browse" function in blueman.
 
 I'm still on the trail of changing the default blueman browser from nautilus - I suspect this will involve loading GConf and friends and extensive use of "grep"  :(
- 
				I am using rox with success to browse and do stuff on the phone.
 
 I found this at the blueman forums - a quit menu item for the tray applet:
 blueman-project.org/forum/viewtopic.php?f=5&t=282 (http://blueman-project.org/forum/viewtopic.php?f=5&t=282)
 
 I wonder if you would consider adding this to the build. I found it very handy.
- 
				Since I use flwm classic, there's no tray-applet to worry about  ;)
 
 ..but sure, I'll add it once I've finished testing a few other things.
 
 Did you try rox via blueman browse?
- 
				Nope, just via the previously posted script. I'll play a bit with the browse plugin and see...
 
 I have also been snooping around about blueman saving paired devices for next session... but so far nothing. I suppose the rfcomm.conf is the place to spec this sort of thing.
- 
				updated extension posted: Title:          blueman.tcz
 Description:    bluetooth manager
 Version:        1.21
 Author:         see list of sites below
 Original-site:  see list of sites below
 Copying-policy: see list of sites below
 Size: 544KB
 Extension_by:   juanito
 Comments:       gtk2 bluetooth manager
 ----------
 Howto:
 $ sudo /usr/local/etc/init.d/bluez start
 add "dbus-launch --sh-syntax --exit-with-session" to .xsession
 $ startx
 use blueman to manage bluetooth connections
 ----------
 optionally can be used with hicolor-icon-theme
 optionally can be used with GConf
 ----------
 This extension contains:
 blueman-1.21 - GPLv3 - http://download.tuxfamily.org/blueman/blueman-1.21.tar.gz
 ----------
 Change-log:     2010/04/11
 added exit plugin and .desktop
 Current:        2010/04/20