VOGONS

Common searches


First post, by polsimp

User metadata
Rank Newbie
Rank
Newbie

I just purchased a used police scanner with an aftermarket serial port interface. I want to ensure the computer is communicating with the serial port and Dosbox before I fork out $40 for the software to run the radio with the computer. It is a newer computer (core i7), but it has a real RS232 because it was originally a business computer.

I found this thread before making a new post:

serial port on ubuntu

I changed dosbox.conf to "serial1=directserial realport:ttyS0", but I'm getting error 9 just like the guy in the previously mentioned thread did. Just for good measure I did try "ttyUSB0" but still got an error. I also tried ""serial1=directserial realport:ttyS0 irq:4". I've been running Linux for 16 years but I'm still pretty green when it comes to using the terminal or anything similar. The following might help:

$ dmesg | grep tty
[ 0.110577] printk: console [tty0] enabled
[ 0.370421] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 0.391961] 0000:00:16.3: ttyS4 at I/O 0x40a0 (irq = 17, base_baud = 115200) is a 16550A

Also if it helps the aftermarket interface is called the Optoscan 456. It is ancient and there is precious little information to be had regarding it's use. I tried asking in a radio forum but didn't get much help. I have managed to confirm that I am using the correct cable (straight through, not null modem).

Reply 1 of 13, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

Well firstly you're not gonna want 115k my first clue was when you said ancient, I'd have guessed to start at 9600 and this says it was a good guess https://forums.radioreference.com/threads/rad … utility.364900/

Didya find this page? https://www.monitoringpost.com/pro2006/opto.html shareware DOS software listed that you can probably try it with.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 2 of 13, by polsimp

User metadata
Rank Newbie
Rank
Newbie

I've been through all those links and many more. Most are dead. The remainder cost money, and out of those the only one I want is Probe, and it works with DOS. My primary objective is to ensure Dosbox "sees" the serial port. If I can get rid of this error 9 thing I think I will be confident enough to shell out the $40 for Probe.

Reply 4 of 13, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

First we should check you're using an up to date version of DOSbox, best to use an apt get install off main site, the binaries in several of the distro repositories are some ancient and multiply broken version of 0.72 when 0.74 has been current for many years now.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 5 of 13, by polsimp

User metadata
Rank Newbie
Rank
Newbie

The radio interface is indeed set to 9600.

sudo stty -F /dev/ttyS0 9600

sudo stty -F /dev/ttyS0 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc

sudo dosbox
DOSBox version 0.74-3
Copyright 2002-2019 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file /root/.dosbox/dosbox-0.74-3.conf
MIXER:Got different values from SDL: freq 44100, blocksize 940
ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)
MIDI:Opened device:none

No more error 9 and I don't need sound or midi so it looks like I might be set.

Reply 6 of 13, by _Rob

User metadata
Rank Member
Rank
Member

Why don't you try if you can "talk" to it over serial from Linux first with something like "GTKTerm".

Also, by default a normal user does not have rights to the serial port. Instead of running dosbox with sudo, you probably should just add your user to the right group.

Just run the following to check which group:

ls -l /dev/ttyS*

And check the output for group ownership, most Linux distributions use "dialout" as the default group (a legacy of the modem days), so just add your user to the dialout group.

sudo usermod -aG dialout $USER

Reply 8 of 13, by polsimp

User metadata
Rank Newbie
Rank
Newbie

If you're like me you purchased your Optoscan-equipped scanner second hand and didn't get any software or instructions. These instructions are primarily for Linux users. If you're running Windows there is still plenty of helpful information.

1 ) Make sure you have a straight through cable, NOT a null modem cable. This step does not apply if you are using a USB to RS-232 adapter.

2 ) Open a terminal and and use this to find your port info.

dmesg | grep tty

I get this:

[ 0.110577] printk: console [tty0] enabled
[ 0.370421] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 0.391961] 0000:00:16.3: ttyS4 at I/O 0x40a0 (irq = 17, base_baud = 115200) is a 16550A

ttyS0 irq 4 is what I want so I use that info.
If you have a USB serial port adapter you should have ttyUSB0 instead of ttyS0.
Use your info for steps 4, 5 and 6.

3 ) Install latest version of Dosbox. Run it once so it generates a dosbox.conf file.

4 ) Change this line in dosbox.conf (located in .dosbox in your home folder) the line is near the bottom of the file, for me it's line 225.

serial1=directserial realport:ttyS0 irq:4

5 ) Change permission on the serial port. Replace $USER with your user name.

sudo usermod -aG dialout $USER

You will probably have to log out or restart for this to take effect.

6 ) Set serial port to 9600 baud.

sudo stty -F /dev/ttyS0 9600

7 ) Install Wine if it is not already installed. After Wine is installed, clicking on Windows executables like the test programs and Probe should open in a Dosbox window.

8 ) Optoscan test utilities and manuals can be found here: https://www.dropbox.com/sh/s6xqejez4ajfab3/AA … -FdlY44TDa?dl=0

9 ) The Optoscan manual states 9600 baud is the default. If you are using a newer computer a higher baud rate might get you faster scanning speeds, but it's probably best to make sure the computer is communicating with the Optoscan board first. In addition the DIP switches on the Optoscan board are most likely still in the default setting. Adjusting the the "CPU speed" of Dosbox will increase scanning speed. To adjust the CPU speed of Dosbox, press ctrl-F11 to decrease or ctrl-F12 to increase. Even at 9600 baud a CPU speed value of 15,000 gets me about 52 channels per second (Dosbox "cycles" are actually cycles per millisecond). You can manually add CPU speed to dosbox.conf if desired. To capture or release the cursor in Dosbox, press ctrl-F10.

10 ) Find some software to use with the Optoscan. I highly recommend Probe. Nothing else even comes close and it is more than worth the price.

Probe can be purchased here: https://www.datafileinc.com/purchasing.htm

keywords: optoelectronics optoscan lite 456 535 os456 os-456 os535 os-535 Linux serial port RS232 RS-232

Last edited by polsimp on 2021-10-31, 23:23. Edited 23 times in total.

Reply 10 of 13, by _Rob

User metadata
Rank Member
Rank
Member

As I mentioned, instead of changing ownership of the serial port, you add your user to the right group, typically "dialout".

Your suggestion of doing a chown is not persistent, because /dev will be re-created on reboot so any permissions you set on it will be lost.

If you really don't want to add your user to the group that has the right permissions, you can use udev rules to re-write the permissions. But take my word for it, that just doing a "usermod" like I showed above to add your user to the dialout group is a lot easier.

Reply 12 of 13, by _Rob

User metadata
Rank Member
Rank
Member

You may have to logout after the usermod for the changes to take effect. But the command should work.

Run "id" to check your users group memberships. Or you can run "getent group dialout" to check if your user is a member of the dialout group.