maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Request for comment: Full BT PAN support (https://talk.maemo.org/showthread.php?t=15858)

aleksandyr 2008-01-29 09:03

Request for comment: Full BT PAN support
 
So after some digging, it seems like it's possible to do the following:

Thanks to fanoush, starting/stopping BTPAN can be put in to a script.
http://www.internettablettalk.com/fo...ad.php?t=12666
(a few quick mods get you DHCP autoconf.)


Named dummy IAPs work fine in OS2008 to allow BTPAN-based connectivity.
Try: gconftool -s -t string /system/osso/connectivity/IAP/Bluetooth-PAN/type DUMMY

python-conic would make it very easy to monitor connection events, such as connecting to a particular named IAP, and disconnecting.
The phone's MAC address is stored in GConf.
See: https://garage.maemo.org/svn/pymaemo...c/trunk/tests/ for the elusive python-conic examples :)

Getting the phone's BT address is a matter of:
gconftool -g /system/osso/connectivity/BT/preferred


Putting this all together, it shouldn't be too hard to put together a python script that, assuming it gets run at startup, lets you use a Bluetooth-PAN connection just like any other.

The monitor would need to do the following:
Conic events:
Connect - if name matches Bluetooth-PAN, connect. Fire DBUS popups to report connection status. If BTPAN connection fails, call a disconnect.
Disconnect - if we're connected, attempt to disconnect from BTPAN.

I'm not going to touch the issues around loss of signal to the phone.

I'll try to get some reference scripts together when it's not 1AM :)

pycage 2008-01-29 09:37

Re: Request for comment: Full BT PAN support
 
I'm very much interested in this. Could be a fun project to get this working. I'm good at Python, so I want to help here!

Why not register a project at garage.maemo.org and get it working? :)

fanoush 2008-01-29 10:00

Re: Request for comment: Full BT PAN support
 
Yes, that could work :-) I'm a bit against python being launched at startup and running all the time due to RAM consumption but it is really your choice. Without python it is not such fun.

But still working prototype in python would be good. For OS2008 it can be later rewritten in Vala which is not much harder than python and would be better fit for daemon launched at startup and running all the time. See http://live.gnome.org/Vala/BlueZSample, using d-bus is not that hard in Vala.

Also someone already automated this before with dbus-scripts
http://www.internettablettalk.com/fo...3834#post53834 so you even don't need to write such daemon listening for IAP events.

pycage 2008-01-29 10:27

Re: Request for comment: Full BT PAN support
 
If there are no objections, I'm gonna register a project at garage.maemo.org for this, then we'll also have a mailing list.
Any ideas for the project name? btpan?

aleksandyr 2008-01-29 17:45

Re: Request for comment: Full BT PAN support
 
Well, it's a BT PAN daemon for libconic. Later on it could be adapted for all sorts of things conic doesn't support.

I go straight to Python because it's so easy to put things like this together :) not too worried about memory/CPU since we'll spend 99% of our time sleeping.

What we could do instead is use that dbus-script and just write a quick C app that calls disconnect on PAN negotiation failure. The rest could be shell scripted.

...really, I just want a better ifupd :)

pycage 2008-01-29 19:04

Re: Request for comment: Full BT PAN support
 
I just registered a new project on garage.maemo.org. If it passes approval the project page should be up tomorrow. Look for project "PAN for Maemo", unix name "maemo-pan".

I suggest we first draw together some code snippets for fulfilling the various tasks needed for easy PAN.

aleksandyr 2008-01-29 21:22

Re: Request for comment: Full BT PAN support
 
Well, the python conic example, at least the monitor one, doesn't actually work on my N810. Back to some sort of drawing board, I imagine...

pycage 2008-01-30 08:52

Re: Request for comment: Full BT PAN support
 
The project has been approved. The page is at https://garage.maemo.org/projects/maemo-pan
The mailing-list should be available within the next 24 hours.

I haven't tested the conic example code yet. But I will take a close look at it.

pycage 2008-02-01 13:07

Re: Request for comment: Full BT PAN support
 
