![]() |
BlueSixty: Get Connected with PyS60
hi mæmo users^^
As the thread is called I would know from you, where to get the package "python-serial" for diablo, which is important for my future project to work with serial ports... I registred a project at garage today: b60 ( just waiting for the feedback) The goal of this project is to offer a special module to get connected with the pyS60'S bluetooth console and keep it easy and quickly. I look foreward to see programms of these: http://de.youtube.com/watch?v=JPf5-r7dl5U using the motion-sensor (here of the n95). greeez __________________________________________________ _____________________ | Thread "Python: Serial" renamed as "BlueSixty: Get Connected with PyS60" | |
Re: Python: Serial
Quote:
You need python-serial to connect a real serial port adapter to the tablet in USB host mode. There's no ready-made package that I know of, but python-serial is a pure Python module and can easily copied around. See my earlier post about the subject. |
Re: Python: Serial
python-serial is indeed pure python and works on OS2008. I have used it, and dbus, to connect to my roomba and other projects over bluetooth without much issue. You may want to incorporate turning the bluetooth on and off as well into your project, which can be done over dbus.
download python-serial from the source forge page listed above, use an archive program to unpack the contents, and then just copy the folder from the archive's ./usr/lib/python2.5/site-packages/serial to the same path in your file structure. |
Re: Python: Serial
hvacengi: Do you have the Roomba access code available? I've been wanting to access my Roomba, but was waiting for some time to dig into the BlueZ access.
Thanks. |
Re: Python: Serial
Below is the code I used. You have to know the address of the device you want to connect to, or offer an option to select it. You can have bluez do a search, and/or list the saved paired devices I think. I didn't do it when I wrote this section cause I was just messing around with the concept. I think that if you want to use a pass code you have to have the n8x0 paired with your receiver.
Once you connect, "self.port" acts just like a regular serial port. Reading stream data doesn't work so well (automated every 15ms is a bunch of data and at least in python things seemed to get bogged down some where). But I could send commands and read responses fine. I've used this same trick to talk to my arduino board, my laptop, and a gps receiver, all without any problems (other than remembering to change the bluesmirf's data rate). You might notice that I check to see if the bluetooth adapter is on (trying to use it when it's off throws an exception), and if not I set a bool to true when I turn on the adapter so that I can turn it off again at application close. Good luck with your program, I'd be interested to see anything you come up with. -Brad Code:
self.bus = dbus.SystemBus(); |
Re: Python: Serial
thanks for your posts ;)
I just have asked for this module because a project (niime.com) used this module too.. a module, which uses rfcomm, for python is the main thing for my new project: BlueSixty greeez |
Re: Python: Serial
Very cool! Many thanks.
|
Re: Python: Serial
I thried the rfcomm-server of code.google.com and removed the lines 29 to 35, insert
Code:
client_sock.send("import audio) But my N95 doesn't react. Do you have some solutions? It seems that I'm a little bit helpless in bluetooth-things.. EDIT: Fixed |
All times are GMT. The time now is 19:45. |
vBulletin® Version 3.8.8