Reply
Thread Tools
Posts: 159 | Thanked: 217 times | Joined on Oct 2011
#261
I thought about trying this Viqsis method of not using any script. I noticed that sconf made two remarks about the code, and I think I understood the first about apostrophe (the last six lines should end like %k'" (apostrophe and quotation mark)), but where should I add the "ifconfig %k up;" part? Should it read like?

Code:
KERNEL=="bnep5", ACTION=="add", RUN+="/bin/sh -c '/usr/bin/ifconfig %k up; brctl addif pan0 %k'"
 

The Following User Says Thank You to Kossuth For This Useful Post:
Viqsi's Avatar
Posts: 115 | Thanked: 136 times | Joined on Mar 2008 @ Central Ohio
#262
Originally Posted by Kossuth View Post
I thought about trying this Viqsis method of not using any script. I noticed that sconf made two remarks about the code, and I think I understood the first about apostrophe (the last six lines should end like %k'" (apostrophe and quotation mark)), but where should I add the "ifconfig %k up;" part? Should it read like?

Code:
KERNEL=="bnep5", ACTION=="add", RUN+="/bin/sh -c '/usr/bin/ifconfig %k up; brctl addif pan0 %k'"
That looks about right to me. I didn't have to do it, but he did so YMMV.

I'm actually having to recreate this configuration on a new phone (my old one's internal memory is dying), so if I come across any new foibles I'll mention 'em here.
 

The Following User Says Thank You to Viqsi For This Useful Post:
Viqsi's Avatar
Posts: 115 | Thanked: 136 times | Joined on Mar 2008 @ Central Ohio
#263
Turns out I was living a charmed life w/r/t not having to have udev run ifconfig for every bnepX device on my first phone. The second phone required it. So I've edited my post accordingly.
 
Posts: 8 | Thanked: 7 times | Joined on Jul 2010
#264
Viqsi I tried your scripts and finally got things working with multiple iOS devices (an iPod and an iPad)

Just one correction in the 50-bnep.rules file, the path to brctl is incorrect for my device
For me it is /usr/sbin/brctl
Running PR 1.3 and stable power kernel 52 (2.6.28.10-power52)

Everything works perfectly now, cannot thank you enough!!
 

The Following 2 Users Say Thank You to snap For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#265
First of all, thanks to OP for original idea and whole thread and to Viqsi for clever approach with bridge usage, courtesy of latest KP.

Now, I'm pretty green when it comes to bluetooth PAN (never used it before - DUN user for ages), so bear with me, please - my question may be noobish:

I've tried both methods (cleaned everything after attempts, so don't worry about config mess) and I think both should be working for me - the thing is, that I have problems at *earlier* stage, i.e. connecting PCs and N900 in PAN mode.

Machines in question are windoze XP systems with broadcomm WIDCOMM bluetooth stack. Every other bluetooth profile works OK, I also have a "Bluetooth Network Interface" created under "networks". PC pairs up with N900 in any other profile without problems, and both devices are each's other "trusted" machines.

But, "network access" profile doesn't show as "service" offered by N900 (from PC perspective), at all. I *only* see DUN, object push, hands-free and so goes on - *no* network access or anything resembling PAN, whatsoever.

When I try to force connect to N900 using "network access" profile, error appears, stating that "this service isn't offered by <my N900 bluetooth hostname>".
---

Any ideas? May it be related to bluetooth-dun package being installed, at some point, on N900? Could it somehow "disable" PAN profile all-together? If yes, where to check and how to clean mess left?

/Estel

// Edit

Normally, DUN was more than enough for me - but currently, my internet access situation is such, that having N900 as device sharing connection to all others (bluetooth-equipped - one another N900 and one PC) devices in home, would be most comfortable solution. As DUN allows only 2 deevices to cooperate, PAN seemed like best option (I would like to avoid fallback mobile hotspot [aka ad-hoc wifi] usage, due to high battery drain - it's good for short connections, but not 24/7 solution, which I'm aiming at).

Thanks in advance,
/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Posts: 159 | Thanked: 217 times | Joined on Oct 2011
#266
I really doubt that you missed this, but in case you did, in the previous page

http://talk.maemo.org/showpost.php?p...&postcount=256

it is mentioned that you have to remove network from the disabled plugins list. Could this be the cause of your problem. I suspect that it isn't, and when I get home in the evening, I'll test if my N900 pan tethering works with my home Vista and 7 installations and report here (sorry no XP machine left). With my Ipad (disclaimer: got it as a gift) it works flawlessly.

edit: tested the win7 desktop. After pairing the bluetooth pan works without any fiddling.

Last edited by Kossuth; 2013-11-07 at 14:24. Reason: update on win7
 

The Following 2 Users Say Thank You to Kossuth For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#267
Originally Posted by Kossuth View Post
I really doubt that you missed this, but in case you did, in the previous page

http://talk.maemo.org/showpost.php?p...&postcount=256