Monitoring connections with libconic worked fine on my N810 when I tried it. Maybe you had something wrong.

Btw, there is now a mailing list for the project. Please go to https://garage.maemo.org/mailman/lis...aemo-pan-devel
to subscribe. I suggest that further discussions should take place there, so that they won't get lost in the forum.

Benson 2008-02-01 14:02

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by aleksandyr (Post 135295)
not too worried about memory/CPU since we'll spend 99% of our time sleeping.

I think that was Fanoush's point: it spends 99% of its time asleep. So you're using the whole wonderful chunk of memory, for no gain 99% of the time. 128 MiB is not that much; even with swap (256 MiB total), one still should be careful with memory consumption.

Fanoush: Never heard of vala before. Looked, and it looks like it's a "high-level o-o language" implemented as a preprocessor to C. Where have I seen that before (and didn't like it then, either...)?

fanoush 2008-02-01 15:58

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by Benson (Post 136583)
Looked, and it looks like it's a "high-level o-o language" implemented as a preprocessor to C. Where have I seen that before (and didn't like it then, either...)?

Don't know :-) I've seen some C++ to C translators before in times when writing direct c++ compiler from scratch was considered to be too much work. Also the moc compiler in QT is in some way similar but otherwise quite different.

Vala is layer that finally allows me to start coding for GTK and stay sane. If you look at current code written in C for GTK, D-bus etc, it already looks like autogenerated from some high level oo language like Vala :-) I don't believe anyone would type it all by hand. Certainly not me in my spare time and for free :-) Vala is specific to glib gobject system that needs to be used anyway so one can just save himself the pain and still get same result. Or at least that's the theory. The other alternatives like Python, Mono, Java all come with some price.

BTW, to stay on topic, here is another attempt to solve the PAN issue
http://tabletoid.blogspot.com/2008/0...onnection.html

aleksandyr 2008-02-02 15:18

Re: Request for comment: Full BT PAN support
 
Hrm. I'm willing to accept failure with libconic, but I didn't change the monitor example script at all :)

Nice link fanoush!

http://tabletoid.blogspot.com/2008/0...onnection.html is more than enough info for me to spin up a deb that binds in DHCP and automatic phone linking. Disconnect won't be as smart as I'd like, but that can wait until Nokia throws real cycles at the problem :)

aleksandyr 2008-02-02 15:50

Re: Request for comment: Full BT PAN support
 
1 Attachment(s)
Here's my first shot at debian integration.

Step one is to install dbus-scripts:
http://repository.maemo.org/extras-d...cripts.install

Step two, install the package.

Step three is to make sure your phone with PAN is set as your phone.

Step four, connect to the BT-PAN IAP.

Step five ought to be profit :)

I don't have any suitable hardware for this one, but a friend in the area does, so this ought to be final soon: however, it really ought to work as is :)

14limes 2008-02-03 01:56

Re: Request for comment: Full BT PAN support
 
aleksandyr, I tried your .deb file, and it installed properly on my N810, but didn't solve it for me. For one thing, it didn't create a BT-PAN IAP, and when I set up a dummy IAP, I still had no success. But I'll keep watching the garage project, and hope you arrive at a solution. Thanks!

pycage 2008-02-04 12:51

Re: Request for comment: Full BT PAN support
 
I want to make this an all-in-one .deb which also creates the IAP for you. Suggestions are welcome on the garage project page.

aleksandyr 2008-02-05 08:25

Re: Request for comment: Full BT PAN support
 
In theory, the post-install script will create the IAP for you, put the scripts in the proper places, and start them.

In practice, it appears I've screwed up my package and will have to figure out why it's working on my device, and not for everyone else. :)

pycage 2008-02-05 08:41

Re: Request for comment: Full BT PAN support
 
aleksandyr, I could put you on the members list for maemo-pan. Then you can upload your stuff to SVN and we can use this as a basis for further improvements.

pycage 2008-02-26 21:52

Re: Request for comment: Full BT PAN support
 
Here we go... http://garage.maemo.org/projects/maemo-pan

