Active Topics

 


Reply
Thread Tools
Posts: 915 | Thanked: 3,209 times | Joined on Jan 2011 @ Germany
#1
Hi,

I want to use my N900's mobile data plan on my computer(s) running Debian Buster.

On Debian I use Xfce with nm-applet (network-manager-gnome), where I successfully set up a "mobile broadband connection"* with which I can use my N900 as a modem if it is connected via USB.

Now I want the same thing not via USB but via Bluetooth (because wireless would be more convenient).
So I successfully paired my N900 and my computer(s) with the N900 and set up a "bluetooth connection"* in nm-applet. nm-applet also finds the N900 and tries to connect to it, but fails. When it does, I see these messages in journalctl:
Code:
Sep 14 09:20:34 gpd NetworkManager[667]: <info>  [1568445634.2093] device (00:BD:3A:F6:C4:71): Activation: starting connection 'Vodafone Vorgabe 2' (3c8e0375-d9ff-4108-b1a0-f8634a0c99e3)
Sep 14 09:20:34 gpd NetworkManager[667]: <info>  [1568445634.2095] audit: op="connection-activate" uuid="3c8e0375-d9ff-4108-b1a0-f8634a0c99e3" name="Vodafone Vorgabe 2" pid=1024 uid=1000 result="success"
Sep 14 09:20:34 gpd NetworkManager[667]: <info>  [1568445634.2097] device (00:BD:3A:F6:C4:71): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Sep 14 09:20:34 gpd NetworkManager[667]: <info>  [1568445634.2105] device (00:BD:3A:F6:C4:71): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Sep 14 09:20:35 gpd kernel: Bluetooth: RFCOMM TTY layer initialized
Sep 14 09:20:35 gpd kernel: Bluetooth: RFCOMM socket layer initialized
Sep 14 09:20:35 gpd kernel: Bluetooth: RFCOMM ver 1.11
Sep 14 09:20:35 gpd NetworkManager[667]: <info>  [1568445635.3817] device (00:BD:3A:F6:C4:71): Activation: (bluetooth) Stage 2 of 5 (Device Configure) successful. Will connect via DUN.
Sep 14 09:20:35 gpd NetworkManager[667]: <info>  [1568445635.3818] device (00:BD:3A:F6:C4:71): Activation: (bluetooth) Stage 2 of 5 (Device Configure) waiting for modem to appear.
Sep 14 09:20:37 gpd ModemManager[669]: <info>  Couldn't check support for device '/sys/devices/pci0000:00/0000:00:15.0/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:256/rfcomm0': not supported by any plugin
Sep 14 09:20:39 gpd systemd[1]: NetworkManager-dispatcher.service: Succeeded.
Sep 14 09:21:05 gpd NetworkManager[667]: <info>  [1568445665.8184] device (00:BD:3A:F6:C4:71): state change: config -> failed (reason 'modem-not-found', sys-iface-state: 'managed')
Sep 14 09:21:05 gpd NetworkManager[667]: <warn>  [1568445665.8204] device (00:BD:3A:F6:C4:71): Activation: failed for connection 'Vodafone Vorgabe 2'
Sep 14 09:21:05 gpd NetworkManager[667]: <info>  [1568445665.8210] device (00:BD:3A:F6:C4:71): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Alternatively I tried establishing a connection via blueman, which fails with this message:
Code:
fail (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:124)
fail org.freedesktop.DBus.Python._blueman.RFCOMMError: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/blueman/services/meta/SerialService.py", line 39, in connect
    port_id = create_rfcomm_device(Adapter(props['Adapter']).get_properties()['Address'], props['Address'], channel)
  File "_blueman.pyx", line 229, in _blueman.create_rfcomm_device
_blueman.RFCOMMError: Can't connect RFCOMM socket
My first thought was, that there is some problem on the Debian side, which is why I opened a thread in the German debianforum.de (I'm "hikaru" over there). [1]
But two peopIe who have never done this before can establish a connection in nm-applet via bluetooth with their phones (not N900) right away. I on the other hand can reproduce the same problem on three different PCs with different Debian installations. One of them is a very vanilla Debian Xfce installation, to which I only added the bluez and bluetooth packages.

So I'm beginning to think, that the problem is not actually on the Debian side, but on the N900's.
I once had bluetooth tethering working with wvdial on a Debian PC some 5+ years ago, but I didn't keep my wvdial configuration and I thought, it should be easy to do with nm-applet. I'm pretty sure that nothing of relevance has changed on my N900 since then.
As far as I understood, the missing rfcomm socket blueman is complaining about should be something like /dev/rfcomm* on my Debian system. I don't see such a device. Would I need that, and if so, should it somehow be created by/from/via(?) the N900? One of the users at debianforum.de, who has a working connection, says, he sees no such device either.

When opening this thread, these threads were suggested to me [2][3][4][5][6], but since they're all very old, I don't know which one(s), if any, to follow.
I'm running the latest kernel power on the N900 and bluetooth-dun seems to be working fine. At least I see the rfcomm instance running, that's started by it:
Code:
 1198 root      1556 S    rfcomm -S -- listen -1 1 /usr/bin/pnatd ()
Can anybody help me out?


*) back-translated from German, so probably not the original term

