View previous topic :: View next topic |
Author |
Message |
PezAreYummy n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 11 Oct 2005 Posts: 35
|
Posted: Tue Jul 25, 2006 10:15 pm Post subject: How to issue AT Commands? [SOLVED] |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Philantrop Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
Joined: 21 Dec 2004 Posts: 1130 Location: Germany
|
Posted: Tue Jul 25, 2006 10:38 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
PezAreYummy n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 11 Oct 2005 Posts: 35
|
Posted: Tue Jul 25, 2006 11:55 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
shade n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Blade Runner/movie_blade_runner_leon.gif)
Joined: 22 Apr 2002 Posts: 9
|
Posted: Wed Jul 26, 2006 12:13 am Post subject: |
|
|
Minicom also works well. ![Very Happy :D](images/smiles/icon_biggrin.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
PezAreYummy n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 11 Oct 2005 Posts: 35
|
Posted: Wed Jul 26, 2006 12:45 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
shade n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Blade Runner/movie_blade_runner_leon.gif)
Joined: 22 Apr 2002 Posts: 9
|
Posted: Wed Jul 26, 2006 1:26 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
PezAreYummy n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 11 Oct 2005 Posts: 35
|
Posted: Wed Jul 26, 2006 3:50 am Post subject: |
|
|
Yeah, I suppose the phone model would be helpful eh? It's a Sony Ericsson z520a |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Philantrop Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
Joined: 21 Dec 2004 Posts: 1130 Location: Germany
|
Posted: Wed Jul 26, 2006 4:35 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
PezAreYummy n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 11 Oct 2005 Posts: 35
|
Posted: Wed Jul 26, 2006 5:07 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Philantrop Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
Joined: 21 Dec 2004 Posts: 1130 Location: Germany
|
Posted: Wed Jul 26, 2006 5:13 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
PezAreYummy n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 11 Oct 2005 Posts: 35
|
Posted: Wed Jul 26, 2006 5:32 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|