I am using Arduino Nano 33 BLE. I am able to communicate via Serial Monitor within Arduino IDE, but not able to communicate via Terminal, outside of Arduino IDE. I am using Teraterm, do I need to do any additional setting?
No error messages. It does work on the Serial Monitor of Arduino IDE at 115200 baud rate with the default settings ("SERIAL_8N1"). The serial port Setup on Teraterm is the following:
Speed: 115200 Data: 8 bit Parity: none. Stop bits: 1 bit. Flow control: none
The thing is that it does what it has to do writing one command that is one letter, I mean, in my Arduino sketch if you write "$" on Serial Monitor it does a reset, and through Teraterm if you write "$" It does a reset as well,.. but on Teraterm if I type a command longer than one letter It doesn't even show what I type on Teraterm and doesn't recognize.
2 Answers 2
In TeraTerm the local echo is off by default. So you won't see anything while you type something. Here are the settings:
- First connect to the serial port.
- Then go to
Setup
->Terminal
.
- Based on your code select what you are expecting to receive at the end of a transmission from Arduino and what you need to send at the end of your command to Arduino to tell it is the end of the command. Usually, it can be Carriage Return (CR: 0x0D) or Line Feed (LF: 0x13), or both.
Also, check Local echo
. That will print whatever you are typing on the terminal.
- Then
Setup
->Serial port...
.
- And configure your serial port accordingly.
What you call a "terminal" is actually a terminal emulator, i.e. a computer program intended to emulate an old school computer terminal. CRT-based terminals were in turn designed to emulate still older "hard-copy terminals", like the venerable ASR-33. A hard-copy terminal (also called "teletypewriter") is basically a typewriter fitted with a serial port. Whatever you type is sent along the wire. Keystrokes are sent immediately: these devices did not have memory (which was hugely expensive at the time) and could not buffer your input. The Teraterm program you are using inherits from this history: like a teletypewriter, it sends your keystrokes immediately.
The Arduino serial monitor, in contrast, does not transmit as you type. Instead, you type a line of text and, when you hit "Send", the whole line is sent at once, at the full speed of the serial port.
This makes a significant difference in terms of transmission timing. With Teraterm, the Arduino program sees long pauses (which depend on your typing speed) between successive characters. With the serial monitor, successive characters are spaced by roughly 87 μs. If your Arduino code properly buffers its input until it receives an end-of-line, then it will work equally well with Teraterm and with the serial monitor. If, on the other hand, your code gets impatient and times out while you are typing, then it will not get multi-character commands you type on Teraterm.
Note that, if you want your Arduino program to be friendly to terminal users, you may want to echo the characters you receive, as local echo on the terminal is usually not on by default. More importantly, you may want to handle the backspace key (which can send either ASCII BS or ASCII DEL) to let the user fix their typos. See how this is done in this very simple command-line interpreter.
not able to communicate
is a similar description tonot feeling well
... it provides no useful information about the problem