[1] https://debianforum.de/forum/viewtop...?f=30&t=174706
[2] http://talk.maemo.org/showthread.php?t=58570
[3] http://talk.maemo.org/showthread.php?t=90063
[4] http://talk.maemo.org/showthread.php?t=37710
[5] http://talk.maemo.org/showthread.php?t=32839
[6] http://talk.maemo.org/showthread.php?t=46140
 

The Following 2 Users Say Thank You to sulu For This Useful Post:
Maemish's Avatar
Posts: 1,719 | Thanked: 4,764 times | Joined on Apr 2018 @ Helsinki, Finland.
#2
You checked this too?

https://wiki.maemo.org/Debian-Tethering
__________________
"I don't know how but I can try!" (active)

Master of not knowing (active)

For me it is possible to get lost in any case (active)

Learning to fall from high (DONE)

Learning to code with BASIC (WIP)
 

The Following 2 Users Say Thank You to Maemish For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#3
I never used bt tethering, I always used a forwarded bt pan connection.
I got it working with devuan ascii, but laptop is at home and there are some differences compared to debian.

I will give you a link how I did it in the past. However with devuan ascii it is different and I will have look and try to remember what I did.

In principle you need to initiate a pan connection the rest you do with genwall.

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

Pan and modern bluez:
http://blog.fraggod.net/2015/03/28/b...-bluez-5x.html

Last edited by Halftux; 2019-09-16 at 10:36.
 

The Following 3 Users Say Thank You to Halftux For This Useful Post:
Posts: 915 | Thanked: 3,209 times | Joined on Jan 2011 @ Germany
#4
Originally Posted by Maemish View Post
You checked this too?

https://wiki.maemo.org/Debian-Tethering
Sort of. The 1st half of the article is about pairing, which I had already done.
In the 2nd half pppconfig didn't make any sense to me though. Most of the ncurses dialogues didnt seem to be about what I wanted to do and after completing the wizard with largely random/default inputs I couldn't find any config file that I might have adapted manually.


Originally Posted by Halftux View Post
I never used bt tethering, I always used a forwarded bt pan connection.
Frankly, I don't even know the difference. Maybe what I've been trying so far isn't "tethering" at all.
I guess I wouldn't care about the details as long as it works and is half-way convenient.

Originally Posted by Halftux View Post
In principle you need to initiate a pan connection the rest you do with genwall.

http://talk.maemo.org/showpost.php?p...5&postcount=62
Originally Posted by Halftux View Post
Prerequirements for pan:
[N900]
/etc/bluetooth/main.conf
comment out: DisablePlugins =network,input,hal
I don't have my N900 at hand, so I can't check right now:
Does this mean, that by default whatever kind of "network" won't work on the N900 via bluetooth?
If so, that might explain my problems. But then I don't understand why it worked years ago.
 

The Following User Says Thank You to sulu For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#5
Originally Posted by sulu View Post
Frankly, I don't even know the difference. Maybe what I've been trying so far isn't "tethering" at all.
I guess I wouldn't care about the details as long as it works and is half-way convenient.
I think you can say to both methods tethering, but bt-dun and bt-ppp (spp) is in my eyes classic tethering (serial) and bt-pan (network) is for me forwarding packages to another network.

Originally Posted by sulu View Post
I don't have my N900 at hand, so I can't check right now:
Does this mean, that by default whatever kind of "network" won't work on the N900 via bluetooth?
If so, that might explain my problems. But then I don't understand why it worked years ago.
This means pan want work and your linux pc sees the N900 as a phone whereas when network is enabled the N900 is then recognized like a PC. This option should not interfere with bt-dun.

Last edited by Halftux; 2019-09-16 at 11:53.
 

The Following 2 Users Say Thank You to Halftux For This Useful Post:
Posts: 258 | Thanked: 1,012 times | Joined on May 2010 @ Near Munich
#6
Instead of bluetooth you can also easily use wireless tethering.
There is an app called "Qt Mobile Hotspot", which I have found to work quite reliably.

Of course you want at least the WEP encryption provided. The problem is, many modern wireless devices do not support WEP, my workaround is to carry a Edimax ew-7811un around (very cheap, very little wireless dongle), plug it into any device and it will be able to use your WEP network. (Works also for the native N9 hotspot)

