Skip to contentSkip to conversation

DOSemu serial port problem

DISCUSSION Edenyard 5 participants 5 messages Oct 31, 2003 – Nov 2, 2003

lore
Share & tools
lore

Edenyard

author
#0 lore raw

Many thanks for your help, Claudia!

You suggested:

Quoted 8 lines

try:
$_com1 = "/dev/ttyS0"
no entries in $_ports and $irqpassing.
make sure you have right access to /var/lock or make a directory /home/user/dosemu/lock and say in .dosemurc
$_ttylocks = "/home/user/dosemu/lock"

I tried that and I find that I can send data from my DOS programme
out of the port and also receive data to my programme from the port, when I remove the $_ports and $irqpassing entries. I also no longer get any error messages. But...

Unfortunately, all is still not well: the programme has to drive
the port's RTS line to control an RS232 to RS485 convertor (the equipment at the other end is RS485). The RTS line has to be made high whilst the PC is transmitting and then set low immediately after transmision so that the remote equipment can send its response.

Now I find with the settings that you suggest that, although the
transmit and receive data is getting through, something other than my programme is controlling the RTS line. The result of this is that my programme cannot now transmit along the RS485 cable, because something is resetting RTS low after my programme has set it high but just before my programme's transmission starts.

I have checked and Xwindows is not trying to use the port (as far as
I can tell) for a mouse. My mouse is on /dev/psaux. There is a modem on /dev/ttyS1 but, as far as Linux is concerned, /dev/ttys0 is unused.

Please could you suggest something that I can do to stop this.
I don't understand why the system would let me transmit and receive using the port but at the same time interfere with just the RTS line.... Do I need something to actually block the rest of the system from taking an interest in /dev/ttyS0, perhaps? What might be trying to use just the RTS line?

Thanks again for your help!

Cheers,

Gerald.

#1 lore raw

Hi Edenyard,

Am Freitag, 31. Oktober 2003 17:22 schrieben Sie:

Quoted 32 lines

Many thanks for your help, Claudia!

You suggested:

Quoted 6 lines

try:
$_com1 = "/dev/ttyS0"
no entries in $_ports and $irqpassing.
make sure you have right access to /var/lock or make a directory /home/user/dosemu/lock and say in .dosemurc
$_ttylocks = "/home/user/dosemu/lock"

I tried that and I find that I can send data from my DOS programme
out of the port and also receive data to my programme from the port, when I remove the $_ports and $irqpassing entries. I also no longer get any error messages. But...

Unfortunately, all is still not well: the programme has to drive
the port's RTS line to control an RS232 to RS485 convertor (the equipment at the other end is RS485). The RTS line has to be made high whilst the PC is transmitting and then set low immediately after transmision so that the remote equipment can send its response.

Now I find with the settings that you suggest that, although the
transmit and receive data is getting through, something other than my programme is controlling the RTS line. The result of this is that my programme cannot now transmit along the RS485 cable, because something is resetting RTS low after my programme has set it high but just before my programme's transmission starts.

I have checked and Xwindows is not trying to use the port (as far as
I can tell) for a mouse. My mouse is on /dev/psaux. There is a modem on /dev/ttyS1 but, as far as Linux is concerned, /dev/ttys0 is unused.

Quoted 6 lines

Please could you suggest something that I can do to stop this.
I don't understand why the system would let me transmit and receive using the port but at the same time interfere with just the RTS line.... Do I need something to actually block the rest of the system from taking an interest in /dev/ttyS0, perhaps? What might be trying to use just the RTS line?

I am lost here. I don't know what a RTS line is.

The only suggestion I can make is:
make a

find /etc -type f -exec grep -l /dev/ttyS0 { } \;

and you get a list of files which have an entry of /dev/ttyS0. Look at every file and find out if some other program uses /dev/ttyS0.

Or make the same with /var/log.

Hope that helps

cu

Claudia

#2 lore raw

Hi there,

Quoted 5 lines · Dr. Claudia Neumann
Quoted 3 lines

Do I need something to actually block the rest of the system from taking an interest in /dev/ttyS0, perhaps? What might be trying to use just the RTS line?

I am lost here. I don't know what a RTS line is.

Request To Send. See the EIA232 specifications. Maybe there's something in /etc/inittab which should be commented out. Hree are the entries in one of the distributions (Slackware I think):

#----------------------------------------------------------------------
# Local serial lines:
#s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100

# Dialup lines:
#d1:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0 vt100 #d2:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS1 vt100
#----------------------------------------------------------------------

Quoted 1 line

find /etc -type f -exec grep -l /dev/ttyS0 { } \;

That won't find the inittab entry. :)

73,
Ged.

#3 lore raw
Quoted 3 lines · Ged Haywood
Quoted 1 line

find /etc -type f -exec grep -l /dev/ttyS0 { } \;

That won't find the inittab entry. :)

The fuser command might help you find out if another process is using /dev/ttyS0.

Cheers,
Rob Komar

#4 lore raw
In reply to Ged Haywood

Hello.

Quoted 2 lines · --- Ged Haywood

Maybe there's something
in /etc/inittab which should be commented out. Hree

Wont work. The main problem here is that people keep using an "alternate" dirs for lock files like $_ttylocks = "/home/user/dosemu/lock"
which cheats dosemu to think it uses the ser port exclusively, while it does not. For some reasons this always keeps being suggested here and no surprise this causes problems like the above one.
In general I used to simply put the leavedos() calls in the appropriate places when such things are being done by people, but in this particular case this won't help so I am not sure what is the proper way of preventing that to be done (removing the $_ttylocks option entirely is not very good either).

Quoted 2 lines
Quoted 1 line

find /etc -type f -exec grep -l /dev/ttyS0 { } \;

That won't find the inittab entry. :)

Surely, but you can use lsof instead, it should find.

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/