Thanks to aleksandyr for collecting information and to fanoush for hacking the initial PAN shell script!
maemo-pan doesn't have any dependencies except OS 2008. It consists of a very lightweight daemon written in C and a shell script for starting / stopping PAN.

fpp 2008-02-26 22:33

Re: Request for comment: Full BT PAN support
 
Can/should this also be used for networking between tablet & PC over BT ?

pycage 2008-02-26 22:43

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by fpp (Post 148246)
Can/should this also be used for networking between tablet & PC over BT ?

Not yet but this is planned for the future.

speculatrix 2008-02-26 22:53

Re: Request for comment: Full BT PAN support
 
that tabletoid posting worked perfectly for me!

wishlist:
* use dhcpcd on the tablet
* have the MAC and NAME of the PAN server in a separate file so that it can be configured more easily, with a helper app to add and switch servers? or, add multiple entries to the connection list
* make the wireless aerial symbol in the task bar active when PAN active?

thanks very much for all the hard work so far!
Paul

saklotz 2008-02-27 06:41

Re: Request for comment: Full BT PAN support
 
I too have been following the threads discussing the BT PAN on N800/N810. I was truly impressed with the .deb posted on garage.maemo by pycage. After download, Application Manager installed it in a flash. Then making my connection to the AT&T Blackjack 1, with Media Net service, was effortless. I had previously set up the phone to "Internet Share" as discussed by nilchak in this thread http://www.internettablettalk.com/fo...ad.php?t=12666. He used a script file that was originally developed by fanoush. I was just about ready to install this script file on my N800 when pycage posted the .deb - PAN for Maemo.

This BT PAN connection through the Blackjack works very well. I believe it is even faster browsing the Internet than with the Windows Mobile Internet Explorer that comes as part of WM6. At least on this phone. This .deb will be supremely useful to all who own a Windows Mobile WM5/WM6 based phone and the Nokia N800 or N810.

Many thanks for their fantastic programming skills goes out to fanoush, nilchak, aleksandyr and pycage. I love those names! :)

Cheers!

Steve

sherifnix 2008-02-27 14:04

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by pycage (Post 148251)
Not yet but this is planned for the future.

Oh that would be great! I have a vista machine I'd like to pull internet from without broadcasting a wifi network.

jpcoder 2008-02-27 19:29

Re: Request for comment: Full BT PAN support
 
I would love to use this new PAN support with my 8125 with WM 6 but after I install the PAN deb it never recognizes my phone. I have the phone paired in the bluetooth settings but when I go to connect to it it says no phone found. Are you supposed to be able to pick your phone in the Phone settings on the N800? I could never get this to find my phone either although I was able to pair going through the Bluetooth settings. Any ideas?

Thanks...

tso 2008-02-27 20:35

Re: Request for comment: Full BT PAN support
 
after you have the phone paired you just pick bluetooth-pan on the connectons list iirc. works with my SE Z710 (but thats not a winmo so...), but i have seen someone else report the same issue with a advantage...

jpcoder 2008-02-27 21:09

Re: Request for comment: Full BT PAN support
 
Thanks tso. After I paired I turned internet sharing on on my phone and then picked bluetooth-pan on my N800 but it could never find the phone. My 8125 is using an aftermarket rom (or however you want to say that) so maybe that has something to do with it. Do you know where you saw the other report?

Thanks...

tso 2008-02-27 21:21

Re: Request for comment: Full BT PAN support
 
comment 2 here:
http://jkontherun.blogs.com/jkonther....html#comments

sadly its not much of a report...

nilchak 2008-02-28 20:56

Re: Request for comment: Full BT PAN support
 
This is great to ove a one install file for PAN support.

Unfortunately when I tried installing the .deb (from the garage page) file on my N810 - I am getting an install error.

Unable to install maemo-pan
Application packages missing : libbluetooth2 (=3.20-0osso1)
bluez-utils (=3.20-0osso2)

I am not able to locate the bluez packages ...

tso 2008-02-28 21:03

Re: Request for comment: Full BT PAN support
 
http://gronmayer.com/it/index.php

pycage 2008-02-29 08:13

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by nilchak (Post 149165)
This is great to ove a one install file for PAN support.

