GNOME Bugzilla – Bug 486331
gnome-phone-manager does not select the corrent bluetooth channel
Last modified: 2007-10-22 11:17:56 UTC
Please describe the problem: gnome-phone-manager does not select the correct bluetooth channel. It works if a phone uses channel is 0 as that is the default for gnokii anyway, but for phones that use another channel it fails Steps to reproduce: 1. Try to connect to a phone that does not use the default channel 2. 3. Actual results: gnome-phone-manager tries to connect again and again and again in a loop. This is due to a timeout as the rfcomm listener on channel 0 (at least on my phone) does not respond to AT commands Expected results: It should just connect Does this happen every time? Yes Other information: gnokii uses config parameter "rfcomm_channel", while gnome-phone-manager incorrectly sets the variable "channel"
Created attachment 97167 [details] [review] patch to fix the problem with "channel" vs the correct "rfcomm_channel" This also adds debuging support. I don't know what the best way to turn on and off this debugging would be: environment variable? gconf?
Where do you see that gnokii uses rfcomm_channel as opposed to channel? Please separate the debugging into another issue.
(In reply to comment #2) > Where do you see that gnokii uses rfcomm_channel as opposed to channel? /usr/share/doc/gnokii-0.6.18/sample/gnokiirc (rfcomm_channel is also mentioned in the Changelog while channel is not) ./common/cfgreader.c line 499 (Also this change is needed to make my phone work..) > Please separate the debugging into another issue. Ok.
(In reply to comment #0) > Please describe the problem: > gnome-phone-manager does not select the correct bluetooth channel. It works if > a phone uses channel is 0 as that is the default for gnokii anyway, but for > phones that use another channel it fails Gnokii's default is actually channel 1: gn_config_default.rfcomm_cn = 1; 2007-10-14 Bastien Nocera <hadess@hadess.net> * libgsm/phonemgr-utils.c: (phonemgr_utils_write_config): Really use the right channel to connect to a phone, as gnokii uses rfcomm_channel, not channel in its config spotted by Malcolm Caldwell <malcolm.caldwell@cdu.edu.au> (Closes: #486331)
(In reply to comment #4) > (In reply to comment #0) > > Please describe the problem: > > gnome-phone-manager does not select the correct bluetooth channel. It works if > > a phone uses channel is 0 as that is the default for gnokii anyway, but for > > phones that use another channel it fails > > Gnokii's default is actually channel 1: > gn_config_default.rfcomm_cn = 1; > > 2007-10-14 Bastien Nocera <hadess@hadess.net> > > * libgsm/phonemgr-utils.c: (phonemgr_utils_write_config): > Really use the right channel to connect to a phone, as gnokii > uses rfcomm_channel, not channel in its config > spotted by Malcolm Caldwell <malcolm.caldwell@cdu.edu.au> > (Closes: #486331) > I think this bug is not yet solved. I have a Sony Ericsson K800i and the rfcomm channel for Dialup Networking is 2. gnokii --identify works but g-phone-manager doesn't connect.
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #0) > > > Please describe the problem: > > > gnome-phone-manager does not select the correct bluetooth channel. It works if > > > a phone uses channel is 0 as that is the default for gnokii anyway, but for > > > phones that use another channel it fails > > > > Gnokii's default is actually channel 1: > > gn_config_default.rfcomm_cn = 1; > > > > 2007-10-14 Bastien Nocera <hadess@hadess.net> > > > > * libgsm/phonemgr-utils.c: (phonemgr_utils_write_config): > > Really use the right channel to connect to a phone, as gnokii > > uses rfcomm_channel, not channel in its config > > spotted by Malcolm Caldwell <malcolm.caldwell@cdu.edu.au> > > (Closes: #486331) > > > > I think this bug is not yet solved. I have a Sony Ericsson K800i and the rfcomm > channel for Dialup Networking is 2. gnokii --identify works but g-phone-manager > doesn't connect. Which channel does it select instead then?
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > (In reply to comment #0) > > > > Please describe the problem: > > > > gnome-phone-manager does not select the correct bluetooth channel. It works if > > > > a phone uses channel is 0 as that is the default for gnokii anyway, but for > > > > phones that use another channel it fails > > > > > > Gnokii's default is actually channel 1: > > > gn_config_default.rfcomm_cn = 1; > > > > > > 2007-10-14 Bastien Nocera <hadess@hadess.net> > > > > > > * libgsm/phonemgr-utils.c: (phonemgr_utils_write_config): > > > Really use the right channel to connect to a phone, as gnokii > > > uses rfcomm_channel, not channel in its config > > > spotted by Malcolm Caldwell <malcolm.caldwell@cdu.edu.au> > > > (Closes: #486331) > > > > > > > I think this bug is not yet solved. I have a Sony Ericsson K800i and the rfcomm > > channel for Dialup Networking is 2. gnokii --identify works but g-phone-manager > > doesn't connect. > > Which channel does it select instead then? > I don't know. I tried to put channel = 2 in .gnokiirc but g-p-m still can't connect. xgnokii seems to work fine, pulling SMS and contacts.
Created attachment 97594 [details] sdptool browse sdptool browse with Sony Ericsson K800i
(In reply to comment #7) <snip> > I don't know. I tried to put channel = 2 in .gnokiirc but g-p-m still can't > connect. xgnokii seems to work fine, pulling SMS and contacts. It's rfcomm_channel, not channel. Would you mind checking whether it works with gnokii, puttin rfcomm_channel in the .gnokiirc? Also, could you add g_message () outputs in phonemgr-utils.c where it uses the channel to check if all the values used are correct?
(In reply to comment #9) > (In reply to comment #7) > <snip> > > I don't know. I tried to put channel = 2 in .gnokiirc but g-p-m still can't > > connect. xgnokii seems to work fine, pulling SMS and contacts. > > It's rfcomm_channel, not channel. Would you mind checking whether it works with > gnokii, puttin rfcomm_channel in the .gnokiirc? > > Also, could you add g_message () outputs in phonemgr-utils.c where it uses the > channel to check if all the values used are correct? > I didn't make myself understood, I already use rfcomm_channel = 2 in .gnokiirc but g-p-m doesnt recognize it. I don't understand C very much, I tried to put a g_message(channel); in phonemgr-utils.c in "find_dun_channel" and "get_rfcomm_channel" right before the return(channel); but I can't find any msg about which channel g-p-m is using. I have basic C development skills.
(In reply to comment #10) <snip> > I didn't make myself understood, I already use rfcomm_channel = 2 in .gnokiirc > but g-p-m doesnt recognize it. g-p-m doesn't use ~/.gnokiirc, it generates the configuration in-memory, on the fly. > I don't understand C very much, I tried to put a g_message(channel); in > phonemgr-utils.c in "find_dun_channel" and "get_rfcomm_channel" right before > the return(channel); but I can't find any msg about which channel g-p-m is > using. I have basic C development skills. The line should be: g_message ("in function bleh, channel is %d", channel); You can pepper that whenever "channel" is used in the code, in both phonemgr-listener.c and phonemgr-utils.c
(In reply to comment #11) > (In reply to comment #10) > <snip> > > I didn't make myself understood, I already use rfcomm_channel = 2 in .gnokiirc > > but g-p-m doesnt recognize it. > > g-p-m doesn't use ~/.gnokiirc, it generates the configuration in-memory, on the > fly. > > > I don't understand C very much, I tried to put a g_message(channel); in > > phonemgr-utils.c in "find_dun_channel" and "get_rfcomm_channel" right before > > the return(channel); but I can't find any msg about which channel g-p-m is > > using. I have basic C development skills. > > The line should be: > g_message ("in function bleh, channel is %d", channel); > > You can pepper that whenever "channel" is used in the code, in both > phonemgr-listener.c and phonemgr-utils.c > I've used your line in both phonemgr-listener.c and phonemgr-utils.c but I still can't see any messages about the channel, none at console or gui. The outcome is always this: ** Message: bdaddr 00:1B:59:52:99:41 ** Message: New connection device is 00:1B:59:52:99:41 (changed) ** Message: New connection device is 00:1B:59:52:99:41 (not changed) ** Message: Connecting... ** Message: Status 1 ** Message: Making serial port connection conn_complete: status 0x00 ** (gnome-phone-manager:29609): WARNING **: gn_gsm_initialise: Command timed out. ** Message: Failed connection to device on 00:1B:59:52:99:41 ** Message: Exiting connect thread
Created attachment 97596 [details] [review] gpm-debug.patch That's with my debug: ** Message: Connecting... ** Message: Status 1 ** Message: Making serial port connection conn_complete: status 0x00 ** Message: channel1 1 ** Message: channel2 1 ** Message: Using driver '6230' ** Message: Status 2 ** Message: Serial port connected ** Message: Connected to device on 00:12:D2:79:B7:33
(In reply to comment #13) > Created an attachment (id=97596) [edit] > gpm-debug.patch > > That's with my debug: > ** Message: Connecting... > ** Message: Status 1 > ** Message: Making serial port connection > conn_complete: status 0x00 > ** Message: channel1 1 > ** Message: channel2 1 > ** Message: Using driver '6230' > ** Message: Status 2 > ** Message: Serial port connected > ** Message: Connected to device on 00:12:D2:79:B7:33 > I'm sorry, I owe you a couple of beers. When I applied your patch, nothing happened. It was strange that my code wouldn't do nothing, but yours too? I investigated a little more and I found out that I was actually using an old binary in /usr/local/bin and my new compiled g-p-m was never being used. Yep, this was really dumb and a waste of your time. Everything is working, including your patch. Apologies and thank you for your work.
No worries, just glad it's working! Closing this bug then.