blueman icon indicating copy to clipboard operation
blueman copied to clipboard

Blueman pairs and connects, but does not dial modem

Open lxs602 opened this issue 7 years ago • 21 comments

Hi,

blueman: 2.0.5 BlueZ: 5.50 (ppa) Distribution: Ubuntu Budgie 18.04 x86_64 Desktop environment: Budgie

I have been attempting to use bluetooth to connect to the modem on my phone. It pairs with blueman and other services seem to work, but not dialling out on the modem.

The main error I can see seems to be (from syslog/other log): org.blueman.Mechanism[800]: Unable to init server: Could not connect: Connection refused

I have attached all the logs I can think of below. I hope it is useful. dpkg -l | grep blue - https://pastebin.com/aABmi35W blueman-manager - https://pastebin.com/SNpaw22Y btmon - https://pastebin.com/TyqthqhH syslog - https://pastebin.com/rrVKEmev sdptool-browse - https://pastebin.com/JkKTAwqC lsusb - https://pastebin.com/WQgdJn4W dmesg - https://pastebin.com/EJV8VKas journalctl (log truncated) - https://pastebin.com/YqbACtfE

I started pairing and dialup at the following times: Pairing: 18:56:48 DUN connect: 18:57:10

Journalctl didn't log for about 15 minutes from about 18:52, I have no idea why. The same error as above occurs at 20:14:25: org.blueman.Mechanism[821]: Unable to init server: Could not connect: Connection refused

I am able to use minicom (actually cutecom) to send 'ATZ' to the modem, and I get:

OK

Wvdial fails as well. I haven't tried ppp so far because I find it hard to use.

Bluetooth dial up works on Windows, which I am using to write this now unfortunately.

I'd be grateful for whatever you can suggest.

Thanks folks.

lxs602 avatar Oct 12 '18 21:10 lxs602

Yes, DUN is broken in 2.0. Neither of us had phones that had DUN so had no way to test.

I found my old n900 phone which has DUN so I have been fixing thing in master. If you are able (and willing) to apply patches I could provide a single patch that makes it work for me.

infirit avatar Oct 12 '18 23:10 infirit

Hi yes I'm very happy to add patches. I can buy you a test phone on if you like... :) It would have to be an old one though

lxs602 avatar Oct 13 '18 15:10 lxs602

Thanks for the offer, I have a software solution now that emulates a bluetooth modem on any android device. Its called BlueDUN+. It does not require root or any configuration changes.

I'll prepare a 2.0 branch for the dun fixes, test a bit and when ready post a patch here.

infirit avatar Oct 14 '18 13:10 infirit

Unfortunately been busy and there are a lot of fixes that went into master for serial/rfcomm, dun and python3 that are not in 2.0. They are not difficult to backport but takes time as master has diverged somewhat from 2.0 (so not trivial as I intentionally thought :disappointed:).

@cschramm, happy to do this but then it would be nice if I can push this into 2.0 and prepare a new release. We have a willing victim for testing patches :smiling_imp:.

infirit avatar Oct 31 '18 20:10 infirit

The blueman dun code works which you can test with https://github.com/blueman-project/blueman/pull/939 (add .patch url for a patch). It dials and my machine uses the phone for internet.

The NetworkManager bits are not done yet which I'll work on in the next couple of days. But you are using blueman's dun so please have a go and let me know if it works.

infirit avatar Nov 01 '18 22:11 infirit

Okey coke. Will try it out.

lxs602 avatar Nov 05 '18 15:11 lxs602

The NM part works for me now as well.

infirit avatar Nov 05 '18 21:11 infirit

Hi, I get the message below when I try to patch. Is it anything significant?

luke@luke-Satellite-L635:/usr/local/blueman-master$ sudo patch -p1 < 939.patch 
patching file blueman/plugins/applet/PPPSupport.py
Hunk #1 FAILED at 31.
1 out of 1 hunk FAILED -- saving rejects to file blueman/plugins/applet/PPPSupport.py.rej
patching file blueman/plugins/applet/PPPSupport.py
Hunk #1 FAILED at 39.
1 out of 1 hunk FAILED -- saving rejects to file blueman/plugins/applet/PPPSupport.py.rej
patching file blueman/main/PPPConnection.py
Reversed (or previously applied) patch detected!  Assume -R? [n] 

