AT-command mode in CoolTerm (2.0.0)

If you have specific questions or problems with any of my Freeware applications, post them here.
Post Reply
tnm
Posts: 11
Joined: Tue Oct 04, 2022 2:28 am

AT-command mode in CoolTerm (2.0.0)

Post by tnm »

Hi,
Does CoolTerm support AT command mode?
If it does, how do you set it up?

tnm, .
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: AT-command mode in CoolTerm (2.0.0)

Post by roger »

Hi,

Support for AT commands is provided by the hardware that is connected to CoolTerm, and not CoolTerm itself. Different hardware may support different AT command sets and may have different ways to enable AT command mode.

As an example, for the ESP-01 module, AT command mode is turned on by default. As soon as you connect via any serial terminal (including CoolTerm), you can type AT and the module will respond with OK. More information

Other hardware may not start up in AT command mode and may require a special command to enter AT command mode. For example, the BlueRadios module requires typing +++ into the serial terminal to enter AT command mode.

On the other hand, some hardware may require changing the signal level on an I/O pin to enter AT command more, such as the Bluefruit BLE UART Friend.

To summarize, CoolTerm is compatible with all serial hardware that support AT commands. How to enter AT command mode is determined solely by the hardware.
tnm
Posts: 11
Joined: Tue Oct 04, 2022 2:28 am

Re: AT-command mode in CoolTerm (2.0.0)

Post by tnm »

Hi Roger,
Thanks for the comprehensive answer.

In my case, the connected device is a pl2303-based USB-UART adapter with a USB cable plus a Bluetooth module. The serial port of this device is COM5.

This device supports AT commands.

AT commands are entered from a smartphone with app Serial Bluetooth Terminal installed.

Such a real system, but not with CoolTerm on the computer side, is shown in the video https://www.youtube.com/watch?v=hNxqoZvTX0c

What settings in CoolTerm will provide AT command mode on COM5?

tnm
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: AT-command mode in CoolTerm (2.0.0)

Post by roger »

Once you are connected to COM5 (make sure you press "Connect" and that the status line says "Connected"), you can simply type your AT commands using the keyboard. It might be easier using "Line Mode". To enable Line Mode, go to the settings, then go to the "Terminal" options, and then select "Line Mode" from the Terminal Mode options. This will give you a command linen the terminal window. Type the AT commands into this line and press the Enter key. This will send the AT command to your module via COM5.

Roger
tnm
Posts: 11
Joined: Tue Oct 04, 2022 2:28 am

Re: AT-command mode in CoolTerm (2.0.0)

Post by tnm »

Once you are connected to COM5 (make sure you press "Connect" and that the status line says "Connected"), you can simply type your AT commands using the keyboard. … This will send the AT command to your module via COM5.

Hi Roger,
I followed the settings you suggested.

In the Line Mode, CoolTerm displayed (in View Plain format):
AT+NAME
OKname

In the Raw Mode, CoolTerm displayed (in View Plain format):
AT+NAME . .
Here, the Enter key is displayed as two dots.

Result: In both Line Mode and Raw Mode, CoolTerm displayed the NAMES of the AT commands on the terminal screen, not the requested INFORMATION.

So AT commands have not been sent to my module via COM5.

Conclusion: The CoolTerm associated with the device in question cannot by itself run in AT command mode.

Interesting moments:

1) The COM port of the device depends on which USB port of the laptop it is connected to. On my laptop, if on the left - COM3, if on the right - COM5.

2) After clicking the "Rescan Serial Ports" button, CoolTerm AUTOMATICALLY determines the device's COM port. The COM port defined in such way is the same as the one shown by the Device Manager.

3) In Raw Mode, the characters typed from the keyboard appear in the terminal output window with a time delay.

What are the following options for:

Input Drive Name: \\.\COM5
Output Drive Name: \\.\COM5
Rated Speed: 230400
Maximum Speed: 230400

(see: [CoolTem_Win7.std] -> [Options] -> [Serial Port Options] -> [Port]
-> [bevel]) ?