Unfortunately when I tried installing the .deb (from the garage page) file on my N810 - I am getting an install error.

Unable to install maemo-pan
Application packages missing : libbluetooth2 (=3.20-0osso1)
bluez-utils (=3.20-0osso2)

I am not able to locate the bluez packages ...

This looks like you need a more recent version of OS 2008. bluez-utils is part of the OS.

nilchak 2008-02-29 23:12

Re: Request for comment: Full BT PAN support
 
Ah Dang, there goes my happiness :-)
I hate having to reinstall everything again (I know I can do a restore from the backup, but wasn't there a thread where somehow the restore from previous OS 2008 backup screwed up a few things ?)

But again I stand to gain quite a few updates too - particularly the updated Skype, which I can't install because of the old OS2008.

Thanks PyCage for your pointer. I will be glad to use ths BT PAN setup rather then run my scripts by hand each time.

Linear2202 2008-02-29 23:44

Re: Request for comment: Full BT PAN support
 
I just wanted to give a quick thanks for the work on this. I've installed it and have a working connection with my WM 8525. The 810 just went up to a new level of usefulness for me.

Much appreciated.

nate the great 2008-03-02 01:52

Re: Request for comment: Full BT PAN support
 
So will this let me do PAN server, or just client? If I can do server, then that would be enough to get me to upgrade my N800 to OS2008

aleksandyr 2008-03-03 07:49

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by nate the great (Post 150004)
So will this let me do PAN server, or just client? If I can do server, then that would be enough to get me to upgrade my N800 to OS2008

Short answer:
http://wiki.bluez.org/wiki/Network

Long answer:
Yes, although I'm not yet sure how. :)

Noger 2008-03-03 14:48

Re: Request for comment: Full BT PAN support
 
Just tracked this down, having instaled it a few days ago. Many thanks to all involved.

It was a breeze setting up the PAN connection with an HTC TYTN II. DUN sort of worked, but messed up the internet connection on disconnect and was pretty flaky particularly if a call came in. It now just needs a quick click on the phone to enable Internet Sharing, and away I go. Really makes my N800 usable everywhere ow.

Although I may have discovered a slight feature, in that if are already connected and then try to connect again to the BT Pan the device resets itself. Not a huge problem, I won't do it twice !

Thanks again :)

rwijnhov 2008-03-06 19:58

Re: Request for comment: Full BT PAN support
 
Unfortunately my tablet sees my phone as pda thus this solution is not working for me. Is there any way to let the n810 thing that my samsung i780 is a phone instead off pda?

rwijnhov 2008-03-10 15:14

Re: Request for comment: Full BT PAN support
 
No one that can help me?

bhang 2008-03-10 16:05

Re: Request for comment: Full BT PAN support
 
Is there an connection "icon" (ie: wifi,packet) Im using the beautiful LCARS theme so Im not sure if its lacking in my theme or in general, I am in love with the bt pan, My only question is does it drain the battery like the "stock" bluetooth connection, I've been disconnecting it as soon as I'm done 1. because I don't want to kill my battery 2. the lack of a notification icon.

bhang

aleksandyr 2008-03-10 18:30

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by rwijnhov (Post 153013)
No one that can help me?

It's a rare problem and can be fixed by direct script editing.

Neither of those bits help you, so I was going to wait until I had a real solution, instead ;)

aleksandyr 2008-03-10 18:32

Re: Request for comment: Full BT PAN support
 
Quote:

Originally Posted by bhang (Post 153033)
Is there an connection "icon" (ie: wifi,packet) Im using the beautiful LCARS theme so Im not sure if its lacking in my theme or in general, I am in love with the bt pan, My only question is does it drain the battery like the "stock" bluetooth connection, I've been disconnecting it as soon as I'm done 1. because I don't want to kill my battery 2. the lack of a notification icon.

bhang

It drains the battery like any bluetooth connection, although it should be somewhat less of a drain on idle than DUN (the "stock" connection type).

Doesn't it show up as if you were connected to WiFi?


All times are GMT. The time now is 16:56.

vBulletin® Version 3.8.8