lxs602 avatar Nov 06 '18 18:11 lxs602

Also this, after continuing after the message above anyway:
(Names and email redacted with ****)

> 1 out of 1 hunk FAILED -- saving rejects to file blueman/main/PPPConnection.py.rej
> can't find file to patch at input line 989
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |
> |From 222d0532cd9164500056cd56fa6542ba17f94ad0 Mon Sep 17 00:00:00 2001
> |From: ********************** <**********@***********>
> |Date: Tue, 30 Oct 2018 21:52:49 +0100
> |Subject: [PATCH 09/13] mechanism Rfcomm: Decode output to codepoints
> |
> |---
> | blueman/plugins/mechanism/Rfcomm.py.in | 2 +-
> | 1 file changed, 1 insertion(+), 1 deletion(-)
> |
> |diff --git a/blueman/plugins/mechanism/Rfcomm.py.in b/blueman/plugins/mechanism/Rfcomm.py.in
> |index 867b1103..6d49f2fb 100644
> |--- a/blueman/plugins/mechanism/Rfcomm.py.in
> |+++ b/blueman/plugins/mechanism/Rfcomm.py.in
> --------------------------
> **File to patch:**
> **Skip this patch? [y]** 

lxs602 avatar Nov 06 '18 18:11 lxs602

I haven't done lots of patching, so I hope the above are not silly oversights of mine...

lxs602 avatar Nov 06 '18 18:11 lxs602

silly oversights of mine...

Not silly but maybe an oversight :smile:

It looks like you are trying to apply the patch against master. The patch however is against the current stable 2.0 so you can patch the version that is in ubuntu. I am not too familiar with debian packages but you should be able to do something like https://cs-people.bu.edu/doucette/xia/guides/debian-patch.txt

I would recommend patching the package in ubuntu as installing blueman correctly from source can be tricky.

infirit avatar Nov 06 '18 22:11 infirit

I have tested it for about 1/2 hour and it is working well, with network-manager integration.

Are there any other conditions or new features to be tested?

lxs602 avatar Nov 09 '18 18:11 lxs602

working well, with network-manager integration

Thanks for testing :+1:

Are there any other conditions

If you can try changing to blueman's dun by changing it in "Local Services".

infirit avatar Nov 09 '18 19:11 infirit

Blueman's dun fails, unfortunately. I will attach syslog and journalctl below. Any other logs you need (btmon)?

The connection was initiated at about 17:32:45.

BLUEMAN-MANAGER:

luke@luke-Satellite-L635:~$ blueman-manager 
_________
Load (/usr/lib/python3/dist-packages/blueman/main/PluginManager.py:60)
['Services', 'PulseAudioProfile'] 
_________
__load_plugin (/usr/lib/python3/dist-packages/blueman/main/PluginManager.py:133)
loading <class 'blueman.plugins.manager.Services.Services'> 
_________
__load_plugin (/usr/lib/python3/dist-packages/blueman/main/PluginManager.py:133)
loading <class 'blueman.plugins.manager.PulseAudioProfile.PulseAudioProfile'> 
_________
pa_context_event (/usr/lib/python3/dist-packages/blueman/main/PulseAudioUtils.py:341)
1 
blueman-manager version 2.0.5 starting
Stale PID, overwriting
_________
pa_context_event (/usr/lib/python3/dist-packages/blueman/main/PulseAudioUtils.py:341)
2 
_________
on_bluez_name_owner_changed (/usr/bin/blueman-manager:96)
org.bluez owner changed to  :1.5 
_________
get_interface_version (/usr/lib/python3/dist-packages/blueman/bluez/BlueZInterface.py:13)
Detected BlueZ 5 
_________
SetAdapter (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:271)
 
