Author Topic: Python-bluez (pybluez)  (Read 9656 times)

normf

  • Newbie
  • *
  • Posts: 3
    • View Profile
Python-bluez (pybluez)
« on: October 13, 2005, 08:11:13 am »
Does anybody know where I might find an *.ipk of the python-bluez module?

Thanks in advance.

Norm
« Last Edit: October 26, 2005, 10:59:30 am by normf »

normf

  • Newbie
  • *
  • Posts: 3
    • View Profile
Python-bluez (pybluez)
« Reply #1 on: October 26, 2005, 07:46:06 am »
My my! The silence is deafening!  

Managed to sort this one out for myself in case anyone else wants to know.

Firstly install zgcc on your Zee. I got mine from Zaurus Onboard Development Tools

Next get Debian Package for Version 0.3 from the Project's homepage.

Upload the Debian package  onto your Zee and use dpkg to unpack it.

cd to the directory created by unpacking the debian package and then cd to the src directory inside it.

run

Code: [Select]
python setup.py install
This will add PyBluez to your site-packages.

Now test it works by plugging in your CF Bluetooth card and running this script.


Code: [Select]
#!/usr/bin/python
# Auth: Albert Huang
# desc: demonstration of how to do asynchronous device discovery by subclassing
#       the DeviceDiscoverer class
# $Id: asynchronous-inquiry.py,v 1.2 2005/04/04 05:02:13 albert Exp $

import bluetooth
import select

class MyDiscoverer(bluetooth.DeviceDiscoverer):

    def pre_inquiry(self):
        self.done = False

    def device_discovered(self, address, device_class, name):
        print "%s - %s" % (address, name)

        # get some information out of the device class and display it.
        # voodoo magic specified at:
        #
        # https://www.bluetooth.org/foundry/assignnumb/document/baseband

        major_classes = ( "Miscellaneous",
                          "Computer",
                          "Phone",
                          "LAN/Network Access point",
                          "Audio/Video",
                          "Peripheral",
                          "Imaging" )
        major_class = (device_class >> 8) & 0xf
        if major_class < 7:
            print "  %s" % major_classes[major_class]
        else:
            print "  Uncategorized"

        print "  services:"
        service_classes = ( (16, "positioning"),
                            (17, "networking"),
                            (18, "rendering"),
                            (19, "capturing"),
                            (20, "object transfer"),
                            (21, "audio"),
                            (22, "telephony"),
                            (23, "information"))

        for bitpos, classname in service_classes:
            if device_class & (1 << (bitpos-1)):
                print "    %s" % classname

    def inquiry_complete(self):
        self.done = True

d = MyDiscoverer()
d.find_devices(lookup_names = True)

readfiles = [ d, ]

while True:
    rfds = select.select( readfiles, [], [] )[0]

    if d in rfds:
        d.process_event()

    if d.done: break

If all is working OK, you should see the output of a scan for all Bluetooth devices in the area.
Code: [Select]
00:02:C7:3C:44:F3 - )Pimp Daddy
  Computer
  services:
    capturing
    audio

Norm

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Python-bluez (pybluez)
« Reply #2 on: May 29, 2006, 03:08:21 pm »
any chance in providing the files?
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

nilch

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • http://
Python-bluez (pybluez)
« Reply #3 on: May 29, 2006, 10:38:26 pm »
Thanks to you for providing this useful addition to the Python repository for the Zaurus.

It would be great to get just the phython-blueZ file by itself so that it can be added to the Kopsis (or the Mickyl) python package by hand.
New no more-C1000 / 5000D (sold my 6000 and 750) | Cacko ROM 1.23 on C1000 | 256 MB CF | 2GB PNY SD card | Socket Networker WiFi CF Card | USB Host cable from StreamlineCPUS | Mini Microphone (for voice recording) |

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Python-bluez (pybluez)
« Reply #4 on: May 30, 2006, 02:19:57 am »
cant seem to get it compiled with meanies cramfs of gcc, keeps giving an error and exit code 1...
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

Serge_RUS

  • Newbie
  • *
  • Posts: 2
    • View Profile
Python-bluez (pybluez)
« Reply #5 on: August 16, 2006, 08:31:06 am »
Where can I get complete python-bluez for Z?

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Python-bluez (pybluez)
« Reply #6 on: August 16, 2006, 03:07:57 pm »
I did get it to compile, although I am not sure if it works fully, may be limited in functionality. Basically couldnt get some of the examples to work. Maybe I should try compiling 0.3 instead of 0.5 or was that 0.6?
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

Serge_RUS

  • Newbie
  • *
  • Posts: 2
    • View Profile
Python-bluez (pybluez)
« Reply #7 on: August 16, 2006, 03:23:27 pm »
You see than you do.
I m kettle in this work.
PLease, when you will complete your work with pybluez, put them in this topic. Okay?

Sorry for my bad English .