maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   N900 bluetooth tethering with Debian PC in 2019? (https://talk.maemo.org/showthread.php?t=100837)

sulu 2019-09-16 09:12

N900 bluetooth tethering with Debian PC in 2019?
 
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

Maemish 2019-09-16 10:08

Re: N900 bluetooth tethering with Debian PC in 2019?
 
You checked this too?

https://wiki.maemo.org/Debian-Tethering

Halftux 2019-09-16 10:24

Re: N900 bluetooth tethering with Debian PC in 2019?
 
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

sulu 2019-09-16 11:27

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by Maemish (Post 1560379)

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.


Quote:

Originally Posted by Halftux (Post 1560380)
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. :confused:
I guess I wouldn't care about the details as long as it works and is half-way convenient.

Quote:

Originally Posted by Halftux (Post 1560380)
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

Quote:

Originally Posted by Halftux (Post 1454885)
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.

Halftux 2019-09-16 11:44

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sulu (Post 1560381)
Frankly, I don't even know the difference. Maybe what I've been trying so far isn't "tethering" at all. :confused:
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.

Quote:

Originally Posted by sulu (Post 1560381)
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.

Macros 2019-09-16 14:46

Re: N900 bluetooth tethering with Debian PC in 2019?
 
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.

Halftux 2019-09-16 19:13

Re: N900 bluetooth tethering with Debian PC in 2019?
 
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.

sulu 2019-09-16 19:55

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by Halftux (Post 1454885)
Prerequirements for pan:
[N900]
/etc/bluetooth/main.conf
comment out: DisablePlugins =network,input,hal

I did that and rebooted the phone.

Quote:

Originally Posted by Halftux (Post 1454885)
- [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.


Quote:

Originally Posted by Macros (Post 1560383)
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.

Halftux 2019-09-16 20:23

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sulu (Post 1560401)
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 2019-09-16 20:36

Re: N900 bluetooth tethering with Debian PC in 2019?
 
I forgot to say all my tests were made with genwall 1.2.2 from extras-devel sorry for missing this maybe important thing.

sicelo 2019-09-16 20:41

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Strange that regular DUN gives you issues @sulu. It worked for me just fine max 2 years ago. Unfortunately I'm reduced to a Thinkpad X40 that has dead bluetooth chip and dead USB ports, so I can't re-test :(

Perhaps you have something unusual going on in your N900 bluetooth config? e.g. bluez from -devel? attempts to use BT keyboards or play with bt audio sinking? (at least i know i've played with all those at some point)

Halftux 2019-09-16 20:49

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sicelo (Post 1560405)
Strange that regular DUN gives you issues.

Never tried, to complicated for me. I like networks:)

Quote:

Originally Posted by sicelo (Post 1560405)
Perhaps you have something unusual going on in your N900 bluetooth config? e.g. bluez from -devel? attempts to use BT keyboards or play with bt audio sinking? (at least i know i've played with all those at some point)

Yeah probably because it is my playing/dev device.

sicelo 2019-09-16 20:50

Re: N900 bluetooth tethering with Debian PC in 2019?
 
haha @Halftux .. i meant sulu. will edit so he sees

sulu 2019-09-16 20:54

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by Halftux (Post 1560402)
You are so close:) Did you blocking connections from local lan (under local-basics tab)?

Local/Basics:
Accept connection from local machine = y (default)
Accept connection from local lan = y (custom)
Drop netbios UDP 137 = y (default)

Quote:

Originally Posted by Halftux (Post 1560402)
Then you need to open port53 tcp (local-ports tab) for dnsmasq requests from bnep0.

Local/Ports:
53;tcp;WAN

Quote:

Originally Posted by Halftux (Post 1560402)
You can look in genwall local-lsof tab, there you should see dnsmasq listen on port 53 tcp.

Local/lsof:
dnsmasq 1397 nobody 6u IPv4 6965 TCP 127.0.0.1:52 (LISTEN)

Quote:

Originally Posted by Halftux (Post 1560402)
Does the N900 has a bnep0 IP address (route-ip info tab)?

Route/IP Info:
gprs0 [MY IP]
bnep0 Not available

Quote:

Originally Posted by Halftux (Post 1560402)
On that tab you could also click on dnsmasq and you will see hopefully two processes running.

I see only one process:
1397 nobody 2160 S /usr/sbin/dnsmasq -k -i lo -a 127.0.0.1 -z

Quote:

Originally Posted by Halftux (Post 1560404)
I forgot to say all my tests were made with genwall 1.2.2 from extras-devel

Same here.

Halftux 2019-09-16 21:10

Re: N900 bluetooth tethering with Debian PC in 2019?
 
The settings are locking good.

Quote:

Originally Posted by sulu (Post 1560409)
Local/Ports:
53;tcp;WAN

This is not needed when this is set "Accept connection from local lan = y".
And when it should be LAN not WAN sorry forgot to tell.

Quote:

Originally Posted by sulu (Post 1560409)
Route/IP Info:
gprs0 [MY IP]
bnep0 Not available

I see only one process:
1397 nobody 2160 S /usr/sbin/dnsmasq -k -i lo -a 127.0.0.1 -z

Not good. Do you connect with your pc as "panu" or as "nap" you need to connect as nap...(for example test-nap script sounds good but would be bad). Maybe also not fast enough with the start button but I wonder why your PC has a bnep device.
Please click the stop button on the route-bt tab and try again.

And btw maybe it helps the script in /opt/genwall/bt_on.sh will be initiated by the start button, the off button would be bt_off.sh script.

sulu 2019-09-16 21:54

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sicelo (Post 1560405)
Strange that regular DUN gives you issues @sulu. It worked for me just fine max 2 years ago.
[..]
Perhaps you have something unusual going on in your N900 bluetooth config? e.g. bluez from -devel? attempts to use BT keyboards or play with bt audio sinking? (at least i know i've played with all those at some point)

I've never done anything bluetooth-related, except for the DUN tethering years ago.


Quote:

Originally Posted by Halftux (Post 1560410)
This is not needed when this is set "Accept connection from local lan = y".
And when it should be LAN not WAN sorry forgot to tell.

I set this up because that's what I thought was this advice about:
Quote:

Originally Posted by Halftux (Post 1560402)
Then you need to open port53 tcp (local-ports tab) for dnsmasq requests from bnep0.

If that isn't the case, then I'm missing whatever I should have done here instead.

Quote:

Originally Posted by Halftux (Post 1560410)
Do you connect with your pc as "panu" or as "nap" you need to connect as nap...

I have no idea. I'm just following your how-to.

Quote:

Originally Posted by Halftux (Post 1560410)
(for example test-nap script sounds good but would be bad).

I didn't call that.

Quote:

Originally Posted by Halftux (Post 1560410)
Maybe also not fast enoug with the start button but I wonder why your PC has a bnep device.

Is within 10 seconds fast enough?
But frankly, if I'm on a clock here, that's nothing I'd like to use for production.

Quote:

Originally Posted by Halftux (Post 1560410)
Please click the stop button on the route-bt tab and try again.

Did that multiple times.

Quote:

Originally Posted by Halftux (Post 1560410)
And btw maybe it helps the script in /opt/genwall/bt_on.sh will be initiated by the start button, the off button would be bt_off.sh script.

This is what I got in the terminal when calling those scripts manually:
Code:

$ sudo /opt/genwall/bt_on.sh
CONFIG=/home/user/.genwall/network.ini                               
sed -n s/btip=//gp /home/user/.genwall/network.ini                   
IP_ADDR=192.168.8.2                                   
sed -n s/btnetm=//gp /home/user/.genwall/network.ini
NETMASK=255.255.255.0                                   
sed -n s/btdhcp1=//gp /home/user/.genwall/network.ini
DHCP_RANGE1=192.168.8.100                                 
sed -n s/btdhcp2=//gp /home/user/.genwall/network.ini
DHCP_RANGE2=192.168.8.127                                 
RUNFILE=/var/run/bt_tethering.pid                         
DNSMASQ=/usr/sbin/dnsmasq                                 
ifconfig bnep0 192.168.8.2 netmask 255.255.255.0 up 
[ -f /var/run/bt_tethering.pid ]                         
[  = lan ]                                           
[  = for ]                                         
run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:Bluetooth PAN Activated
$ sudo /opt/genwall/bt_off.sh                                                                                                                                                               
cat: can't open '/var/run/bt_tethering.pid': No such file or directory                                                                                                                       
sh: you need to specify whom to kill                                                                                                                                                         
rm: can't remove '/var/run/bt_tethering.pid': No such file or directory

To get these lines off my N900 I had to reboot it again. ;)

Halftux 2019-09-17 08:42

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sulu (Post 1560411)
I have no idea. I'm just following your how-to.

That is good but seems not to help.:(

Quote:

Originally Posted by sulu (Post 1560411)
Is within 10 seconds fast enough?
But frankly, if I'm on a clock here, that's nothing I'd like to use for production.

Nope I think it is not fast enough. Then I wonder why you are using N900 or linux distributions at all.:) It is not for production it is for handicraft work.

Quote:

Originally Posted by sulu (Post 1560411)
To get these lines off my N900 I had to reboot it again. ;)

Oh this shouldn't happen, maybe a bug will look into the script.

I'm sorry I could not be of more help on this matter. Maybe it is better to stick to some other tethering option.

biketool 2019-09-17 09:53

Re: N900 bluetooth tethering with Debian PC in 2019?
 
I use Ubuntu Mate and other than needing to force a connection on the N900 by doing something like checking email(forces the net connection to active which PAN doesn't always do for my LineageOS and formerly Ubuntu Mobile (Android hybrid)). My laptop usualy can force the N900 to go to 3.5G.
I use the N900 as my network AP whenever I am working mobile or out of the range of my WiFi AP.
There is IMHO no reason to use anything other than USB networking or BT PAN when forwarding the N900's (or most any other mobile device's) network connection. Wifi is unwise as far as the battery mA/h waste vs USB/BT but it often requires less effort to set up for a novice friend's device.
I think the BT PAN needs to be DEB-ified and moved to the repos or even a CSSU update as it is such a core functionality for one's everyday mobile phone I can get web browsing form a tethered tablet but if the N900 remains an EDC phone it needs to support basic tethering.
Which debian GUI program is managing your network if you are not using something like dhclient to dhcp and whatever is equivalent to iwconfig for BT to connect.

Halftux 2019-09-17 10:56

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by biketool (Post 1560422)
I think the BT PAN needs to be DEB-ified and moved to the repos or even a CSSU update as it is such a core functionality for one's everyday mobile phone I can get web browsing form a tethered tablet but if the N900 remains an EDC phone it needs to support basic tethering.

Does genwall also not working for you? You can tether usb/wlan/bt with it and for bt it uses the same script from 9000 which you can find on tmo. What method do you use for tether over bt? Maybe I make a easy bt-pan app without any configuration without any button.

Halftux 2019-09-17 17:57

Re: N900 bluetooth tethering with Debian PC in 2019?
 
1 Attachment(s)
So here comes the easy btpan application. It is designed to make a bt pan connection with forwarded gprs0 network. But it doesn't hurt when gprs network is down then it is like a network connection, for example to copy files from N900 to PC.
The application checks for bt power state and switches the power on if its needed. Then it waits until a bt event is coming from the PC. When the application closes it switches the bt power off.


In principle it is a bluetooth trigger application, it is triggered by a bt connect and it will run the script /opt/btpan/bt_on.sh and when the connection get lost or you close the application, it calls the /opt/btpan/bt_off.sh script. Be aware that these scripts will be started as root. The permission is also set to root.
It has an sudoers entry so you could run it from application manager.
Another way could be for root /usr/bin/run-standalone btpan and as a user sudo /usr/bin/run-standalone btpan.

If you would like to run the application as user only btpan should be enough and the scripts must have the permission executeable by the user. Not tested so far but would be nice if it is possible for other bt scripts which does not need root rights.

The delivered standard scripts will destroy your firewall settings so the best would be to modify them to your needs. It will flush everything and only gprs forwarding will be active, this means no firewall. I still recommend to use genwall.

If this application is what you want I can also upload the application to extras.

The task for the community is to make an icon, best would be a svg one and to choose maybe a different name, up to you all.
I could make an automatic network detection for choose wlan or gprs.

And by the way I made a clean devuan ascii install on a test machine and there was no need to modify the test-network script.

During pairing the application shouldn't run. But the bt adapter should be on and visible.

Prerequirements for btpan:
[N900]
/etc/bluetooth/main.conf
comment out this line (or remove network): DisablePlugins =network,input,hal
iptables and kernel-power
dbus-send should be available



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

PC as root:
bluetoothctl
power on
agent on
when you need pairing: 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
N900:
start btpan
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
PC as root:
dhclient bnep0
Disconnect:

PC as user:
ctrl+c
PC as root:
(pairable off)
agent off
power off
quit
N900:
close btpan

sulu 2019-09-17 21:05

Re: N900 bluetooth tethering with Debian PC in 2019?
 
@Halftux:
Thanks for your efforts with the btpan app! Unfortunately it doesn't change my outcome.

In Debian I have the packages installed and the N900 is paired with my PC. Then I run btpan on the N900 and see a window popping up with this line in it:
Code:

BT connection 0
After I run the test-network call on the PC this line stays unchanged and a 2nd line is added:
Code:

connected to: [MAC of my PC]
But if I then run dhclient bnep0, it still can't get an IP.


In the meantime I've tried to resurrect my old wvdial DUN connection and got a but further but wasn't totally successful.
(fyi, what I'm about to write now is a translation of a post I just wrote at debianforum.de. [1] So If your German is better than your (or my) English it's probably best to read the original.)

My /etc/wvdial.conf:
Code:

[Dialer Defaults]
Phone =
Username =
Password =
New PPPD = yes

[Dialer bt]
Modem = /dev/rfcomm0
ISDN = off
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","web.vodafone.de"
Phone = *99#
Dial Prefix =
Dial Attempts = 5
Dial Command = ATM1L3DT
Ask Password = off
Password = vodafone
Username = vodafone
Auto Reconnect = on
Abort on Busy = off
Carrier Check = on
Check Def Route = on
Abort on No Dialtone = on
Stupid Mode = off
Idle Seconds = 0
Auto DNS = on

In advance I had created /dev/rfcomm0 manually for the MAC address of my paired N900:
Code:

# rfcomm bind 0 XX:XX:XX:XX:XX:XX
# rfcomm -a
rfcomm0: XX:XX:XX:XX:XX:XX channel 1 clean

The wvdial output looks fine according to my memory:
Code:

# wvdial bt
--> WvDial: Internet dialer version 1.61
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
ATQ0
OK
--> Re-Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","web.vodafone.de"
AT+CGDCONT=1,"IP","web.vodafone.de"
OK
--> Modem initialized.
--> Sending: ATM1L3DT*99#
--> Waiting for carrier.
ATM1L3DT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected.  Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> PPP negotiation detected.
--> Starting pppd at Tue Sep 17 21:40:49 2019
--> Pid of pppd: 6890
--> Using interface ppp0
--> pppd: p��
--> pppd: p��
--> pppd: p��
--> pppd: p��
--> local  IP address 100.67.154.185
--> pppd: p��
--> remote IP address 10.6.6.6
--> pppd: p��
--> primary  DNS address 139.7.30.126
--> pppd: p��
--> secondary DNS address 139.7.30.125
--> pppd: p��

I also get an IP address:
Code:

# ip a
[..]
7: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
    link/ppp
    inet 100.105.81.150 peer 10.6.6.6/32 scope global ppp0
      valid_lft forever preferred_lft forever

But something seems to be wrong with the routing, because I can't even ping public IP addresses (e.g. Google's 8.8.8.8 ), let alone reach websites via DNS.

Somewhere I picked up that route might help me, but it sems I already have the correct route (10.6.6.6)?:
Code:

# route -n
Kernel-IP-Routentabelle
Ziel            Router          Genmask        Flags Metric Ref    Use Iface
0.0.0.0        0.0.0.0        0.0.0.0        U    1002  0        0 enp4s0
10.6.6.6        0.0.0.0        255.255.255.255 UH    0      0        0 ppp0
169.254.0.0    0.0.0.0        255.255.0.0    U    0      0        0 enp4s0
root@eee:~# route add default ppp0

Is the PC the right place to set this up at all or do I have to do this on the N900?


[1] https://debianforum.de/forum/viewtop...74706#p1217285

Halftux 2019-09-17 23:21

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Yes you need to set the default gw on your PC.
Code:

route add default gw 10.6.6.6
And check on PC your /etc/resolv.conf
should be
139.7.30.126
139.7.30.125


Can you do route -n and iptables --list on the N900 please.
What Kernel are you running?

sulu 2019-09-18 06:44

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by Halftux (Post 1560443)
Yes you need to set the default gw on your PC.
Code:

route add default gw 10.6.6.6

Thanks! Now I can ping public IPs and access Websites from the PC.
I seem to have a lot of interference here though. Whenever I try to transmit data via gprs, my DSL internet connection seems to hickup and gprs data transmission also doesn't always seem to work here. Then it usually helps to switch back and forth between 2.5G and 3G on the N900.
Especially if someone opens the door of my tenement, that seems to disturb gprs transmission. I also noticed that effect in the past, when I was watching TV via DVB-T. :confused:

Quote:

Originally Posted by Halftux (Post 1560443)
And check on PC your /etc/resolv.conf
should be
139.7.30.126
139.7.30.125

Confirmed.

Quote:

Originally Posted by Halftux (Post 1560443)
Can you do route -n and iptables --list on the N900 please.

Code:

# route -n
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
0.0.0.0        0.0.0.0        0.0.0.0        U    0      0        0 gprs0
# iptables --list
Chain INPUT (policy ACCEPT)
target    prot opt source              destination       

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination       

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination

That is while a working connection is set up with wvdial.

Quote:

Originally Posted by Halftux (Post 1560443)
What Kernel are you running?

Code:

# uname -a
Linux n900main 2.6.28.10-power53 #1 PREEMPT Wed Dec 10 13:52:39 UTC 2014 armv7l GNU/Linux


Maemish 2019-09-18 07:38

Re: N900 bluetooth tethering with Debian PC in 2019?
 
So intefresting to follow this kind of post when it doesn't really concern me. It was such a pain with the cutetube2. It is like the same difference wether your own baby cries in a public transportation or someone else's baby.

Halftux 2019-09-18 09:53

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sulu (Post 1560445)
Thanks! Now I can ping public IPs and access Websites from the PC.

Thats great.

Quote:

Originally Posted by sulu (Post 1560445)
I seem to have a lot of interference here though. Whenever I try to transmit data via gprs, my DSL internet connection seems to hickup and gprs data transmission also doesn't always seem to work here. Then it usually helps to switch back and forth between 2.5G and 3G on the N900.
Especially if someone opens the door of my tenement, that seems to disturb gprs transmission. I also noticed that effect in the past, when I was watching TV via DVB-T. :confused:

Hmm sounds strange I would change the apartment. Wifi can interfere with BT. But gprs hmm to much metal and concrete.

Maybe someone runs something like this https://www.jammer-shop.com/de/der-n...torsender.html or better you should let it run for one month and I would guess all other people will move to another place which could improve your connection stability.:D

The other thing about bt pan. You can't get a dhcp reply because the N900 will not bring up bnep0. I found in another thread that it could be fixed by reinstalling libicd2.

Halftux 2019-09-18 14:01

Re: N900 bluetooth tethering with Debian PC in 2019?
 
@sulu you can find in the maemo wiki a baudrate of 921600 ...

sulu 2019-09-18 16:39

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by Halftux (Post 1560447)
Hmm sounds strange I would change the apartment. Wifi can interfere with BT. But gprs hmm to much metal and concrete.

Indeed, I'm surrounded by a lot of metal and concrete. I'm living in a "Plattenbau".
The rent is cheap and the location is good though, so I won't move out. ;)

Quote:

Originally Posted by Halftux (Post 1560447)
The other thing about bt pan. You can't get a dhcp reply because the N900 will not bring up bnep0. I found in another thread that it could be fixed by reinstalling libicd2.

Unfortunately I can't find the package.

For the wvdial solution I've found a way to automate the routing. [1]
If I add these options to /etc/ppp/peers/wvdial, the route will be set automatically when wvdial is started:
Code:

defaultroute
replacedefaultroute


[1] https://ubuntuforums.org/showthread....80#post7836980

Halftux 2019-09-18 18:38

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sulu (Post 1560464)
Unfortunately I can't find the package.

libicd2_0.87+fremantle10+0m5_armel.deb

Yes this package is a device root package. But you could find them by adding the sponsored mirror by bencoh.
Code:

deb http://maemo.muarf.org/apt-mirror/mirror/downloads.maemo.nokia.com/fremantle/ssu/mr0 ./
It holds three libraries don't know if it is configuring something. Maybe do a backup before.
libicd_dbus.so.1.1.0
libicd_log.so.1.0.0
libicd_settings.so.1.0.0

Quote:

Originally Posted by sulu (Post 1560464)
For the wvdial solution I've found a way to automate the routing. [1]
If I add these options to /etc/ppp/peers/wvdial, the route will be set automatically when wvdial is started:
Code:

defaultroute
replacedefaultroute


Nice good to know. I in the past I did it with defaultrout.:) It is about 12-14 years ago. There I used wvdial and bt.:D
Here my old tutorial maybe it is useful when you find an old linux box.
Or find an old A780 there you could make a hack for getting edge. The good old times.

sicelo 2019-09-18 19:09

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Just to be sure, @sulu is back to using BT-DUN (I think so), or is using BT-PAN?

sulu 2019-09-19 06:50

Re: N900 bluetooth tethering with Debian PC in 2019?
 
@Halftux:
Thanks for the links and hints to libicd2!
I'll try that eventually, but during the next 2 weeks I can't afford my N900 to become unusable, so I'll do that later.

@sicelo:
Yes, from what I understand, I'm back to BT-DUN.

Halftux 2019-09-19 08:44

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Quote:

Originally Posted by sulu (Post 1560478)
Yes, from what I understand, I'm back to BT-DUN.

Yes dialup network with the point to point protocol over a serial bluetooth connection.

zerox 2019-09-22 17:41

Re: N900 bluetooth tethering with Debian PC in 2019?
 
Hi Sulu,

The method described in the below post worked for me:
http://talk.maemo.org/showpost.php?p...&postcount=258

I just had to make the change described here:
https://talk.maemo.org/showthread.ph...29#post1464429


All times are GMT. The time now is 20:14.

vBulletin® Version 3.8.8