_________
on_adapter_changed (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerToolbar.py:83)
toolbar adapter /org/bluez/hci0 
_________
__init__ (/usr/lib/python3/dist-packages/blueman/main/Device.py:26)
caching initial properties 
_________
add_device (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:317)
adding new device 
_________
do_cache (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:496)
Caching new device 00:19:2D:04:02:64 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Fake False 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Trusted 1 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Paired 1 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
pa_context_event (/usr/lib/python3/dist-packages/blueman/main/PulseAudioUtils.py:341)
3 
_________
pa_context_event (/usr/lib/python3/dist-packages/blueman/main/PulseAudioUtils.py:341)
4 
_________
on_pa_ready (/usr/lib/python3/dist-packages/blueman/plugins/manager/PulseAudioProfile.py:29)
connected 
_________
<lambda> (/usr/lib/python3/dist-packages/blueman/main/PulseAudioUtils.py:353)
1 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
blueman-services version 2.0.5 starting
Gtk-Message: 17:32:15.436: GtkDialog mapped without a transient parent. This is discouraged.
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
set_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:85)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdb1b0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e2b40)> 
_________
set_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:85)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdbcf0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e3100)> 
_________
on_device_property_changed (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:163)
list: device_prop_ch Connected 1 /org/bluez/hci0/dev_00_19_2D_04_02_64 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Connected 1 
_________
monitor_power_levels (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:185)
starting monitor 
_________
level_setup_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:325)
animating up 
_________
unset_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:99)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdb1b0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e2b40)> 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
unset_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:99)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdbcf0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e3100)> 
_________
fail (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:124)
fail org.freedesktop.DBus.Python.dbus.exceptions.DBusException: Modem initialization timed out 
/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerProgressbar.py:165: Warning: Source ID 42200 was not found when attempting to remove it
  GObject.source_remove(self.gsource)
_________
on_device_property_changed (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:163)
list: device_prop_ch Connected 0 /org/bluez/hci0/dev_00_19_2D_04_02_64 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Connected 0 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
level_setup_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:325)
animating down 
_________
update (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:186)
stopping monitor (not connected) 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
set_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:85)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdb1b0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e2b40)> 
_________
set_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:85)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdbcf0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e3100)> 
_________
on_device_property_changed (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:163)
list: device_prop_ch Connected 1 /org/bluez/hci0/dev_00_19_2D_04_02_64 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Connected 1 
_________
monitor_power_levels (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:185)
starting monitor 
_________
level_setup_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:325)
animating up 
_________
unset_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:99)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdb1b0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e2b40)> 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
unset_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:99)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdbcf0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e3100)> 
_________
fail (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:124)
fail org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. 
/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerProgressbar.py:165: Warning: Source ID 44863 was not found when attempting to remove it
  GObject.source_remove(self.gsource)
_________
on_device_property_changed (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:163)
list: device_prop_ch Connected 0 /org/bluez/hci0/dev_00_19_2D_04_02_64 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Connected 0 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
level_setup_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:325)
animating down 
_________
update (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:186)
stopping monitor (not connected) 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
blueman-services version 2.0.5 starting
Gtk-Message: 17:43:06.301: GtkDialog mapped without a transient parent. This is discouraged.
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
set_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:85)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdb1b0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e2b40)> 
_________
set_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:85)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdbcf0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e3100)> 
_________
on_device_property_changed (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:163)
list: device_prop_ch Connected 1 /org/bluez/hci0/dev_00_19_2D_04_02_64 
_________
row_update_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:264)
row update event Connected 1 
_________
monitor_power_levels (/usr/lib/python3/dist-packages/blueman/gui/DeviceList.py:185)
starting monitor 
_________
level_setup_event (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceList.py:325)
animating up 
_________
success (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:113)
success Connection sucesfully activated 
_________
unset_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:99)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdb1b0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e2b40)> 
_________
Generate (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:173)
Porcelain 
_________
unset_op (/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerDeviceMenu.py:99)
op: regenerating instance <ManagerDeviceMenu.ManagerDeviceMenu object at 0x7f5b9ebdbcf0 (blueman+gui+manager+ManagerDeviceMenu+ManagerDeviceMenu at 0x31e3100)> 
/usr/lib/python3/dist-packages/blueman/gui/manager/ManagerProgressbar.py:165: Warning: Source ID 59304 was not found when attempting to remove it
  GObject.source_remove(self.gsource)

