Difference between revisions of "Getting Started With Minicom"
Line 1: | Line 1: | ||
− | {{todo| | + | {{todo| Review (10.28.2015-16:36->JJ+);(11.2.2015-18:00->JJ+);(11.3.2015-14:25->JJ+);(11.04.2015-13:00->MD-);(11.04.2015-17:15->JJ+) |Jeffrey Jung| project=OE 5.0,Review,JJ,MD}} |
{{#seo:minicom | {{#seo:minicom | ||
|title=Getting Started With Minicom | |title=Getting Started With Minicom | ||
Line 36: | Line 36: | ||
* The <code>minicom</code> settings will need to be changed so that the application will be able to find your device. Pull up the settings using the <code>-s</code> option. | * The <code>minicom</code> settings will need to be changed so that the application will be able to find your device. Pull up the settings using the <code>-s</code> option. | ||
− | {{cli| minicom -s|hostname=developerpc|username=user}} | + | {{cli|sudo minicom -s|hostname=developerpc|username=user}} |
This should bring up a colorful display listing the different settings. If the display isn't colored, arrow down to '''Exit from Minicom'''. Run the <code>minicom</code> command with the option <code>-con</code>. The <code>c</code> specifies the color display and <code>on</code> tells <code>minicom</code> to display the interface in color. <code>minicom</code> can be made to always run in color by modifying the <code>~/.bashrc</code> file, setting an alias for <code>minicom</code> to <code>minicom -con</code>, and restarting your terminal session (or sourcing your <code>.bashrc</code>) to make the change take effect.: | This should bring up a colorful display listing the different settings. If the display isn't colored, arrow down to '''Exit from Minicom'''. Run the <code>minicom</code> command with the option <code>-con</code>. The <code>c</code> specifies the color display and <code>on</code> tells <code>minicom</code> to display the interface in color. <code>minicom</code> can be made to always run in color by modifying the <code>~/.bashrc</code> file, setting an alias for <code>minicom</code> to <code>minicom -con</code>, and restarting your terminal session (or sourcing your <code>.bashrc</code>) to make the change take effect.: | ||
Line 44: | Line 44: | ||
<br /> | <br /> | ||
− | + | <!-- I tried using adduser from my machine and it said I'm already in the group, yet still couldn't save unless I ran sudo. I talk to Michael G about it and after a while, we determined that it'll only work if we use sudo. --> | |
− | |||
− | I tried using adduser from my machine and it said I'm already in the | ||
* The first thing that will need to be configured is the '''Serial port setup'''. Arrow down to the title and press the 'Enter' key. | * The first thing that will need to be configured is the '''Serial port setup'''. Arrow down to the title and press the 'Enter' key. | ||
Line 54: | Line 52: | ||
<br /> | <br /> | ||
In this screenshot, the "115200 8N1" for the '''Bps/Par/Bits''' setting indicates the baud rate is set to 115200, data bits set to 8 (the '8' in 8N1), parity is set to none (the 'N' in 8N1), and stop bits is set to 1 (the '1' in 8N1). | In this screenshot, the "115200 8N1" for the '''Bps/Par/Bits''' setting indicates the baud rate is set to 115200, data bits set to 8 (the '8' in 8N1), parity is set to none (the 'N' in 8N1), and stop bits is set to 1 (the '1' in 8N1). | ||
− | |||
− | + | * You will most likely wish to modify the '''Serial Device''' setting to have the path to the serial port you normally use. This way, you'll be able to run the command without any options or commands. The <code>scanserial</code> tool provided in the <code>emac-tool-util</code> package can display a list of serial ports using the <code>-l</code> option. | |
+ | {{cli|scanserial -l| hostname=developerpc|username=user}} | ||
+ | |||
+ | More information about the <code>scanserial</code> program can be found at the [[Scanserial | scanserial page]]. | ||
+ | Press the 'Esc' key to be be brought back to the configurations page. | ||
* The next setting that needs to be configured is the '''Modem and dialing'''. Press the 'A' key and delete its content. Hit the 'Enter' key to set the setting as blank. Also do this for B through K, and for H. Hit the 'Esc' key when finished deleting the content of these settings. | * The next setting that needs to be configured is the '''Modem and dialing'''. Press the 'A' key and delete its content. Hit the 'Enter' key to set the setting as blank. Also do this for B through K, and for H. Hit the 'Esc' key when finished deleting the content of these settings. | ||
* That's all the modifications that need to be done to get <code>minicom</code> set up. Arrow down to '''Save setup as dfl''' and press 'Enter'. | * That's all the modifications that need to be done to get <code>minicom</code> set up. Arrow down to '''Save setup as dfl''' and press 'Enter'. | ||
− | If a message pops up saying "<code>cannot write to /etc/minicom/minirc.dfl</code>", | + | If a message pops up saying "<code>cannot write to /etc/minicom/minirc.dfl</code>", you likely aren't running the command as root. Re-run the command with <code>sudo</code>. |
− | |||
− | |||
* Once you have saved the configuration, arrow down to '''Exit from Minicom'''. | * Once you have saved the configuration, arrow down to '''Exit from Minicom'''. | ||
</cl> | </cl> | ||
+ | |||
== Running Minicom == | == Running Minicom == | ||
Now that everything is configured, you are ready to open the serial connection. | Now that everything is configured, you are ready to open the serial connection. | ||
Line 74: | Line 74: | ||
</cl> | </cl> | ||
− | {{ note | | + | {{ note | When opening a connection to a different serial port than what has been saved from the <code>minicom</code> configurations, use the <code>-D</code> option and specify the path to the desired serial port. See the example below. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
Line 87: | Line 81: | ||
<!-- /***************************************** Examples *****************************************/ --> | <!-- /***************************************** Examples *****************************************/ --> | ||
<!-- /*********************************************************************************************************/ --> | <!-- /*********************************************************************************************************/ --> | ||
− | + | {{:Templateimpl:examples | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }} | |
− | + | Suppose the port <code>/dev/ttyS10</code> is specified as the default. If the desired path to a different port is at <code>/dev/ttyUSB0</code>, run <code>minicom</code> as follows: | |
+ | {{cli|minicom -D /dev/ttyUSB0| hostname=developerpc| username=user}} | ||
<!-- /*********************************************************************************************************/ --> | <!-- /*********************************************************************************************************/ --> | ||
<!-- /****************************************** Conclusion ******************************************/ --> | <!-- /****************************************** Conclusion ******************************************/ --> | ||
Line 100: | Line 95: | ||
{{:Templateimpl:moreinfo | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }} | {{:Templateimpl:moreinfo | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }} | ||
* [[System_Log_In | System Log In]] | * [[System_Log_In | System Log In]] | ||
+ | * [[Scanserial | scanserial]] | ||
{{:Templateimpl:whatnext | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }} | {{:Templateimpl:whatnext | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }} | ||
* [[Serial_Connections | Serial Connections]] | * [[Serial_Connections | Serial Connections]] |
Revision as of 17:17, 4 November 2015
Contents
Background
minicom
is a serial communication program that connects to devices through a GNU/Linux PC's serial ports. If run by calling its name without any additional arguments, it uses whatever settings have been saved for its defaults in /etc/minicom/minirc.dfl
. For those using Windows, PuTTY is a viable application to make such connections between a Windows PC and one of our EMAC devices. More information about PuTTY can be found at http://wiki.emacinc.com/wiki/PuTTY.
Please note that while PuTTY will work, it is missing a number of features relative to a real Linux terminal. In particular, a number of keystroke shortcuts will not work with PuTTY, and not all output will be displayed correctly in PuTTY (although it does manage to display most output correctly). For serious work with Linux, a real Linux terminal (such as minicom, described here) is strongly recommended.
General Information
The use of a terminal emulator, such as minicom
, is required when connecting to an EMAC board via a serial console. This page sets out to provide general information about using minicom
to communicate between EMAC machines and a development PC.
Getting Started With Minicom
-
If
minicom
has yet to be installed on your Linux machine, useapt-get
to install theminicom
packageuser
@
developerpc
:
~
#
sudo apt-get install minicom
-
The
minicom
settings will need to be changed so that the application will be able to find your device. Pull up the settings using the-s
option.user
@
developerpc
:
~
#
sudo minicom -s
This should bring up a colorful display listing the different settings. If the display isn't colored, arrow down to Exit from Minicom. Run the
minicom
command with the option-con
. Thec
specifies the color display andon
tellsminicom
to display the interface in color.minicom
can be made to always run in color by modifying the~/.bashrc
file, setting an alias forminicom
tominicom -con
, and restarting your terminal session (or sourcing your.bashrc
) to make the change take effect.:alias minicom='minicom -con'
-
The first thing that will need to be configured is the Serial port setup. Arrow down to the title and press the 'Enter' key.
-
To modify the different configurations, press the key corresponding to the setting. For example, press the 'A' key to modify the path to the Serial Device. Press the 'Enter' key to save the parameters for the setting. The settings for specific EMAC devices can be found at the Serial Connections page.
In this screenshot, the "115200 8N1" for the Bps/Par/Bits setting indicates the baud rate is set to 115200, data bits set to 8 (the '8' in 8N1), parity is set to none (the 'N' in 8N1), and stop bits is set to 1 (the '1' in 8N1). -
You will most likely wish to modify the Serial Device setting to have the path to the serial port you normally use. This way, you'll be able to run the command without any options or commands. The
scanserial
tool provided in theemac-tool-util
package can display a list of serial ports using the-l
option.user
@
developerpc
:
~
#
scanserial -l
More information about the
scanserial
program can be found at the scanserial page. Press the 'Esc' key to be be brought back to the configurations page. -
The next setting that needs to be configured is the Modem and dialing. Press the 'A' key and delete its content. Hit the 'Enter' key to set the setting as blank. Also do this for B through K, and for H. Hit the 'Esc' key when finished deleting the content of these settings.
-
That's all the modifications that need to be done to get
minicom
set up. Arrow down to Save setup as dfl and press 'Enter'. If a message pops up saying "cannot write to /etc/minicom/minirc.dfl
", you likely aren't running the command as root. Re-run the command withsudo
. -
Once you have saved the configuration, arrow down to Exit from Minicom.
Running Minicom
Now that everything is configured, you are ready to open the serial connection.
-
Run the
minicom
command to startminicom
with the serial port setting you configured above. If you wish to useminicom
on a different serial port than the one you configured above, see the note below. -
Log in with the appropriate username and password for the device. Login information can be found here. You're now able to communicate to the device and use
minicom
in the same way as using the terminal for the device.
NOTE |
When opening a connection to a different serial port than what has been saved from the minicom configurations, use the -D option and specify the path to the desired serial port. See the example below.
|
Examples
Suppose the port /dev/ttyS10
is specified as the default. If the desired path to a different port is at /dev/ttyUSB0
, run minicom
as follows:
user
@
developerpc
:
~
#
minicom -D /dev/ttyUSB0
Conclusion
This program is a very important tool for developers. The serial console is essential for working with the bootloader on ARM systems, since U-Boot cannot be accessed via ssh. Using the serial console, you will be able to configure the bootloader, to program new kernels via the bootloader, to program new filesystems, to make a copy of the filesystem on a board, and to perform memory checks using U-Boot. The serial console will also enable you to see startup and shutdown messages, to configure and debug the system when networking is not configured or is not working, and to debug the system when the machine is not booting up.
Further Information
Where to Go Next