Difference between revisions of "Getting Started With Minicom"

From wiki.emacinc.com
Jump to: navigation, search
m (Reviewed, made changes, noted issues, and marked buggy.)
Line 1: Line 1:
{{todo| Review (10.28.2015-16:36->JJ+);(11.2.2015-18:00->JJ+);(11.3.2015-14:25->JJ+)|Jeffrey Jung| project=OE 5.0,Review,JJ,MD}}
+
{{todo| Buggy (10.28.2015-16:36->JJ+);(11.2.2015-18:00->JJ+);(11.3.2015-14:25->JJ+);(11.04.2015-13:00->MD-) |Jeffrey Jung| project=OE 5.0,Buggy,JJ,MD}}
 
{{#seo:minicom
 
{{#seo:minicom
 
|title=Getting Started With Minicom
 
|title=Getting Started With Minicom
Line 15: Line 15:
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:bg | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
 
{{:Templateimpl:bg | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
<code>minicom</code> 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 <code>/etc/minicom/minirc.dfl</code>. For those using a Windows, PuTTY is a great 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.
+
<code>minicom</code> 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 <code>/etc/minicom/minirc.dfl</code>. 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.
  
  
Line 24: Line 26:
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:geninfo | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
 
{{:Templateimpl:geninfo | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
The use of <code>minicom</code> is required when connecting an EMAC board for testing purposes. This pages sets out to provide general information about using <code>minicom</code> to communicate between EMAC devices and your development PC.
+
The use of a terminal emulator, such as <code>minicom</code>, is required when connecting to an EMAC board via a serial console. This page sets out to provide general information about using <code>minicom</code> to communicate between EMAC machines and a development PC.
  
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
Line 31: Line 33:
 
{{:Templateimpl:using | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
 
{{:Templateimpl:using | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
 
<cl>1. If <code>minicom</code> has yet to be installed on your Linux machine, use <code>apt-get</code> to install the <code>minicom</code> package
 
<cl>1. If <code>minicom</code> has yet to be installed on your Linux machine, use <code>apt-get</code> to install the <code>minicom</code> package
{{clo|indent=1}}
+
{{cli|sudo apt-get install minicom|hostname=developerpc|username=user}}
{{clio|sudo apt-get install minicom|hostname=developerpc|username=user}}
 
{{clos}}
 
  
 
* 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.
{{clo|indent=1}}
+
{{cli| minicom -s|hostname=developerpc|username=user}}
{{clio|sudo minicom -s|hostname=developerpc|username=user}}
+
 
{{clos}}<br />
+
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 options <code>-scon</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 and setting <code>minicom</code> to alias to <code>minicom -con</code> .
+
<pre>
 +
alias minicom='minicom -con'
 +
</pre>
 
<br />
 
<br />
 +
 +
{{warning | You shouldn't need to run minicom with sudo.  If you do, you have your permissions misconfigured.  You'll need to add your user to the dialout group.}}
  
 
* 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.
 
<br />
 
<br />
  
* 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 | Serial Connectoins]] page. <br /> [[File:Minicomserialport.png| Serial Port Setup for minicom]]
+
* 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 | Serial Connections]] page. <br /> [[File:Minicomserialport.png| Serial Port Setup for minicom]]
 
<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).
If you're likely to use the same serial port when connecting to your device with minicom, modify the '''Serial Device''' setting to have the path to the port. This way, you'll be able to run the command without any options or commands. Press the 'Esc' key to be be brought back to the configurations page.
+
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. Press the 'Esc' key to be be brought back to the configurations page.
<br />
+
 
* 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. Do this for B-K, and H. Hit the 'Esc' key when finished deleting the content of these settings.
+
{{warning | You need to tell them how to find and configure their serial port as well.  I wrote a program called scanserial, which is part of the emac-tools-util package, for just this purpose.  It doesn't seem to have been documented on the wiki yet, though.  You can provide a link to a stub article, which will be written soon.  I'll create it here:  http://wikidev.emacinc.com/wiki/Scanserial }}
 +
 
 +
* 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>", you likely aren't running the command as root. Re-run the command with <code>sudo</code>.
+
If a message pops up saying "<code>cannot write to /etc/minicom/minirc.dfl</code>", <strike>you likely aren't running the command as root. Re-run the command with <code>sudo</code>.</strike>
* Once you're able to save the configurations, arrow down to '''Exit from Minicom'''.
+
 
 +
{{warning | Again, you shouldn't need to run as root.  If you need sudo, your permissions are incorrect.  They need to be fixed.  The reason for getting this error would be because of running minicom with sudo to set the config the first time, because doing so would cause minicom to write a config file in your home directory that's owned by root instead of by you.}}
 +
 
 +
* Once you have saved the configuration, arrow down to '''Exit from Minicom'''.
 
</cl>
 
</cl>
 
== Running Minicom ==
 
== Running Minicom ==
Now that everything is configured, let's make the connection to the device.
+
Now that everything is configured, you are ready to open the serial connection.
 +
<cl>1. Run the <code>minicom</code> command to start <code>minicom</code> with the serial port setting you configured above. If you wish to use <code>minicom</code> 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 [[System_Log_In | here]].
 +
You're now able to communicate to the device and use <code>minicom</code> in the same way as using the terminal for the device.  
 +
</cl>
 +
 
 +
{{ note | The description of how to run minicom -D should be here.  Remember, the customers reading this will usually only have one EMAC board, which they will keep attached to their computer for several months straight (if not 1+ years).
 +
<!--
 
<cl>1. Run the <code>minicom</code> command with the option <code>-D</code> and the path to the device as an argument.
 
<cl>1. Run the <code>minicom</code> command with the option <code>-D</code> and the path to the device as an argument.
{{clo|indent=1}}
+
{{cli|minicom -D /dev/ttyS10|hostname=developerpc|username=user}}
{{clio|minicom -D /dev/ttyS10|hostname=developerpc|username=user}}
+
 
{{clos}}
 
 
If the path to the device is what you have configured in the <code>minicom</code> settings, you won't need to use the <code>-D /dev/ttyS10</code> arguments and options. <code>/dev/ttyS10</code> is just an example of a path to a serial port; your path may be different. Using the <code>-o</code> option will allow <code>minicom</code> to make the connection more quickly by not sending AT commands to initialize a modem.
 
If the path to the device is what you have configured in the <code>minicom</code> settings, you won't need to use the <code>-D /dev/ttyS10</code> arguments and options. <code>/dev/ttyS10</code> is just an example of a path to a serial port; your path may be different. Using the <code>-o</code> option will allow <code>minicom</code> to make the connection more quickly by not sending AT commands to initialize a modem.
* Log in with the appropriate username and password for the device. Log in information can be found at [[System_Log_In | here]].
+
-->
You're now able to communicate to the device and use <code>minicom</code> in the same way as using the terminal for the device.
+
}}
</cl>
+
 
 +
 
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
Line 74: Line 91:
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:conclusion | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
 
{{:Templateimpl:conclusion | initials=JJ | title=Getting Started With Minicom | desc=Description for SEO | project=OE 5.0 }}
This program is a very powerful tool for developers. While functioning largely as a terminal for the connected device, it also can be be used to view important output form other system functions like when the system starts up or reboots.
+
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.
  
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->

Revision as of 13:00, 4 November 2015

TODO: {{#todo: Buggy (10.28.2015-16:36->JJ+);(11.2.2015-18:00->JJ+);(11.3.2015-14:25->JJ+);(11.04.2015-13:00->MD-) |Jeffrey Jung|OE 5.0,Buggy,JJ,MD}}

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

  1. If minicom has yet to be installed on your Linux machine, use apt-get to install the minicom package

    user@developerpc:~# sudo apt-get install minicom
  2. 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:~# 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. The c specifies the color display and on tells minicom to display the interface in color. minicom can be made to always run in color by modifying the ~/.bashrc file, setting an alias for minicom to minicom -con, and restarting your terminal session (or sourcing your .bashrc) to make the change take effect.:

    alias minicom='minicom -con'
    




    WARNING!
    You shouldn't need to run minicom with sudo. If you do, you have your permissions misconfigured. You'll need to add your user to the dialout group.


  3. The first thing that will need to be configured is the Serial port setup. Arrow down to the title and press the 'Enter' key.

  4. 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.
    Serial Port Setup for minicom
    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. Press the 'Esc' key to be be brought back to the configurations page.



    WARNING!
    You need to tell them how to find and configure their serial port as well. I wrote a program called scanserial, which is part of the emac-tools-util package, for just this purpose. It doesn't seem to have been documented on the wiki yet, though. You can provide a link to a stub article, which will be written soon. I'll create it here: http://wikidev.emacinc.com/wiki/Scanserial


  5. 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.

  6. 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 with sudo.



    WARNING!
    Again, you shouldn't need to run as root. If you need sudo, your permissions are incorrect. They need to be fixed. The reason for getting this error would be because of running minicom with sudo to set the config the first time, because doing so would cause minicom to write a config file in your home directory that's owned by root instead of by you.


  7. 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.

  1. Run the minicom command to start minicom with the serial port setting you configured above. If you wish to use minicom on a different serial port than the one you configured above, see the note below.

  2. 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
The description of how to run minicom -D should be here. Remember, the customers reading this will usually only have one EMAC board, which they will keep attached to their computer for several months straight (if not 1+ years).


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


Pages with Related Content