lxs602 avatar Nov 10 '18 17:11 lxs602

That's not so easy to read. I have uploaded them to pastebin as well:

SYSLOG: https://pastebin.com/jzf256Pa JOURNALCTL: https://pastebin.com/zRTLMPam BLUEMAN-MANAGER: https://pastebin.com/B3qNNjLd

lxs602 avatar Nov 10 '18 17:11 lxs602

Thanks, yeah a pastebin is usually a good idea.

There is only one map call in PPPConnection and its behaviour changed in python3. Below hopefully will take care of the error. I do expect the connection to still fail though as this error is hiding it.

diff --git a/blueman/main/PPPConnection.py b/blueman/main/PPPConnection.py
index 771a82d3..e64c17a7 100644
--- a/blueman/main/PPPConnection.py
+++ b/blueman/main/PPPConnection.py
@@ -210,7 +210,7 @@ class PPPConnection(GObject.GObject):
 
         if found:
             lines = filter(lambda x: x != "", lines)
-            lines = map(lambda x: x.strip("\r\n"), lines)
+            lines = list(map(lambda x: x.strip("\r\n"), lines))
             dprint("<-- ", lines)
 
             on_done(lines, None)

infirit avatar Nov 10 '18 21:11 infirit

Sorry for the slow reply as something important came up.

As before, connection failed with blueman's DUN, then succeeded with network-manager.

blueman-manager: https://pastebin.com/PmKpV7Aq journalctl -r: https://pastebin.com/HSQZnp76 syslog: https://pastebin.com/G00bG8xQ

If newer phones don't use DUN, what protocol do they use instead? I have never owned a smartphone.

lxs602 avatar Nov 20 '18 20:11 lxs602

@lxs602 not sure what is going on but thanks for trying out blueman dun support. It works for me :disappointed:.

If newer phones don't use DUN, what protocol do they use instead? I have never owned a smartphone.

Newer phones use a PAN connection. This works much simpler with a bridge connection that is registered with BlueZ. These PAN connection also show up automatically in NetworkManager.

We merged the two PR to master and 2-0-stable branches. I like to keep this issue open as blueman's DUN fails for you.

infirit avatar Dec 08 '18 12:12 infirit

Are there any other logs I can send? I can change dependency versions, or recompile them, etc., if it would help.

Perhaps I should have said, if it is relevant, but the bluetooth modem is external USB.

It is not a very big problem, though, so thank you for the reply.

PS. I bought a slightly newer laptop recently, with internal bluetooth. Blueman does not load, though I am sure it did at first... I have submitted a separate bug report below.

https://github.com/blueman-project/blueman/issues/963

lxs602 avatar Dec 10 '18 18:12 lxs602

Perhaps I should have said, if it is relevant, but the bluetooth modem is external USB.

Maybe, what is the brand and model. Normally this shouldn't be a problem but It does not hurt to look into it.

Are there any other logs I can send?

Yes, but it is a bit tricky. I'll write something up how to get the log of blueman-mechanism when I have some time.

btw, there should be a new release soon with the patch I provided. Not sure but I think you should be able to get the debian deb. Perhaps @cschramm can confirm this :smiley:

Regardless, I appreciate you helping with testing :+1:

ps: I replied to the other issue you reported.

infirit avatar Dec 10 '18 23:12 infirit

I have tried blueman on the newer laptop, using a liveCD, and the error seems the same. I suppose the fault is with my phone model.

blueman-applet : https://gist.github.com/lxs602/0fd853e2dc74b2dac0b7b3104cec2208 Syslog: https://gist.githubusercontent.com/lxs602/0ec4f2b2572d25ba2407e107cf91291d/raw/57b15ff612d9b8d7a2e3472a45b004d7394e37b4/Syslog
Journalctl -r: https://gist.github.com/lxs602/ddd8855bc535eedd8d50f2b23c51c0f2

lxs602 avatar Dec 20 '18 13:12 lxs602

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 29 '22 00:08 github-actions[bot]