LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Bluetooth no serial connection with cell modem (https://www.linuxquestions.org/questions/slackware-14/bluetooth-no-serial-connection-with-cell-modem-4175436480/)

joenew 11-09-2012 06:50 PM

Bluetooth no serial connection with cell modem
 
I've:
A fresh installed slackware-14.0 system.
A nokia cell phone with bluetooth activated.
A usb bluetooth dongle.

I use to setup a serial connection between internal cell modem and linux by bluetooth.

But now with slackware-14.0 it's not work.
I'm using xfce DE and blueman-manager.
I can pair my cell with usb dongle...
I can create a serial comunication and the system make a dev file /dev/rfcomm0.
But if i try to comunicate with it, for example via minicom...
something goes wrong. I'm not able to send any AT command, minicom terminal rest all black....
And also pppd scripts failed when I try to connect to internet.

Where could be the matter...
And how to looking for the problem?

Hope you can help.
Thanks in advance, sorry for my poor english...
Bye! ;)

markush 11-10-2012 03:50 PM

Hello joenew,

did it work with an earlier version of Slackware? which one?

Could you please post the errormessages when ppp fails?

And could you please post your pppd scripts?

Markus

joenew 11-11-2012 07:18 AM

Hi Markush and thanks for your reply! :)

My default old notebook running Slackware-13.1 works fine, I can use my cell as modem (/dev/rfcomm0) connected via bluetooth.
I've used same config in older slackware versions too: 12.2 12.1 and 11.0.
Pppd and chat scripts are the same I've ever used in past times. Bluetooth usb dongle is the same as well as the phone used.

Now I'm trying to make working bluetooth communication with my phone on Slackware-14.0, on a Acer Aspire One netbook...

I think the first step is to create a well working serial connection with my cell through bluetooth. But It seems somethig goes wrong at this point yet...
I've used to verify communication via bluetooth serial connection to the phone with minicom.
And this try fails...
As I said I obtain a black minicom screen. No initializing AT commands are shown as usual.

So problems don't seem to be at pppd session time, I think comes first.
Anyway, I'll post to you my pppd script and connection session log so you can verify.

markush 11-11-2012 07:33 AM

Hi,

did you change anything compared with earlier Slackwaresystems (for example at the firewall)?

Coulden't you connect the cellphone via USB to the computer and try out if it then works? I mean, it isn't actually clear if the bluetooth or the pppd connection fails.

As far as I understand. I don't have experience with Bluetooth on Linux, how can one check a bluetooth connection?

Markus

joenew 11-11-2012 08:25 AM

Aspire One Slackware-14.0 is fresh, I didn't set up any firewall or something similar that could interfer in connection...

Here we have my two ppp scripts:
Code:

root@darkstar:~# cat /etc/ppp/peers/btwap
/dev/rfcomm0 115200
connect '/usr/sbin/chat -v -f /etc/ppp/wap.chat'
noauth
novj
novjccomp
mru 1500
mtu 1500
debug
defaultroute

Code:

root@darkstar:~# cat /etc/ppp/wap.chat
'' \d
'' 'atz'
'' 'at+cgatt=1'
OK 'at+cgdcont=1,"IP","ibox.tim.it"'
OK 'atd*99***1#'

I've cancelled all associated devices on my phone menu.
I've activated bluetooth on AspireOne (slack-14.0) running bluetoothd.
I've paired phone using blueman in Xfce.
I've create a serial connection (COM1 port) between netbook and phone. It has created a new device calles as usual /dev/rfcomm0, as you can see above, my pppd script uses it.
Ok... taht's all. Now let's go and look at pppd session:
Code:

Nov 11 15:36:03 darkstar kernel: [  389.582478] PPP generic driver version 2.4.2
Nov 11 15:36:03 darkstar pppd[2169]: pppd 2.4.5 started by root, uid 0
Nov 11 15:36:04 darkstar chat[2171]: send (\d^M)
Nov 11 15:36:05 darkstar chat[2171]: send (atz^M)
Nov 11 15:36:05 darkstar chat[2171]: send (at+cgatt=1^M)
Nov 11 15:36:05 darkstar chat[2171]: expect (OK)
Nov 11 15:36:05 darkstar chat[2171]: ^Matz^M^M
Nov 11 15:36:05 darkstar chat[2171]: OK
Nov 11 15:36:05 darkstar chat[2171]:  -- got it
Nov 11 15:36:05 darkstar chat[2171]: send (at+cgdcont=1,"IP","ibox.tim.it"^M)
Nov 11 15:36:06 darkstar chat[2171]: expect (OK)
Nov 11 15:36:06 darkstar chat[2171]: ^M
Nov 11 15:36:06 darkstar chat[2171]: at+cgatt=1^Ma^M
Nov 11 15:36:06 darkstar chat[2171]: OK
Nov 11 15:36:06 darkstar chat[2171]:  -- got it
Nov 11 15:36:06 darkstar chat[2171]: send (atd*99***1#^M)
Nov 11 15:36:06 darkstar pppd[2169]: Serial connection established.
Nov 11 15:36:06 darkstar pppd[2169]: Using interface ppp0
Nov 11 15:36:06 darkstar pppd[2169]: Connect: ppp0 <--> /dev/rfcomm0
Nov 11 15:36:07 darkstar pppd[2169]: Serial line is looped back.
Nov 11 15:36:07 darkstar pppd[2169]: Connection terminated.
Nov 11 15:36:08 darkstar pppd[2169]: Exit.

Mmmm... seems serial connection between cell-modem and slackware worked, cause for AT commands are shown many true responses "OK" by the modem.
But at the end PPP session failed.
Anyway if I try to communicate throgh minicom, it failed... So there is somethig not working...

Very strange....

I don't have a usb cable for that phone, I ever used it via bluetooth.
But I can try with a mobile connection usb dongle... I have to modify some ppp script for that try...

Thanks for your help by now.

joenew 11-11-2012 08:37 AM

Ahhrrrg!!!
My wap script is wrong... That's the cause of failed connection!

I've missed right APN "wap.tim.it" and not "ibox.tim.it"....
Now I've tried... and it seems work fine...

Sorry for my boring question!

Also minicom seems now work good!
There isn't any AT initializing automatic command, but if i try to type some AT command it reply with OK...
So... problem seem solved....

PS.
I'm using Xfce, I've not KDE intalled cause netbook HD is too small.
I can use network manager or something similar to create a new PPP connection via bluetooth serial rfcomm0?

lkraemer 11-11-2012 09:00 AM

Will you please issue the following commands to see what groups you are a member of:
Code:

cat /etc/group
You need to be a member of dialout.

Code:

usermod -a –G dialout username

To locate the possible COMM PORTS in Linux, copy and paste the following commands with the USB Modem plugged in:
Code:

ls -l /dev/ttyS*
ls -l /dev/ttyU*
ls -l /dev/ttyA*
ls -l /dev/rfc*

Notice that ttyS0 through ttyS3 are detected as shown. You may have /dev/ttyUSB0 or /dev/ttyACM0 if it was properly detected.

Code:

crw-rw---- 1 root dialout 4, 64 2009-11-27 15:26 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2009-11-27 15:26 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 2009-11-27 15:26 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 2009-11-27 15:26 /dev/ttyS3

As root
Code:

stty –F /dev/ttyS0 –a
Dumps the selected port settings.

Code:

chmod a+rw /dev/ttyS0
Gives ‘all’ permission to use ttyS0


Code:

gphoto2 --list-ports
gives more port information.


Code:

cat ABCDEFGHIJKLMNOPQRSTUVWXYZ  >/dev/ttyS0
Sends alphabet out /dev/ttyS0 to minicom, or some terminal program.



LINKING the COMM PORT: SYMBOLIC vs HARD
To locate the possible COMM PORTS in Linux, copy and paste the following commands with the USB to RS-232C Adapter plugged in:
Code:

ls -l /dev/ttyS*
ls -l /dev/ttyU*
ls -l /dev/ttyA*
ls -l /dev/rfc*

Notice that ttyS0 through ttyS3 are detected as shown. You may have /dev/ttyUSB0 if it was properly detected.
Mine was NOT, because it was a Sabrent SBT-USC1M USB to Serial Converter, and it was /dev/ACM0. I used wvdial
and wvdial didn't detect /dev/ACM0 so I created a link from /dev/ttyS3 to /dev/ACM0

Code:

crw-rw---- 1 root dialout 4, 64 2009-11-27 15:26 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2009-11-27 15:26 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 2009-11-27 15:26 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 2009-11-27 15:26 /dev/ttyS3

I couldn't make a symbolic link work, so I decided to create a hard link, replacing /dev/ttyS3.
First remove /dev/ttyS3.
I'd suggest you try a Symbolic link first, then a Hard link if the Symbolic doesn't work.

Code:

su -
rm /dev/ttyS3
ln -s /dev/ttyACM0 /dev/ttyS3
exit

For a Hard Link use: sudo ln /dev/ttyACM0 /dev/ttyS3
REMEMBER to REMOVE the Symbolic Link first.

Running the command again:
Code:

ls -l /dev/ttyS*
gives:
Code:

crw-rw---- 1 root dialout 4, 64 2010-11-10 11:59 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2010-11-10 11:59 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 2010-11-10 11:59 /dev/ttyS2
crw-rw---- 2 root dialout 166, 0 2010-11-10 12:59 /dev/ttyS3

If you don't have rw priviledges remove /dev/ttyS3 and create it again.

You can determine the Baud rate of the Port.
Code:

man stty
Find the Baud Rate:
Code:

stty -F /dev/ttyS3 -a
and to change it to 9600:
Code:

stty -F /dev/ttyS3 9600
stty -F /dev/ttyS3 -a

If you connect to a modem for testing you can transmit out an "ATZ" causing the Modem to flash the lights and reset with:
Code:

echo ATZ > /dev/ttyS3
Which proves characters routed to /dev/ttyS3 get sent to /dev/ttyACM0,




SETUP PAP or CHAP:
You will need to set up the pap-secrets and/or chap-secrets file by running the following in a Terminal
Window: ( /etc/ppp/pap-secrets OR /etc/ppp/chap-secrets )
Code:

su -
pppconfig
exit

You will need your userlogin, password, ISP provider information, and pap or chap information for the connection.
(You can set up pap and then chap, if pap doesn't work.) Basically you just answer the questions that are presented.
You can delete a configurations, and start over if you need to from the menu selections.

For more information try:
Code:

man pppd
man pppconfig



Minicom:
While I haven't used minicom, I did find some documentation on how to set it up.

http://openmaniak.com/minicom.php
http://www.linux-tutorial.info/modul...m-minicom.html

To configure minicom for modem use, the following command is used:
Code:

minicom -o console
to start Minicom without sending an initialization string to the modem. Now issue the code:
Code:

AT
commands to configure the modem.

ie, ATZ will RESET the MODEM




Larry

joenew 11-12-2012 04:12 PM

Thank you for your answer Larry!
Hope this topic is usefull for other users too.

PS.
I'm now looking for a way to setup connection by Blueman and Network-manager...
Seems that NM isn't able to see bluetooth device connected via Blueman as DUN (dial up network).
If I'll not solve, I'll open a new topic...


All times are GMT -5. The time now is 06:24 AM.