WEP is not secure and can be hacked, but because it isn't supported anymore the risk of somebody having a compatible device, the required skills and the urge to hack your hotspot is very negligible.
 

The Following 2 Users Say Thank You to Macros For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#7
I don't know if it helps but my setup is atm broken (edit only for one N900). Maybe the bluetooth dbus device has changed. When I try to connect like before I getting now an audio connection.

As far as I remember:
N900_1: not working cssu testing maybe other testing stuff from bt
N900_2: working cssu stable some packages from cssu devel but not related
Have another one with stock but not tested atm.


Here my notes(which where working in march 2019 and today):
Device must be paired once and should be trusted.
(a note I made to the test-network script "changed Network1 to Device1" However try first without modification it is not everytime necessary) This was a hack which was needed because the N900 was identified wrong and which seems to not working anymore due to some applied system updates? Will look into it maybe we need to change the bluetooth class on the N900.

needed packages on PC:
bluetooth
bluez-test-scripts
bluez-tools

PC as root:
bluetoothctl
power on
agent on
pairable on
when you need pairing (look for mac): scan on
when you need pairing (pair the device): pair 00:00:00:00:00:00

PC as user replace with your N900 mac address(if input/output error do again):
cd /usr/share/doc/bluez-test-scripts/examples
./test-network 00:00:00:00:00:00:00 nap

in genwall:
when the bt icon get blue click fast the start button which resides on route-bt tab(settings on that page should be saved before and select dnsmasq to forward.)

PC as root:
dhclient bnep0

in genwall:
in genwall setup the firewall and forwarding you could do it also before making the connection.

{local-basics}
1.:select wan device gprs/usb/wlan
2. I would "accept connection from local machine"... makes live easier (really this should be activated!)
3. If you want to connect from pc->N900 without openning ports. I would also recommend to "Accept connection from local lan". (or allow port for dhcp)

{for/out}
4. activate forwarding and set lan device to bnep
5. Masquerade wan device should be active
{local-basics}
6.gen rules
7. push the start button


Disconnect:

PC as user:
ctrl+c
PC as root:
pairable off
agent off
power off
quit

EDIT: Oh on another N900 my tutorial is still working

And btw with genwall you could also make a wep wifi hotspot in addition with a firewall, also with your own rules.

Last edited by Halftux; 2019-09-17 at 16:13.
 

The Following 2 Users Say Thank You to Halftux For This Useful Post:
Posts: 915 | Thanked: 3,209 times | Joined on Jan 2011 @ Germany
#8
Originally Posted by Halftux View Post
Prerequirements for pan:
[N900]
/etc/bluetooth/main.conf
comment out: DisablePlugins =network,input,hal
I did that and rebooted the phone.

Originally Posted by Halftux View Post
- [PC] if the device is not up bring device up and get an ip address
Code:
ifconfig bnep0 up
dhclient bnep0
bnet0 is up and dhclient is trying to obtain an IP adress, but it can't get any from the N900.

Frankly, I'm about to give up here. Networking is really not my strong suit and I'm not really motivated to change that.
Now that I know there are multiple "ways" of tethering I discovered, that nm-applet actually uses dun when setting up a bluetooth connection. So I'd rather follow that path, if any.


Originally Posted by Macros View Post
Instead of bluetooth you can also easily use wireless tethering.
There is an app called "Qt Mobile Hotspot", which I have found to work quite reliably.
I actually have it installed for ages. Originally I didn't want to use it, because of WEP and because afair it sometimes doesn't seem to shut down wifi properly (AP is terminated, but power drain stays high).
Out of desperation I tried it anyways, but by that time I had messed up settings genwall so hard, that I didn't know how to help myself, other than rebooting the device. After the reboot it worked fine though.

I still don't feel very comfortable with this solution, and since I already have a fallback via USB I'm not sure I'll use the wifi approach.
 

The Following User Says Thank You to sulu For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#9
Originally Posted by sulu View Post
bnet0 is up and dhclient is trying to obtain an IP adress, but it can't get any from the N900.
You are so close Did you blocking connections from local lan (under local-basics tab)? Then you need to open port53 tcp (local-ports tab) for dnsmasq requests from bnep0.

You can look in genwall local-lsof tab, there you should see dnsmasq listen on port 53 tcp.

Does the N900 has a bnep0 IP address (route-ip info tab)?

On that tab you could also click on dnsmasq and you will see hopefully two processes running.

One for local host 127.0.0.1 and one for your bt ip.
 
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#10
I forgot to say all my tests were made with genwall 1.2.2 from extras-devel sorry for missing this maybe important thing.
 
Reply


 
Forum Jump


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