Thanks,
tnm
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: AT-command mode in CoolTerm (2.0.0)

Post by roger »

tnm wrote: Sat Oct 29, 2022 1:54 am In the Line Mode, CoolTerm displayed (in View Plain format):
AT+NAME
OKname

In the Raw Mode, CoolTerm displayed (in View Plain format):
AT+NAME . .
Here, the Enter key is displayed as two dots.

Result: In both Line Mode and Raw Mode, CoolTerm displayed the NAMES of the AT commands on the terminal screen, not the requested INFORMATION.

So AT commands have not been sent to my module via COM5.

Conclusion: The CoolTerm associated with the device in question cannot by itself run in AT command mode.
I wouldn't necessarily say that. From your description, your device responded with "OK", correct? This means that the connection is working and that the device is responding to AT commands. So, I would say it's ALMOST working. It's probably just a matter of properly formatting and entering the AT commands. Is the documentation for your module available online? If so, can you post a link here? Perhaps we can find the necessary information to get this working fully.
Interesting moments:

1) The COM port of the device depends on which USB port of the laptop it is connected to. On my laptop, if on the left - COM3, if on the right - COM5.
Yes, Windows has a funny way of assigning serial port names. The USB port in your laptop on either side are probably connected to two different USB controllers. This can also happen if you use an external USB hub. It is very likely to get a different COM port name if you plug in your device into the hub compared to when you plug in your device directly into your computer.
2) After clicking the "Rescan Serial Ports" button, CoolTerm AUTOMATICALLY determines the device's COM port. The COM port defined in such way is the same as the one shown by the Device Manager.
This only happens when there is only one COM port. "Rescan Serial Ports" will select the first available COM port after it's done scanning. If you have multiple COM ports, and one of them is already selected when you clock "Rescan Serial Ports", CoolTerm will keep the selection.
3) In Raw Mode, the characters typed from the keyboard appear in the terminal output window with a time delay.
The characters you see in the screen when you type in Raw Mode are the characters sent back from the serial device. This means that the plugged in device is echoing the typed characters. The delay is caused by the serial device.
What are the following options for:

Input Drive Name: \\.\COM5
Output Drive Name: \\.\COM5
Rated Speed: 230400
Maximum Speed: 230400

(see: [CoolTem_Win7.std] -> [Options] -> [Serial Port Options] -> [Port]
-> [bevel]) ?
The bevel button is there to display information about the currently selected serial port. This is the information that the driver provides to the operating system.
tnm
Posts: 11
Joined: Tue Oct 04, 2022 2:28 am

Re: AT-command mode in CoolTerm (2.0.0)

Post by tnm »

Hi Roger,
You wrote:

From your description, your device responded with "OK", correct? This means that the connection is working and that the device is responding to AT commands. So, I would say it's ALMOST working. It's probably just a matter of properly formatting and entering the AT commands. Is the documentation for your module available online? If so, can you post a link here? Perhaps we can find the necessary information to get this working fully.
My Bluetooth module is SPP-C.

You can download the SPP-C datasheet from the website

https://electropeak.com/learn/interfacing-spp-c-bluetooth-to-serial-adapter-module-with-arduino/

This datasheet is given in .pdf format.

I hope this is what we need.

tnm
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: AT-command mode in CoolTerm (2.0.0)

Post by roger »

tnm wrote: Mon Oct 31, 2022 5:43 amI hope this is what we need.
OK, thanks. Yes the datasheet has useful information.

The table under the "Status Indicator LED: P12" title on page 6 shows the two modes of the module:
  • Pairing Mode: LED is flashing
  • Connected (via Bluetooth): LED is constantly on
The next page (page 7), under the "Instruction Set Description" title, talks about AT commands. From that we can glean the following:
  • "AT command mode" is only active when the module is in "Pairing Mode". Thus, whenever the LED is blinking, the module accepts AT commands via the serial port.
  • When the module is connected to another computer via Bluetooth (when the LED is constantly on), it is in "transparent mode". When in this mode, the module will transmit anything received via the serial port to the Bluetooth connection. Also, any data received via the bluetooth connection will be forwarded to the serial port. In this mode, CoolTerm will be able to communicate with the other computer that is connected to the module via Bluetooth.
