Sending ctrl+z using serial monitor

I am using a gsm shield I purchased from ebay. Everything is going well, I am sending AT and getting OK back and so on. I can get to the point where I type in the message but cannot send the correct character to let the device know that I am finished typing the message and that it may send it now. I believe the character is ctrl+z or 0x26. How would I send this in the monitor or what program could I use to do this. I have tried telnet and I can't get that to work for the life of me.

Thanks.

0x26 is '&'

Link to the gsm shield?

Conventionally, an ampersand is used at the start of a command to indicate that an extended command follows, and commands and responses are terminated by a carriage return.

ctrl-z isn't a character.

it is a control code combined with a character, so I doubt your GSM shield expects a ctrl-z for anything.

Thanks guys, I appreciate all of the replies.

The wiki page for the shield I have:
http://www.elecfreaks.com/wiki/index.php?title=EFCom_GPRS/GSM_Shield
*look half way down, about sending an sms

I just looked, it was actually 0x1a. Looking at the ascii table, it is a substitute character? Never heard of it. But apparently that's what I need to be able to send through the serial monitor. Any ideas?

Serial.write(0x1a);

In the serial monitor?

Sorry, completely missed the serial monitor part.

If it isn't a type-able character, you might need a more feature-robust terminal that allows sending raw bytes. Or use your operating system's method for typing ASCII characters and try sending it that way.

Wanted to do the same thing - send ctrl+z using Arduino serial monitor to escape the text string for a GSM message. Couldn't find a way with Arduino serial monitor, however the following works.

Download Tera Term (a free terminal emulator, maybe others too). Very simple to use.

Startup Tera Term, choose 'Serial' radio button at bottom of dialog window; your Arduino COM port may already be showing in the dropdown menu, if not choose the right COM port. And thats it.

Now use this terminal instead of Arduino serial monitor, especially if you want to send control characters. After sending all your AT commands and typing your text message, just pres CTRL & z key in the input window.

Basically, you just have to type the CTRL sequence in the input window and the corresponding control character will be sent on the serial interface.

ctrl-z is used for an end-of-file marker in text files on unix (windows uses a ctrl-d). Its possible that the serial monitor itself treats its input as a text stream, so a ctrl-z makes it close the connection.

Hello!
There is a working solution, about sending ctrl+z using serial monitor.

  1. Open new file in most popular text editor - Notepad++
  2. Press CTRL-Z
  3. Copy (CTRL-C) formed symbol (its may display in Notepad++ as "SUB")
  4. Paste (CTRL-V) in commandline of Serial monitor and press ENTER

gorek:
Hello!
There is a working solution, about sending ctrl+z using serial monitor.

  1. Open new file in most popular text editor - Notepad++
  2. Press CTRL-Z
  3. Copy (CTRL-C) formed symbol (its may display in Notepad++ as "SUB")
  4. Paste (CTRL-V) in commandline of Serial monitor and press ENTER

Did you actually try this? Because I did. It doesn't work. Ctrl z in Windows, and notepad++ for that matter, resolves to the default action which is undo. If I could down vote you I would.

2 Likes

gorek:
Hello!
There is a working solution, about sending ctrl+z using serial monitor.

  1. Open new file in most popular text editor - Notepad++
  2. Press CTRL-Z
  3. Copy (CTRL-C) formed symbol (its may display in Notepad++ as "SUB")
  4. Paste (CTRL-V) in commandline of Serial monitor and press ENTER

Almost, except, instead of pressing CTRL-Z you write ALT+026
That will output a small character saying "SUB" with a black background, copy that into your serial monitor (it will be pasted as a square), and send that.

Just tested it, and it works :slight_smile:

1 Like

Just want to confirm that the method descibed above:

  1. Open notepad++
  2. Type ALT+026
  3. Copy the resulting character (SUB)

works just fine! Now I can send a text message from my SIM900 modem by typing

AT+CPIN="pin code here"
AT+CMGS="phone number here"

then start typing the message once the > character appeared in the terminal and terminate the message with the (SUB) character.

thanks for sharing.

1 Like

What do you get after typing ALT+026? should you press enter in order to get some character? And ALT+026 is not command right? its just you type as text in Notepad

1 Like

Notepad++ not Notepad.
Hold Ctrl, press Z, release Ctrl OR Hold Alt, press 0, press 2 press 6, release Alt.
You can then paste the "SUB" thingy that appears Serial Monitor and save this .txt file.
If you open this file with Notepad, it will look like a rectangle! Notepad++ shows the "SUB" thingy.
Works 100%

NOTHING COMPLICATE!
THE PUTTY SERIAL TERMINAL , AND END THE TEXT PRESS PHISICALLY CTRL+Z KEY :slight_smile:

IMPORTANT USE THE PUTTY, ARDUINO SERIAL EMULATOR , OR TERMITE OR HYPER TERMINAL THIS IS NOT GOOD LIKE THIS.

Please fix your caps lock key. All capitals is considered shouting and considered impolite.

Hello,
Perhaps I am slightly late in answering the question. Just type Serial.print(char(26)); at the end of your message string. You can send your complete SMS code and I would be willing to check the same.
Cheers.