LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Correct syntax for cu (https://www.linuxquestions.org/questions/slackware-14/correct-syntax-for-cu-595768/)

jowa45 10-30-2007 07:55 AM

Correct syntax for cu
 
I am trying to use the cu command in Slackware 11 default installation to connect to a remote device by way of a serial port. While I can receive from the remote device I am unable to transmit. The syntax I use is:-

cu -l /dev/ttyS1 -s 9600 -h --nostop --parity=none dir

The computer has a dual installation. I can use M$-Windoze-hyperterminal without problem and so I do not belive it is a hardware problem.

What is the correct syntax ?
Are there alternative programs in Slackware I could try?
Are there other Linux programs anywhere ?

John

pixellany 10-30-2007 08:14 AM

Did you try "man cu"?

http://linux.die.net/man/1/cu

Google is your friend

allend 10-30-2007 09:07 AM

I found 'minicom' to be useful to chat to a router via a serial port.

jowa45 10-30-2007 09:55 AM

pixellany
Yes I have read the manual.
Please see what the maintainer has to say under the heading Bugs.
And we still work with vacuum tubes.

allend
Can you tell the syntax for minicom. It is for direct connection at 9600baud no modems or telephone numbers and the like.


John

allend 10-30-2007 04:23 PM

This is a bit of a memory test! Have not done RS232 for a while.
You will need to uncomment a line in your /etc/inittab file to activate the serial port and add appropriate arguments. From "man agetty".
Quote:

For a hard-wired line or a console tty:
/sbin/agetty 9600 ttyS1

For a directly connected terminal without proper carriage detect wiring: (try this if your terminal just sleeps instead of giving you a password: prompt.)
/sbin/agetty -L 9600 ttyS1 vt100

jowa45 10-31-2007 05:46 AM

All that I so far acheive with agetty is a line that states :-
Password:

Entering the root password only repeats this.

John

allend 10-31-2007 08:23 AM

John,

Sorry for my unclear post.
The /etc/inittab contains these lines:
Quote:

# Local serial lines:
#s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100
#s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100
I meant that you may need to change the agetty options in these lines.

Also, please note that minicom allows you to set the RS232 options. Start minicom with the -s option.

jowa45 10-31-2007 12:29 PM

I have now connected my laptop to same computer by null-modem to try to understand why is going on. The original cu command works. It stops working if I remove the # shown above in inittab.

agetty never works with or without #. It still seams tied up with this password idea.

I have looked at minicom and I just get confused by all its dialog boxes but I will be struggling with it soon. Its been in Slackware as long as I can remember.

The cu does seam to work even connected to hyperterminal two way but only in receive for my remote device which is a microcontroller. Hyperterminal still works fine two way and I just get more confused.


John

tobyl 10-31-2007 01:23 PM

this may help a bit:

http://www.vanemery.com/Linux/Serial...l-console.html

you might want to check also that the 8250 module is loaded.

I have not used cu, but I have used minicom quite a bit (when I converted an ipaq to linux).
It is confusing at first, but you will soon get the hang of it. I read somewhere that it is superior to hyperterminal.

tobyl

allend 10-31-2007 07:08 PM

I suspect that your microcontroller may not be asserting DCD (Data Carrier Detect).
*nix systems routinely make use of this, but other systems often do not.
Your choices are to use an appropriately wired cable or else use software options to ignore DCD.

jowa45 11-01-2007 09:26 AM

Many thanks allend & tobyl.
I can now use cu which was my original post.
It appears that cu requires you to do something about DCD.
At least short it out at the back of the plug.
Will read up on minicom over the weekend and take agetty after that.

John


All times are GMT -5. The time now is 08:21 PM.