Sponsored Content
Full Discussion: Carrier Detection in FreeBSD
Operating Systems BSD Carrier Detection in FreeBSD Post 302820975 by rstor on Thursday 13th of June 2013 05:54:00 PM
Old 06-13-2013
Carrier Detection in FreeBSD

Regarding carrier detection on FreeBSD 9.1 being run within Virtual Box:

I used a usb-serial dongle which shows up as ttyu0 on the BSD machine. Carrier detection appears to work. When I establish a null modem connection I receive a login prompt. If I login, and then unplug and plug back the cable, I get the login prompt again and the old session does not continue. This is the correct behaviour to my understanding however I am curious of the way the getty process behaves, esp. on bootup in FreeBSD.

Question:

The line in my /etc/ttys file is as follows:

Code:
ttyu0   "/usr/libexec/getty std.300"   dialup on

I then issued the command "kill -HUP 1" and restarted the system with nothing plugged into the serial port.

Reading the documentation online, it is my understanding that when the system starts up and no carrier is detected, when issuing the ps ax command, the result I am supposed to see should be something as follows:

Code:
  114 ??  I      0:00.10 /usr/libexec/getty std.300 ttyu0

However I instead see a similar output to the above but the question marks are replaced by letters. Per the documentation online it indicates that if something like this is displayed it means that "getty has completed its open on the communications port. This could indicate a problem with the cabling or a misconfigured modem, because getty should not be able to open the communications port until carrier detect has been asserted by the modem."

I figured that since nothing is connected into the serial port, perhaps the voltage levels may be floating, instead of being held at the negative voltage which would indicate no carrier. I therefore applied a negative voltage to the CD line and restarted the system. Upon restart I issuing the ps -ax command and the result was as before, letters instead of the question marks. I then manually applied a positive voltage to the CD line and then a negative voltage again. I had to do it a couple times however eventually it showed up with question marks. I then was able to toggle back and forth, positive voltage resulted in letters, negative voltage on CD line resulted in question marks.

Why is it that when a negative voltage is applied to the CD line, upon system start-up, getty indicates via the ps -ax command that it has opened the port? [i.e. letters appear instead of question marks] I would expect that with a negative voltage applied to the CD line, upon restart it would show up with ??

I need to toggle the voltage between negative to positive and then back to negative (sometimes I need to do it a couple times) for it to eventually show up with ?? and then it would toggle back and forth as I switch the voltages thereafter.

Last edited by Scott; 06-13-2013 at 07:06 PM.. Reason: Please use code tags for code, data and terminal output
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

no carrier

I'm getting a error le0: No Carrier - transceiver cable problem? Tried looking around to see what is the best way to fix this error. Can anyone help me I can't find anything. (2 Replies)
Discussion started by: merlin
2 Replies

2. UNIX for Dummies Questions & Answers

virus detection

IS there virus software for unix? I worked in a Solaris environment and dont remember having anything. I also ask because the current enviroment i am working on is Microsoft and they argue that they do not use unix because of virus detection. Any input would be greatly appreciated. (1 Reply)
Discussion started by: pbonilla
1 Replies

3. IP Networking

modem detection

How to get information that where is my modem configured in /dev. I have two modems configured in my device .. one is USB and other is PCI modem.. USB is detected as /dev/USB0. but how to see about PCI modem? (0 Replies)
Discussion started by: s123.radha
0 Replies

4. Programming

Application crashes in FreeBSD 7.1 while working ok in FreeBSD 6.3

Hello there, My mulithreaded application (which is too large to represent the source code here) is crashing after installing FreeBSD 7.1-RELEASE/amd64. It worked properly on others machines (Dual Cores with 4GB of RAM - FreeBSD 6.2-RELEASE/i386). The current machine has 2x Core 2 Duo... (1 Reply)
Discussion started by: Seenquev
1 Replies

5. Shell Programming and Scripting

NAT detection

hellou, can anybody help me with nat detection in real time ? i prefer some detection script because i try some nat detection program's for example p0f or i'm using tcpdump, but i would get contain of specific packet. Some ideas? (1 Reply)
Discussion started by: TheTechnic
1 Replies

6. Programming

Parallel Processing Detection and Program Return Value Detection

Hey, for the purpose of a research project I need to know if a specific type of parallel processing is being utilized by any user-run programs. Is there a way to detect whether a program either returns a value to another program at the end of execution, or just utilizes any form of parallel... (4 Replies)
Discussion started by: azar.zorn
4 Replies

7. UNIX for Dummies Questions & Answers

Power Line Carrier (PLC)

hi, i am going to know if i can use n.s for power line simulating? Best Regards, (2 Replies)
Discussion started by: mohsenmahoor
2 Replies

8. Solaris

Carrier Detection in Solaris 8 for Dial in and Null Modem Connections

I am having troubles with carrier detection for dialing in via a modem or direct connection via a null modem connection under Solaris 8 (i.e. login session remains active after the modem disconnects). I tried two different dumb modems (which do not respond to AT commands) on the machine that I am... (6 Replies)
Discussion started by: rstor
6 Replies
getty(1M)						  System Administration Commands						 getty(1M)

NAME
getty - set terminal type, modes, speed, and line discipline SYNOPSIS
/usr/lib/saf/ttymon [-h] [-t timeout] line [ speed [ type [linedisc]]] /usr/lib/saf/ttymon -c file DESCRIPTION
getty sets terminal type, modes, speed, and line discipline. getty is a symbolic link to /usr/lib/saf/ttymon. It is included for compati- bility with previous releases for the few applications that still call getty directly. getty can only be executed by the super-user, (a process with the user ID root). Initially getty prints the login prompt, waits for the user's login name, and then invokes the login command. getty attempts to adapt the system to the terminal speed by using the options and arguments specified on the command line. Without optional arguments, getty specifies the following: The speed of the interface is set to 300 baud, either parity is allowed, NEW- LINE characters are converted to carriage return-line feed, and tab expansion is performed on the standard output. getty types the login prompt before reading the user's name a character at a time. If a null character (or framing error) is received, it is assumed to be the result of the user pressing the BREAK key. This will cause getty to attempt the next speed in the series. The series that getty tries is determined by what it finds in /etc/ttydefs . OPTIONS
The following options are supported: -h If the -h flag is not set, a hangup will be forced by setting the speed to zero before setting the speed to the default or a specified speed. -t timeout Specifies that getty should exit if the open on the line succeeds and no one types anything in timeout seconds. -c file The -c option is no longer supported. Instead use /usr/sbin/sttydefs -l to list the contents of the /etc/ttydefs file and perform a validity check on the file. OPERANDS
The following operands are supported: line The name of a TTY line in /dev to which getty is to attach itself. getty uses this string as the name of a file in the /dev directory to open for reading and writing. speed The speed argument is a label to a speed and TTY definition in the file /etc/ttydefs. This definition tells getty at what speed to run initially, what the initial TTY settings are, and what speed to try next, (should the user press the BREAK key to indicate that the speed is inappropriate). The default speed is 300 baud. type and linedisc These options are obsolete and will be ignored. FILES
/etc/ttydefs ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsr | +-----------------------------+-----------------------------+ SEE ALSO
ct(1C), login(1), sttydefs(1M), ttymon(1M), ioctl(2), attributes(5), tty(7D) SunOS 5.10 14 Sep 1992 getty(1M)
All times are GMT -4. The time now is 01:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy