Windows.  Viruses.  Notebooks.  Internet.  office.  Utilities.  Drivers

minicom

Introduction

Minicom is a text-based serial port communications program. It is used to talk to external RS-232 devices such as mobile phones, routers, and serial console ports.

Installation

Install the program with:

sudo apt-get install minicom

alternative, you can get Minicom via the Synaptic Package Manager.

Using the program

In order to find the name of your port(s) enter this command in terminal:

dmesg | grep tty

If it is a direct serial connection, the output will be something like this:

[ 22.587279] console enabled [ 24.186230] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [ 24.186860] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [ 51.5980 12] audit( 1243322582.732:2): type=1503 operation="inode_permission" requested_mask="a::" denied_mask="a::" name="/dev/tty" pid=5705 profile="/usr/sbin/cupsd" namespace= "default"

For a USB-to-Serial adapter, one may see:

[ 0.000000] console enabled [ 5.065029] usb 4-3: pl2303 converter now attached to ttyUSB0

What are we interested in is the name of the serial port. In the first section above it is ttyS0, the other is ttyUSB0. which we will need in order to use Minicom. Next, enter in a terminal enter:

sudo minicom -s

One will next choose "Serial port setup". Then, adjust the Serial Device to the device one has, for example:

A - Serial Device: /dev/ttyS0

Next, one will want to consult the hardware vendor"s manual for the Bits per second, data bits, Parity, stop bits, and Flow control. Once these have been adjusted, one may want to also go to the Modem and dialing menu and remove all information in setting options A through I. Once configured, one may "Save setup as dfl", which will save these as the default configurations for future connections (/etc/minicom/minirc.dfl). Exit, and one is at the minicom prompt. Hit enter, and you may be asked for your username, indicating a successful connection.

To exit Minicom when in terminal mode press "Ctrl-A" to get a message bar at the bottom of the terminal window and then press "X".

Another useful Option is to log all information to a file which will be saved in your Home directory. Select "Filenames and paths" and press"F" (Logging options). By default this will be saved as "minicom.log", but change it to whatever you like with the "A" key. Press "Enter" to save the changes.

Minicom - a program for using the serial port in UNIX-like operating systems(similar to Hyper Terminal in Windows).
IN this example Let's consider the operation of the minicom program with the Huawei E171 modem in the Ubuntu operating system.

First, insert a 3G modem into USB port computer and see if Ubuntu OS saw it by typing the command in the terminal:

We will see everything USB devices connected and recognized by the system.

Among them should be a line similar to this:

Bus 002 Device 005: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem

Now you need to find the modem itself in the /dev/ directory by typing the command in the terminal:

Among the many devices appeared:

ttyUSB0
ttyUSB1
ttyUSB2

This is the 3G modem

If the minicom program is not installed on the system, then you need to install it by typing the following command in the terminal:

sudo apt-get install minicom

To work with a specific port, you need to configure configuration file by typing the following command in the terminal:

minicom configuration environment will start


After moving through the menu using the arrow keys (up or down), to the item "Setting the serial port" select this item by pressing Enter. The serial port setup menu appears.


In the "Serial port" item, you need to install the device / dev / ttyUSB0, to do this, press the A (Latin) key and change the device file name. After editing, press Enter twice.
We do not change anything else in the settings. Use the arrow keys (up or down) to navigate to "Save settings as dfl" and press Enter. Next, exit the minicom configuration environment by pressing Esc or selecting the Exit menu item and get into the minicom program itself for entering AT commands.


The message "OK" in the window indicates the normal operation of the modem. To verify this again, type AT and press Enter. The response should be "OK".
Now you can use AT commands to switch operating modes in Huawei and ZTE modems. These commands are given in the article Huawei and ZTE Modem AT Commands.
To exit the minicom program, press Ctrl+A and then the Q key.

Pupsen and Vupsen April 29, 2016 at 12:19 pm

Configuring the ZTE mf180 USB modem to work in Ubuntu-based systems

  • *nix ,
  • Linux setup

In this publication I want to talk about how to configure the ZTE mf180 / 190 modem to work correctly in systems based on Linux Ubuntu.

Recently, after switching to Lunux Mint 16, I faced the problem of accessing the Internet through my 3g usb modem. Constant breaks in communication forced us to look for a solution. Valiant Google did not suggest anything in its entirety, I had to assemble it in parts.

Let's start in order.

We need Minicom, a program for using the serial port on UNIX-like operating systems. It is in the repositories of most distributions, so installing it should not cause any difficulties.

