# Serial Connections with minicom? [Solved]

## AdmiralNemo

I was trying to use minicom to connect to my TNC today to use AX.25 packet radio on my 2-meter rig, and I was having some trouble.  I would start minicom, set all the settings properly, then initialize the modem, and nothing would happen.  I thought perhaps I was doing something wrong, so I tried gtkterm and seyon as well, with the same effect.  Thinking it was the computer, I tried to use minicom to connect to my Cisco 1700 series router on my other box and had the same experience.  I know that both devices work properly because I can use HyperTerminal to connect to them both with my Windows laptop.

Does anyone know what I might be doing wrong here?  Am I missing a setting, a driver, or something?  I would appreciate any information that may be relevant.  Thanks!

----------

## papal_authority

Is the serial port enabled in the BIOS? Is it permissions perhaps? Have you tried it as root? I believe the kernel's serial port support is now CONFIG_SERIAL_CORE, where as it used to be just CONFIG_SERIAL.

----------

## AdmiralNemo

I can't say for sure much about the second computer (ie the one connected to the Cisco Router), it is a server and I can't do much to it, it needs its uptime.  The first computer, connected to the TNC uses its serial ports for other purposes.  I use the same port (/dev/ttyS0) to activate the PTT on my other radio, so I know that the serial connection works.  I have only tried the connection as root.  This is why I am so confused.

----------

## linuxtuxhellsinki

Did you discard flow-control   :Question: 

```
│A -    Serial Device      : /dev/ttyS0

B - Lockfile Location     : /var/lock

C -   Callin Program      :

D -  Callout Program      :

E -    Bps/Par/Bits       : 38400 8N1

F - Hardware Flow Control : No

G - Software Flow Control : No
```

That was the problem with me when we configured some cisco-routers & HP-switches in one router-course.

----------

## AdmiralNemo

Yes, both Hardware and Software Flow Control say "No," and I tried both /dev/ttyS0 and /dev/ttyS1, which report the following according to setserial

```
# setserial -g /dev/ttyS0

/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

setserial -g /dev/ttyS1

/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3

```

----------

## Janne Pikkarainen

Just to double-check: Are you sure 38400 bps is the correct bitrate?

----------

## AdmiralNemo

No, it isn't, but I am using 9600baud for both my TNC (as specified in its documentation) and the Cisco Router, which is what it said on the Cisco website.  As far as I can tell, all the settings are as per the respective documentation, and at least on the TNC-connected computer I know the serial ports work with other applications.  I just don't understand why this communication doesn't work.  Is the init string perhaps incorrect?  If so, where can I find what to set it as?  Is there some way to find the init string HyperTerminal uses, because both devices work using my windows laptop...

----------

## papal_authority

You don't have something like getty or sacadm controlling the port do you? Those can get in the way.

----------

## AdmiralNemo

Nope, the serial console part of /etc/inittab is commented out and the only running instances of agetty are for tty2, tty3, tty4, tty5, and tty6.

----------

## Doogman

Ahh, using a serial terminal to access a modem, just like the good ole days.  :Smile: 

While it's been a long, long time since I've used a term to run a modem, I still occasionally need to access a  headless server through a serial port.  For my usage, minicom is slightly annoying for this because it has many more features than I need so I use a very simple term program like this:

http://homepage.ntlworld.com/robert.debath/code/term.c

It's so simple you don't have to worry about preset initializations stuck somewhere screwing you up.  A simple "term -l /dev/ttyS0 -s 9600" should work, assuming that's the correct serial port/baud setting.

----------

## AdmiralNemo

Wow, seems to work great!  Ahh the power of simplicity...

What do you suppose I am doing wrong in minicom?

----------

## Doogman

I'm glad it worked for you.

As far as your problems with Minicom, I would guess your modem is choking on a initialization string, like a AT command set, but I'm not familiar enough with your hardware or Minicom to guess any further.

----------

## Gentree

this looks like a much better idea than minicom. I've spend too much time struggling with minicom that seems to be able to do everything except communicate.  :Evil or Very Mad: 

Do you have a corrected version of test.c ?

I have a bunch of warning , missing headers <stdlib.h> cured most, changing void main() to int main() and compiling with -DNO_ZMODEM two more.

I'm now left with just one warning that cannot be ignored.

```
term.c: In function 'do_shell':

term.c:793: warning: incompatible implicit declaration of built-in function 'execle'
```

again this is missing headers but if I add #include <unistd.h> it all goes badly wrong again.

anyone got some more recent code or knows how to correct this stuff?

TIA.

----------

## Doogman

Yeah, I see the compiler warnings, but the program seems to work fine although I can't test it from here.  Are you sure it doesn't just work anyway?

----------

## Gentree

 *Doogman wrote:*   

> ... but the program seems to work fine although I can't test it from here.  Are you sure it doesn't just work anyway?

 

LOL, it worked fine for me too ... until I tested it !   :Rolling Eyes: 

Anyhow I've made my peace with minicom now , it seems it was the other end letting me down but I had too many unknown quantities since I was not familiar with minicom and had new hardware under test.

 :Cool: 

----------

