Active Topics

 


Reply
Thread Tools
Posts: 474 | Thanked: 30 times | Joined on Jan 2006
#1
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
 

The Following 2 Users Say Thank You to aleksandyr For This Useful Post:
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#2
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?
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#3
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.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#4
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?
 
Posts: 474 | Thanked: 30 times | Joined on Jan 2006
#5
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's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#6
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.
 
Posts: 474 | Thanked: 30 times | Joined on Jan 2006
#7
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's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#8
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.
 

The Following User Says Thank You to pycage For This Useful Post:
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#9
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's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#10
Originally Posted by aleksandyr View Post
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...)?
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 13:45.