it is mentioned that you have to remove network from the disabled plugins list. Could this be the cause of your problem.
Now, we all have our "of, sh*t!" moments, yep?

Yes, it was it, indeed. the funniest thing is that a) I've thanked post you've mentioned b) I was perfectly, completely, absolutely sure, that I've removed "network" from that file. Unless it was somehow re-inserted (for reasons unknown) during bluetooth-dun package uninstallation (did it at some point, as part for trying to find problem's cause), I must have imagined it. (Update: For the record, one does *not* need to remove bluetooth-dun package for bluetooth PAN to work - editing disabled plugins list and *restarting* device is all that is required to switch from DUN to PAN and other way around).

Now, as it may help someone later:

Originally Posted by jackburton View Post
A reboot is recommended. You could probably try restarting bluetoothd instead as that may work.
I tried restarting bluetoothd instead of whole device just for the sake of it, and it *seemed* to work - i.e, pairing was OK, bridge was created and dmesg showed all proper messages about entering forwarding state, but there was *no* network access on other machines. They could talk to each other (I was able to ssh both ways through PAN IP addresses), and bridge was pretending to work (brctl show contained mac of paired interface, mentioned messages in dmesg), nothing would result in proper network access for clients. On top of it, every time i turned bluetooth off and on on N900, it required full re-pairing with clients, setting up PIN, etc.

Now, after rebooting *whole* N900, it all works like charm. I've tested all possible combinations of enabling, disabling, and changing internet access on N90 0during and in-between PAN connection with bridge, and it flawlessly detect changes and propagate them (confirmed both by real-life tests, and by dmesg infos about propagating changed topology)

So, for future readers, restarting bluetoothd doesn't seem to be enough.
---

Thanks a lot for help, and again for making it possible in the first place!

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#268
Now, lets enter advanced layers of magic - how the heck one sets up (another) N900 to connect with (our) N900 in PAN mode, and benefit from internet access, just like PC does?

I've checked:
http://talk.maemo.org/showthread.php?t=37710

...but this thread is a total mess, full of outdated informations (old PRs) and broken links. I'm pretty sure that most of things achieved by some early devel (long abandoned, since) could be achieved by editing proper files, just like Viqsi did with bridged scenario - the only "hatch" is that it would need to be done by someone knowledgeable about topic

In my scenario, I have main N900, which got cellular internet access, and should be sharing it - through bluetooth PAN - to PC and another N900. So, in total, there are 3 devices in my bluetooth LAN.

currently, 2 of them work as intended - main N900 have internet access and seamlessly share it with PC, both of them share (bluetooth) LAN. I would like to add 3th N900 to LAN (PAN), which would leech net the same way PC does it.

Any hints- at least where to start (apart from editing /etc/bluetooth/main.conf on "client" N900 too, and deleting "network" from disabled plugins) greatly appreciated, as I have NFC how to even connect another N900 to PAN, let alone configure it to benefit from shared internet.

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Posts: 159 | Thanked: 217 times | Joined on Oct 2011
#269
I've been thinking and searching about expanding my usage of bluetooth for wireless hdd usage of N900, and came across this topic

http://talk.maemo.org/showthread.php?t=82750

Would it cover your needs?

BTW, are you using Viqsis method or something similar? If you are, does it open the GPRS connection when it needs it or do you have open it manually. The original enhanced script version opens the GPRS connection initially, when the BT connection is made, but if for some reason the GPRS gets disconnected, it does not reopen it, and I have to disconnect and connect BT again from my other device to get the internet connection on without touching my N900.

Last edited by Kossuth; 2013-11-08 at 11:52. Reason: Extra question
 

The Following User Says Thank You to Kossuth For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#270
Thanks, I'll try to dissect that python script and try to reproduce results via some shell one, when I got time. As for your question, I'm using Viqsi's method (with your fixes, as I belive, already incorporated into original post) + corrected /usr/bin into /usr/sbin.

The result is, that it *doesn't* automatically connect GPRS for me during PAN initiation (maybe something about not having GPRS set to auto-connect when internet is demanded from programs, in Maemo?), but if I connect/disconnect GPRS manually while PAN is active (and clients are "leeching" net access), changes are propagated seamlessly. No need to reconnect anything bluetooth related, tethering clients reach internet as soon as host ("main" N900) can reach it.

/Estel

// Edit

I just re-read your post, and obviously, I missed the "without touching N900" part, so I think that you're also *not* having problems with auto-propagation of network access change, and you're thinking *only* about more robust way to keep GPRS alive during PAN usage, even after disconnects.

What about something like:
Code:
while true; do <bits of code that connect GPRS here>; sleep 5; done
...which would be called only when PAN network is "alive"? It should result in "watchman" script sleeping in background, getting alive only if GPRS disconnects, trying to reconnect it after 5 seconds, then.

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!

Last edited by Estel; 2013-11-09 at 22:32.
 

The Following User Says Thank You to Estel For This Useful Post:
Reply

Tags
bluetooth-pan, tethering

Thread Tools

 
Forum Jump


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