maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Bluetooth-PAN in Diablo (https://talk.maemo.org/showthread.php?t=21263)

Bundyo 2008-06-27 04:56

Re: Bluetooth-PAN in Diablo
 
Nope, i meant ad-hoc :) I'm pairing to a computer.

I really have a ppc, but i'm using DUN for it :D

fanoush 2008-06-27 06:53

Re: Bluetooth-PAN in Diablo
 
Quote:

Originally Posted by Benson (Post 196361)
Ah, OK; I thought it was a reference to setting up an ad-hoc connection (to nothing) so the browser etc. knew there was an internet connection.

(As far as I know, PAN probably works; the problem seems to be only with the dummy connection; switching to links2 might make it work... I haven't had the opportunity to try that stuff out yet, but that was the case with USB-ethernet on pseuDiablo.)

Yes this was a workaround when they broke DUMMY connections last time (in OS2007). It was possible to setup ad-hoc connection and bring the wi-fi interface down in PAN setup script so there was no battery drain. See http://www.internettablettalk.com/fo...2174#post52174

meizirkki 2008-06-27 15:22

Re: Bluetooth-PAN in Diablo
 
Ok, if it works, can you tell me (and other beginners) how to easily do it, i have already set up my pc and in chinook i used maemo-pan to connect.

andreww 2008-06-27 16:58

Re: Bluetooth-PAN in Diablo
 
I haven't been able to check battery drain yet, but I have managed to get Bluetooth working with a dummy wifi connection. I'm also using personal menu so the steps are pretty easy (no shell after writing the initial scripts). I'll provide the shell scripts in an hour or so, gotta run.

andreww 2008-06-27 19:38

Re: Bluetooth-PAN in Diablo
 
<edit>
This post is not accurate. Follow the steps in the wiki to get PAN working:
http://www.internettablettalk.com/wi...tle=Diablo_PAN
</edit>
Sorry for the delay, but I think it ended up being worth it to get a better feel of how well the process works. Also, I apologize if some info is incorrect, I don't have the device in front of me :(

First, let me say that the workaround thread previously mentioned was where I found most of the info:
http://www.internettablettalk.com/fo...ead.php?t=6794

I didn't end up using the scripts because they executed programs like 'pand' that don't exist on my n810. Oh yeah, I'm also very new to this so I'm not sure what the differences are between the n800 and n810.

Following these steps should make it possible for you to use bluetooth pan with diablo.

Requirements:
- Some way to get root access, preferably without a password. I think gainroot will work fine, but I used su for some reason.
- maemo-pan package. I used the existing script /usr/lib/maemo-pan/pan-control.


Setup Step 1: Create the files.

I created /home/user/bin and placed two files in it.

bt-pan.sh (thanks fanoush for some of the original code :):
Code:

#!/bin/sh
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
        exec sudo gainroot <<EOF
exec $0 $*
EOF
        exit $?
fi
/usr/lib/maemo-pan/pan-control connect

wan-down.sh:
Code:

#!/bin/sh
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
        exec sudo gainroot <<EOF
exec $0 $*
EOF
        exit $?
fi
route del default gw
ifconfig wan0 down
# Not sure this is necessary? I don't think I'm using it now.
#route add default gw 192.168.0.1

Setup Step 2: Make them easy to execute.

In xterm, chmod the files to 755 - I assume this is necessary but Personal Menu may be able to execute them without this.

Code:

chmod 755 /home/user/bin/*
I set them up in PersonalMenu to make it a shell-less startup.
- Add
Name: Bluetooth PAN
Command: /home/user/bin/bt-pan.sh

- Add
Name: Wan Down
Command: /home/user/bin/wan-down.sh

Setup Step 3: Configure a dummy wifi. I was able to use an existing wifi connection, but using the dummy was more reliable.

- Go to Connection settings, select Connections, then 'Add' button. Again, these steps were copied from the workaround thread
I named mine 'PAN Dummy' (or something similar).
Used wlan. Selected adhoc.
On the last screen, clicked 'Advanced' and Auto-Retrieve IP address.

Luckily, these steps only have to be performed once. The steps below are what I use when I need to connect.

Run Step 1: Start the PAN app on your phone. This one is easy to forget when you're trying repeatedly :)

Run Step 2: Optional: Disconnect from any existing WiFi connection. I don't think that this is necessary, but give it a try if you run in to problems.

Run Step 3: Run bt-pan.sh (hopefully through Personal Menu). This should eventually (less than 30 seconds) turn the bluetooth icon in the sys tray blue. Most common reason for this step failing for me was forgetting 'Run Step 1.'

Run Step 4: Start the PAN Dummy network connection from the connectivity icon.

It is likely running at this point. I've had problems ('Page loading error') at this point, which might be related to routes being configured. Also, the previous thread mentioned that ad-hoc wifi is power hungry.

Run Step 5: (Optional?) Run wan-down.sh. I think this gets rid of the ad-hoc power hunger and likely also corrects routing errors.

If you still have trouble, you can try running (as root):
route add default gw 192.168.0.1

That's the gateway for my Samsung Blackjack anyway.

Run Step 6:
To disconnect, I've just been disconnecting the PAN app on my phone. I then specifically disconnect the 'PAN Dummy' connection before using my regular wifi.


TODO:

1. This will probably require some changes since I don't have the device in front of me.

2. It seemed to be flaky starting the first time. Disconnecting from the wifi might help that. It was also flaky getting my wifi back the first time (eg, I'd have to disconnect and then reconnect to my regular wifi).

3. I think it would be pretty easy to make the bt-pan.sh script wait for a wifi and auto-correct any route settings. Similar to the original thread's loop waiting for the Bluetooth network. I'll probably work on this later if it seems like a good idea.

4. So, how long will it likely take Nokia to provide some sort of actual fix for this?

Matan 2008-06-27 20:27

Re: Bluetooth-PAN in Diablo
 
Some of the connection/disconnection process can be automated with dbus-scripts.

If you install this package, you can then have a script run whenever you connect to 'PAN Dummy' (or disconnect), thus making connection as simple as connecting to DUN supporting phone.

meizirkki 2008-06-28 07:20

Re: Bluetooth-PAN in Diablo
 
Thanks for this great how-to, ill test it as soon ai i have flashed to diablo. (i downgraded back to chinook because pan did not work).

meizirkki 2008-06-28 08:22

Re: Bluetooth-PAN in Diablo
 
what is ad-hoc?

andreww 2008-06-28 09:02

Re: Bluetooth-PAN in Diablo
 
I think ad-hoc is for computer to computer wifi networks. I can see two reasons for needing it:
1. You need to convince Maemo that you have a working connection, which would be difficult without a valid wifi connection.
2. When using the bluetooth pan startup script, it will cause an existing wifi connection to be dropped. It seems like ad-hoc connectiosn get around this.

That being said, now that I have access again, I think my instructions need to be revised a bit:

1. Start the PAN app on the phone.
2. Connect to the 'PAN Dummy' ad-hoc network.
3. Run bt-pan.sh. Everything should work at this point.
4. Run wlan-down.sh. I believe this reduces power consumption associated with the ad-hoc network.

I can dump this on a wiki page if a few other people confirm that it works.

meizirkki 2008-06-28 09:26

Re: Bluetooth-PAN in Diablo
 
I cant connect to "PAN Dummy" because there isn't any connection visible. :(


All times are GMT. The time now is 21:01.

vBulletin® Version 3.8.8