Sending nokia AT-commands via bluetooth
Today i succeeded in completing a small Visual basic program that can send instructions via bluetooth to a Nokia (or other AT-commands) cell phones. AT commands where used to communicate directly to the Nokia cell phones. I was struggling for a long time to make a proper connection, i have tried some different Nokia protocols, in fact there are three. The standard At commands, the Mbus and the newer Fbus. There are many sites where you can lookup the supported format.
Although to make a connection with the PC i buy a serial data cable, yes the old serial ones, because we want to connect it lateron to a microcontroller.
To connect it to the pc i must use a usb to serial adapter, because i don’t have a serial port anymore. Like the most of us, i hope ;). Like i said before, i can’t get a proper connection through the cable for a long time, i have tried almost everything. So i came up the idea of using bluetooth instead. It was in fact really easy by then. All the ’simple’ AT commands worked properly. So why didn’t the cable work? I think its about the usb- serial adapter, that have its on drivers. The strange thing is a demo application called: Lylix worked good with (only) the Fbus protocol.
On the other hand, using bluetooth is easier then connecting a cable again and again..
So now the solution or rather called, tutorial:
First check of you (Nokia) phone supports AT commands and have bluetooth. We use a nokia 6021
Second get yourself a bluetooth connection, for example buy a bluetooth dongle.
1) Now we need to setup a COM port connection.
We use IVT BlueSoleil found here: http://www.bluesoleil.com/
We briefly discuss how to setup a connection. For more info, look at the original site bluesoleil.com
- When you don’t see a phone, make sure the bluetooth is anabled on the phone itselfs. Then hit the Orange button.
- The phone should appear.
- Next step is to right click on the phone and choose something like “link” (i have a dutch version).
- If needed you must enter a code on both phone and pc.
- Hit the serial cable icon to make a COM port connection
- A good connected phone looks like the image below…
- Final right click on the phone and select ’status’ Now write down your virtual comport! In our case its COM port 4

2)Testing in the hyperterminal.
Before using the Visual basic program it’s recommend to test first the connection in the Hyperterminal program!
- open hyperterminal, START -> All programs -> Bureau accessories -> communicate -> hyperterminal
- choose file - New connction
- Select right COM port, in our case COM 4
- Change the settings to: 9600, 8, parity No, stop bit 1, flow: None
To test a connection Type “AT” (without the quotes) then hit enter
- NOTE: if the connection is good, the phone returns OK.

You can now check some AT commands for a good understanding an check if all AT commands are supported. In case, not all AT are supported usually!
AT+CSQ
returns Signal strength
AT+CBC
returns Battery Charge
AT+CGMM
returns model number
and so on… A lot of information about AT commands can be found here: http://www.developershome.com/sms/atCommandsIntro.asp
3) Visual basic program
First off all we explain al little about what for the program is designed.. If you have read the other articles on Labcoding you probably should have read something about gps tracking. The main goal of this PC to phone connection is to setup a 2 way connection on two mobile phones, one connected to the PC and one Connected at a microcontroller / gps module.
The basic idea is to send a ‘request’ sms to the phone connected to the microcontroller / gps module, this phone sends back the gps location data..
The visual basic program must therefor send a request sms and read incoming sms, then the sms data must be saved in a xml or kml file.
See also our earlier article: real-time-gps-tracking-through-a-simple-txt-file
The Visual Basic 2008 test or better called beta program is just a simple explanation on how to send a SMS trough AT commands.
- Note: Again this is just a real simple (buggy) code for testing the basics. Feel free to use the code and to adjust it.

Basicaly You just have to reset the COM port and Phone number. Then Hit the sms button And the text in the field: GetPosition will be sent to that number. For testing you can use your own number, sent yourself an sms!
The debuggin section can be used to just
Here’s the beta code:
The real sending part is:
- SerialPort1.Write(“AT+CMGS=” & quote & NummerBox.Text & quote & Chr(+13))
- SerialPort1.Write(TextBox3.Text + Chr(+26) + Chr(+13))
- TextBox3.Text = “Sms sended”
NummerBox.Text contains the number you typed into the box.
Chr(+13) is used for ’saying’ this is the end of the command.
Chr(+26) is only to say, this is the end of the sms message. Otherwise use Chr(+13) …
Download the example code:
Keep checking our site, more codes and updates are posted frequently!
No Comments
Make A CommentNo comments yet.
Comments RSS Feed TrackBack URL






