Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3216056
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:14:59+00:00 2026-05-17T15:14:59+00:00

I have a linux server (Red Hat 4) with one serial port connection to

  • 0

I have a linux server (Red Hat 4) with one serial port connection to an embedded linux device, and another serial port connection to a power controller for that device. My current way to control them is to open two minicom sessions, each in its own window. I would like to automate this communication through scripts. At first, I began to think how I could automate using minicom, then realized I shouldn’t need to try to automate using a console application when a script should be able to speak to the port directly.

I know some Perl and some python. I do not have previous experience with modem communication (using AT commands). Perl has Device::Modem, though it’s only beta, and Perl seems like a good choice because I prefer its text extraction and wrangling abilities. But, if I need to learn how to control a modem and write/debug a script, that adds more time to my task.

Is it possible/common to interactively control a console app like minicom with a script? If not, what are some good resources for me to learn how to use modem AT commands? Or is there another resource out there that could simplify things for me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:15:00+00:00Added an answer on May 17, 2026 at 3:15 pm

    Kermit is a serial communication app like minicom and it has its own script language, and I used it for some automatic upload on embedded devices. However, it is quite limited and/or buggy, so I finally switched to using python and pyserial.
    Whenever you deal with texte mode, like AT command set or speaking to a shell over a serial line, it is really powerful.

    If I need to do binary transfer using some standard protocol, I usually use command line tools in non interactive mode, and spawn them from my python script.

    Here is some part of the tools I built : waiting for some input, sending data through xmodem, sending a command to u-boot and starting a transfer using the kermit protocol. I use it for automatic flashing and testing of embedded devices.

    class Parser :
        def __init__(self, sport_name):
            self.currentMsg = ''
            if sport_name :
                self.ser = serial.Serial(sport_name, 115200)
        def WaitFor(self, s, timeOut=None):
            self.ser.timeout = timeOut
            self.currentMsg = ''
            while self.currentMsg.endswith(s) != True :
                # should add a try catch here
                c=self.ser.read()
                if c != '' :
                    self.currentMsg += c
                    sys.stdout.write(c)
                else :
                    print 'timeout waiting for ' + s
                    return False
            return True
    
        def XmodemSend(self,fname):
            if not self.WaitFor('C', 1) :
                print 'RomBOOT did not launch xmodem transfer'
                return
            self.ser.flushInput()
            self.ser.close()
            call(["xmodem","-d",self.ser.port,"-T",fname])
            self.ser.open() 
    
    def UbootLoad(self, fname):
        self.ser.write('loadb 0x20000000\n')
        if not self.WaitFor('bps...',1) :
            print 'loadb command failed'
            sys.exit()
        self.ser.flushInput()
        self.ser.close()
        retcode=call(['kermit','-y','kermit_init','-s',fname])
        if retcode != 0 :
            print 'error sending' + fname
            sys.exit()
        self.ser.open()
        self.UbootCmd('echo\n')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a Linux server running Red Hat Enterprise 3 and MySQL 3.23. This
I have a server that is running Ubuntu Linux Server Edition. I once had
I have to deploy a Django project on Red hat enterprise linux 5, the
I'm trying to get PCI Compliance for my dedicated server (Red Hat Enterprise Linux),
I am using JBoss 5.1.0.GA on Red Hat Linux 4. We have only webservices
gcc (GCC) 4.1.2 c89 Red Hat Enterprise Linux Server release 5.4 2.6.18-164.el5 GNU gdb
I have hosted an application in a machine running Red Hat Enterprise Linux 5.
My normal development platform for PHP is Linux. I use a Red hat server
I'm running on Red Hat Enterprise Linux Server release 5.2 (Tikanga). Eerytime I try
I have a MySQL InnoDB table on a RedHat Enterprise Linux 4 server, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.