When you first plug in the module the LED will blink. You can then click "Connect" in CoolTerm. Then you are connected to the module via the serial port. The LED is still blinking, and the module will accept AT commands. You can type "AT" in line mode and press the enter key. The module will then respond with "OK". You can also type "AT+VERSION" and press the enter key. The module will then respond with the software version number. If this is working, than you can be assured that the serial connection is working and that the module is also working. In this mode you can use the different AT commands in the datasheet to obtain different information. For example, if you send "AT+PIN", the module will respond with the pairing code. This is important to know when you want to connect to the module via bluetooth.

THe next step is to connect to the module via bluetooth from another (remote) device (like a computer or mobile device). This process will require to enter the pairing code (you obtained with "AT+PIN") on the remote device. When you are successfully connected over bluetooth, the LED on the module will be on constantly and not blinking anymore. The module will then be in "transparent mode", which means that anything you type into CoolTerm will be forwarded to the remote device.
tnm
Posts: 11
Joined: Tue Oct 04, 2022 2:28 am

Re: AT-command mode in CoolTerm (2.0.0)

Post by tnm »

Hi Roger,
you wrote
When you first plug in the module the LED will blink. You can then click "Connect" in CoolTerm. Then you are connected to the module via the serial port. The LED is still blinking, and the module will accept AT commands. You can type "AT" in line mode and press the enter key. The module will then respond with "OK".
Today:
1) I typed AT -> Enter in "Line Mode" (with LED blinking) and got AT, without OK. Similarly: Hello -> Enter gave just Hello (without OK).

2) The CoolTerm_Win7.stc program was malfunctioning. Several times, when I started it from the Taskbar, it gave the message: "Access denied" and hung up.

3) Failed to reproduce the result I described earlier (in the Line Mode)
AT+NAME
OKname

Perhaps CoolTerm can actually get my Bluetooth module to work in AT command mode when the LED stops flashing. And only the Bluetooth module settings in the smartphone can stop blinking.
By the way, the paired devices of my smartphone are
FirstRobo
00:21:06:BE:16:C7

tnm
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: AT-command mode in CoolTerm (2.0.0)

Post by roger »

tnm wrote: Mon Oct 31, 2022 5:06 pm 1) I typed AT -> Enter in "Line Mode" (with LED blinking) and got AT, without OK. Similarly: Hello -> Enter gave just Hello (without OK).
Ok, so it looks like the module is echoing what you're typing, but it's not responding with an "OK" after sending "AT". Check the "Enter Key Emulation" setting under the "Terminal Options". Since the data sheet says on page 7 that the module requires "\r\n" (which means "carriage return + line feed") after each command, the "Enter Key Emulation" setting needs to be set to "CR+LF".
Is it possible the data sheet you linked is for slightly different bluetooth module?
2) The CoolTerm_Win7.stc program was malfunctioning. Several times, when I started it from the Taskbar, it gave the message: "Access denied" and hung up.
This is not necessarily a malfunction in CoolTerm. "Access Denied" usually means that something else (for example another application) is already accessing the COM port. Make sure no other application is using the COM port. Otherwise CoolTerm will not be able to connect to it.
3) Failed to reproduce the result I described earlier (in the Line Mode)
AT+NAME
OKname
Ok, this is good. This means it's working. According to the datasheet in page 8, "AT+NAME" queries the name of the module.
Can you try "AT+PIN"? This should respond with the pairing code.
Perhaps CoolTerm can actually get my Bluetooth module to work in AT command mode when the LED stops flashing. And only the Bluetooth module settings in the smartphone can stop blinking.
By the way, the paired devices of my smartphone are
FirstRobo
00:21:06:BE:16:C7
I'm not sure. Perhaps another user reading this who has more experience with bluetooth modules that I have can provide some answers.
Post Reply