How I can send a command to a USB/COM device? I set up a port in minicom to /dev/ttyUSB0 and run:
sudo minicomAfter this command I try to enter an AT command, but I get unreadable symbols in the terminal:
Добро пожаловать в minicom 2.7
ПАРАМЕТРЫ: I18n
Дата компиляции Jan 1 2014, 17:13:19.
Port /dev/ttyUSB0, 21:18:08
Нажмите CTRL-A Z для получения подсказки по клавишам
�I also tried the cu program, but I got the same result - unreadable symbols when I type AT:
$ sudo cu -l ttyUSB0
Connected.
��What I'm doing wrong?!
11 Answer
Looks like you haven't told it what baud rate (speed) the port is running at.
sudo stty -F /dev/ttyS0gets
speed 9600 baud; line = 0;
-brkint -imaxbel
on my system - default of 9600 baud.
Minicom, IIRC, defaults to 115200.
There is a good chance your device isn't using that speed. If you're sending AT commands it's a fair bet you're looking at a modem, in which case 9600 would be an antique model; try setting 115200 or 38400 baud. Without knowing what device you have it's pointless trying to talk about changing it's setting!
You will, then, need to play with the PC end - unless you know what speed your device uses. sudo stty -F /dev/ttyUSB0 38400 will set your USB to 38400; in Minicom, it's -A then Z then O to get the menu you want. You can try guessing, it won't break anything.