Open terminal and enter:

sudo apt-get update sudo apt-get upgrade sudo apt-get install minicomhttps://website/sandbox/edit/93467/# sudo minicom -s
The program menu will appear in the terminal.
Select the settings item "Setting the serial port"
And press the A key and bring to the form:

/dev/ttyUSB1
Then press Enter. After saving the settings, be sure to select the “Exit” item to get into the minicom console, and enter:

Ati0
The result should be something like this:

Manufacturer: ZTE CORPORATED Model: MF190 Revision: BD_BLNKZMF190V1.0.0B01 IMEI: 12345678901234 +GCAP: +CGSM,+DS,+ES OK
Copy the command, be sure to the minicom console:

echo -e "AT+ZCDRUN=E\r\n" > /dev/ttyUSB1

The answer will be:

Enter download mode result(0:FAIL 1:SUCCESS):1
Press CTRL + A, then Q, select "Yes".

Setting up the modem using minicom is now complete.

Then go to the connection settings, select the "mobile" tab, click the "add" button. A dialog box will open, in it we press the "forward" button, select the country (I chose Kazakhstan), then select the operator (in my case, Beeline - and then I will give the settings specifically for "Beeline KZ" When requested tariff plan I selected the "other" item and indicated the internet.beeline.kz access point. Click the "forward" button, then "apply". Then you need to specify a username and password (I have .beeline and beeline), click "save".

On this, my modem was fully configured and operational, good luck with the setup.

Tags: 3g modem, linux mint 16, Minicom, K "Cell, ZTE MF 180

Run "minicom -s" and select "Serial port setup" menu item.

The first item is "Serial Device" - this is the most important setting: your modem is connected to a serial device. (Who wants to make minicom work with multiple serial devices at the same time?) Press return to confirm and esc to exit to start menu installations. Select "Exit to minicom" and type "atdt99999". Your modem will immediately begin dialing and you will hear a click as the modem goes off-hook. Of course, "99999" is a non-existent number.

2.2 Starting PPP manually

You may have tried calling your ISP's number instead of "99999". Did you see random characters on the screen after registration (if not, type "ppp")? They say that "pppd" (or equivalent) is running on the other end of the line. If this is the case, then you can try to start the "pppd" daemon and evaluate the contents of the log files afterwards.

To run "pppd" inside minicom, you can define a new upload method "upload" (that is, from you) or override the "kermit programm" setting from the "Filename and paths" configuration menu:

A - Download directory: B - Upload directory: C - Script directory: D - Script program: /usr/bin/runscript E - Kermit program: /usr/sbin/pppd file /etc/ppp/mini_options
Now, if you've seen these random characters, the next time you call your ISP, you can press Alt-K to start "pppd".

The rest of this mini-HOWTO is about automating logging and running "pppd".

2.3 Examining logs

Although I am not going to explain how PPP is configured, I will briefly describe how to read the logs. To highlight meaningful information from the log "/var/log/debug" (or "/var/log/daemon.log") run the commands

tail -n 40 /var/log/debug |\ grep -E " pppd\[*\]:" |\ sed -e "s/^.*pppd\ rcvd
which show that we sent a request to set the maximum receive block size (mru) to 296. The other side rejected this setting ("configuration rejected"). In this case, I just removed the "mru" option from the "/etc/ppp/options" file (see below).

2.4 Setting phone numbers

If the above steps were successful, you may want to save phone number in the minicim database. Press Alt-D to bring up the call menu and use the cursor keys to select "Edit":

A - Name: Xeno B - Number: 022039697303 C - Dial string # : 1 D - Local echo: No E - Script: /etc/ppp/login.script F - Username: ppp-382 G - Password: top-secret H - Terminal Emulation: VT102 I - Backspace key sends: Delete J - Linewrap: Off K - Line Settings: Curr 8N1
This is an example entry for one of my providers. The "/etc/ppp/login.script" script is shown below. This script has two special variables, $(LOGIN) and $(PASS), that set the username (F) and password (G). This feature gives minicom some flexibility because you only need one script to automatically connect to multiple ISPs.

2.5 Registration scenario

"minicom" runs the login script (login-script) after it receives the "CONNECT" string. To be precise, "minicom" does not execute the script itself, but calls the "runscript" utility as a child process to do so.

Below is an example that I use for my provider.

# v1.0, 08/20/96 Winfried Tremper print "" print "Auto login via /etc/ppp/login.script" ## uncomment if you need to click to ## get the prompt string #send "" expect ( "ogin:" "ogin>" "sername:" "sername>" "NO CARRIER" exit 1 ) send "$(LOGIN)" expect ( "assword:" " assword>" timeout 20 ) send "$(PASS)" expect ( "port" send "ppp" "Start your PPP now" ")!}" timeout 10 } print "" print "Сейчас переключаемся в ppp-режим..." print "" ! /usr/sbin/pppd file /etc/ppp/mini_options print "" print "команда killall -TERM pppd прекращает работу pppd" !}

To run "pppd" use the "runscript" ability to call external programs. Copy your own ppp options file to "/etc/ppp/options.ttyS1" (here you can replace "ttyS1" with the device your modem is connected to) and delete all lines from /etc/ppp/options that refer to your modem (like "connect", "crtscts" or "modem"). Paste the options that are specific to a ppp connection via minicom in "/etc/ppp/mini_options". One of these options would be

disconnect "chat "" "\d\d+++\d\dATH\r\c""
This option must be present because "pppd" reads data via standard input and cannot force the modem to hang up via "crtscts".

2.6 Automatic dialing at startup

To call a specific number when starting minicom, use the "-d" option. Also you can try

to move minicom to another console (see the Consoles-Many mini-HOWTO).

2.7 Future expansions

Because "pppd" is a daemon, it is not intended for interactive user interaction or observation. This is true. And after all that, we use unixes...

The canonical solution is behind. Are there volunteers to hack minicom? Desired extensions are:

  • automatic creation of a registration script based on the sequence of actions performed by the user during manual connection establishment
  • automatic evaluation of logs with correction options
  • highlighting messages like those mentioned in paragraph 2.3.
Next

Configuration of various switches, routers and other equipment is usually done through a serial COM port (RS232). First you need to find and connect the computer and the switch (via the COM port or USB adapter) with a suitable console cable. In this article, we will see how to configure in Linux OS.

Configuration via minicom

First of all, you need to find the settings for the console com port in the documentation for the equipment. To connect under linux, you need to install the minicom program. Let's install from the package under Debian (ubuntu):

Aptitude install minicom

In order for minicom to see Cisco, it must be configured correctly, run with the key:

Sudo minicom -s

We go into the Serial port setup and change the values ​​​​Bps / Parity / Bits (Bps / Par / Bits) to 9600 8N1.

We change the serial port (Serial Device) to the port to which the equipment is connected and configure the flow control parameters (Flow Control). In this example, /dev/ttyS0 is the address of the COM1 port. When connected via a mini-usb connector, the port can be /dev/ttyACM0.

Command help can be accessed by pressing Ctrl+A then Z.

As a result, we get standard settings for Cisco and HP procurve:

A - Serial Device: /dev/ttyS0 B - Lockfile Location: /var/lock C - Callin Program: D - Callout Program: E - Bps/Par/Bits: 9600 8N1 F - Hardware Flow Control: Yes G - Software Flow Control : No

We save the configuration as the default settings in the minicom main menu (Save setup as dfl), or as a configuration with specific name(Save setup as..).

To exit minicom, press Ctrl+A then Q.

Or with saved settings.

minicom<имя_конфигурации>

And this is an example of settings for switches 3com (hp) 4210 and 4500

A - Serial Device: /dev/ttyUSB0 B - Lockfile Location: /var/lock C - Callin Program: D - Callout Program: E - Bps/Par/Bits: 19200 8N1 F - Hardware Flow Control: No G - Software Flow Control :Yes

The /dev/ttyUSB0 device is usually used when connected via a usb->com adapter. Speed ​​19200 sometimes 115200 is used on 3COM switches (now HP) and they do not understand any other speed. So before connecting, you need to carefully read in the documentation what speeds and flow control you need to set. However, sometimes connection parameters are written directly on the device next to the console port.

Settings via cu utility

You can connect to the console with the command

Chown uucp /dev/ttyUSB0 cu -s 115200 -l /dev/ttyUSB0

If you do not set chown permissions on the device file, you can get a message:

/dev/ttyUSB1: Device busy

The main advantage of the cu utility is that it works equally well under linux and under freebsd, only the device names are different.

On freebsd it will look like this:

Chown uucp /dev/cuaa0 cu -s 115200 -l /dev/cuaa0

The only thing you need to correctly select the device file where the device is connected.

If you notice an error, select a piece of text and press Ctrl + Enter
SHARE: