Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to issue AT Commands? [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
PezAreYummy
n00b
n00b


Joined: 11 Oct 2005
Posts: 35

PostPosted: Tue Jul 25, 2006 10:15 pm    Post subject: How to issue AT Commands? [SOLVED] Reply with quote

I'm interested in issuing AT commands to my cell phone over bluetooth. I can connect to my phone just fine using rfcomm, but once connected I am unsure of the best way to issue AT commands to the phone. I'd like to be able to do this both from the command line and from a script. Thanks for any information.

Last edited by PezAreYummy on Wed Jul 26, 2006 5:32 am; edited 1 time in total
Back to top
View user's profile Send private message
Philantrop
Retired Dev
Retired Dev


Joined: 21 Dec 2004
Posts: 1130
Location: Germany

PostPosted: Tue Jul 25, 2006 10:38 pm    Post subject: Reply with quote

You should be able to simply use

Code:
echo "ATZ" > /dev/<your device>


That's what I used in scripts, etc. :-)
_________________
If you feel the issues discussed in this thread have been resolved, please add a "[Solved]" to the subject of your original posting.
Back to top
View user's profile Send private message
PezAreYummy
n00b
n00b


Joined: 11 Oct 2005
Posts: 35

PostPosted: Tue Jul 25, 2006 11:55 pm    Post subject: Reply with quote

Awesome! Sorry to ask stupid questions, but how do I then get the reply from my phone? I try cat /dev/rfcomm0 and I get a bunch of crap comming out that seem to be multiple errors, but I only gave it one command.
Back to top
View user's profile Send private message
shade
n00b
n00b


Joined: 22 Apr 2002
Posts: 9

PostPosted: Wed Jul 26, 2006 12:13 am    Post subject: Reply with quote

Minicom also works well. :D
Back to top
View user's profile Send private message
PezAreYummy
n00b
n00b


Joined: 11 Oct 2005
Posts: 35

PostPosted: Wed Jul 26, 2006 12:45 am    Post subject: Reply with quote

Thank you for your replies guys. And again, I appologize for my inexperience. I looked at minicom, but it seemed a bit sophisticated for my tastes, besides I couldn't figure out how to change the serial port to /dev/rfcomm0.

I've been playing around a bit. and if I enter a command as simple as

Code:
echo "AT" > /dev/rfcomm0


My phone just spits back

Code:
ERROR


ERROR



ERROR



ERROR


It continues to send me this ERROR message until I disconnect. The documentation on my phone says to send it the initialization string AT&F. When I do this, I get the never ending ERROR messages as well. The information on this topic seems to jump from absolute beginner, to advanced very quickly. Is there some other command I should be sending to my phone before I send AT commands? Does anyone know anywhere I could get some more information on this? I would really like the idea of just
Code:
echo "AT<command>" > /dev/rfcomm0
if I can get it to work.
Back to top
View user's profile Send private message
shade
n00b
n00b


Joined: 22 Apr 2002
Posts: 9

PostPosted: Wed Jul 26, 2006 1:26 am    Post subject: Reply with quote

Code:
# minicom -s

Will get you to the setup screen, from there you can make all your modifcations, including the init string and port.
Just curious here, but what type of phone are you attempting to talk to?
Back to top
View user's profile Send private message
PezAreYummy
n00b
n00b


Joined: 11 Oct 2005
Posts: 35

PostPosted: Wed Jul 26, 2006 3:50 am    Post subject: Reply with quote

Yeah, I suppose the phone model would be helpful eh? It's a Sony Ericsson z520a
Back to top
View user's profile Send private message
Philantrop
Retired Dev
Retired Dev


Joined: 21 Dec 2004
Posts: 1130
Location: Germany

PostPosted: Wed Jul 26, 2006 4:35 am    Post subject: Reply with quote

I've checked my old scripts again and found that I used /usr/bin/echo (in contrast to bash's internal echo command):

Quote:
# Reload factory settings
/usr/bin/echo -e at\&F\\r > /dev/ttyS1


The above still works for me today.
_________________
If you feel the issues discussed in this thread have been resolved, please add a "[Solved]" to the subject of your original posting.
Back to top
View user's profile Send private message
PezAreYummy
n00b
n00b


Joined: 11 Oct 2005
Posts: 35

PostPosted: Wed Jul 26, 2006 5:07 am    Post subject: Reply with quote

I tried specifying /usr/bin/echo and got the same results. The phone is definitely receiving the command and responding to them. It is just responding with an ERROR when I don't think it should. I'm just not sure where to look now for the solution.
Back to top
View user's profile Send private message
Philantrop
Retired Dev
Retired Dev


Joined: 21 Dec 2004
Posts: 1130
Location: Germany

PostPosted: Wed Jul 26, 2006 5:13 am    Post subject: Reply with quote

You tried the command exactly as I posted it and your phone still responded with "ERROR"? In that case I'm really out of ideas, sorry.

Of course, there are lots of tools like minicom but if a simple "echo" doesn't do the job I'm not too hopeful about using them.
_________________
If you feel the issues discussed in this thread have been resolved, please add a "[Solved]" to the subject of your original posting.
Back to top
View user's profile Send private message
PezAreYummy
n00b
n00b


Joined: 11 Oct 2005
Posts: 35

PostPosted: Wed Jul 26, 2006 5:32 am    Post subject: Reply with quote

Well...I've been playing around a lot tonight and it turns out that I misread the information from sdptool browse. I had the wrong channel on rfcomm. I was trying to send AT commands to some sort of voice gateway. Sorry about all the trouble guys, and thank you very much for the echo trick. Exactly what I need.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum