[root@dvhome vspd.tmp]# rpm -ivh ./vspd-1.11-linux.i586.rpm
Preparing... ####################### [100%]
- vspd ######################### [100%]
*RPM may report there about failed dependecies
[root@dvhome vspd.tmp]# tar xvfz ./vspd-1.11-linux.tar.gz -C /
usr/local/vspd-1.11-dist/
usr/local/vspd-1.11-dist/bin/
usr/local/vspd-1.11-dist/bin/vsptty
usr/local/vspd-1.11-dist/bin/vspd.sh.in
usr/local/vspd-1.11-dist/bin/vspm.sh.in
.... (skipped) ....
usr/local/vspd-1.11-dist/remove.sh
usr/local/vspd-1.11-dist/configure
usr/local/vspd-1.11-dist/README
[root@dvhome vspd.tmp]# uname -a >> ./report.txt
[root@dvhome vspd.tmp]# rpm -ivv ./vspd-1.11-linux.i586.rpm 2>> ./report.txt
Please, attach ./report.txt to your message when requesting support from Tibbo.
After completing 'pre-installation' section you should have /usr/local/vspd-x.yy-dist directory:
[root@dvhome local]# ls -l /usr/local/vspd-1.11-dist/
total 84
drwxr-xr-x 2 root root 4096 Dec 7 01:20 bin/
-rwx------ 1 root root 47674 Dec 2 11:13 configure*
drwxr-xr-x 2 root root 4096 Dec 7 01:20 etc/
drwxr-xr-x 2 root root 4096 Dec 2 11:13 include/
-rwx------ 1 root root 2595 Dec 2 11:13 install.sh*
drwxr-xr-x 3 root root 4096 Dec 7 01:20 lib/
drwxr-xr-x 2 root root 4096 Dec 7 01:20 man/
-rw-r--r-- 1 root root 3720 Dec 2 11:13 README
-rwx------ 1 root root 714 Dec 2 11:13 remove.sh*
drwxr-xr-x 2 root root 4096 Dec 7 01:20 sbin/
[root@dvorkin local]# ls -1 -R /usr/local/vspd-1.11-dist/
/usr/local/vspd-1.11-dist/:
bin/
/* binaries and startup scripts templates */
configure*
/* configuration script for building VSP module */
etc/
/* configuration files templates */
include/
/* <empty> */
install.sh*
/* main installation script */
lib/
/* module building directory */
man/
/* manuals */
README
/* comments */
remove.sh*
/* uninstall script */
sbin/
/* VSPDaemon directory */
/usr/local/vspd-1.11-dist/bin:
vspd.sh.in*
/* VSPDaemon startup script template */
vspm.sh.in*
/* VSPModule startup script template */
vsptty*
/* simple tty interaction utility */
/usr/local/vspd-1.11-dist/etc:
vspd.conf.in
/* VSPDaemon configuration file template */
vspd.conf.sample
/* VSPDaemon configuration file example */
vspm.conf
/* VSPModule configuration file template */
/usr/local/vspd-1.11-dist/include:
/* <empty> */
/usr/local/vspd-1.11-dist/lib:
src/
/* VSPModule sources */
/usr/local/vspd-1.11-dist/lib/src:
bsd/
/* BSD-specific makefiles directory */
config.h
/* module parameters */
ioctl_sys.h
ioctl_vspd.h
ioctl_vspm.h
/* ioctl headers */
linux/
/* LINUX-specific makefiles directory */
Makefile-fake.in
/* fake makefile */
Makefile.in
/* general makefile template (includes OS-specific makefile) */
_makewrapper.in
/* make wrapper (called automatically from install.sh) */
README
/* README file */
sysheaders.h
/* system-specific headers */
TODO
/* driver developer comments */
vspm.c
/* VSPModule source */
vspm.h
/* VSPModule header */
/usr/local/vspd-1.11-dist/lib/src/bsd:
Makefile-4.3.in
/* BSD-4.3 makefile */
/usr/local/vspd-1.11-dist/lib/src/linux:
Makefile-2.2-flags
/* Linux 2.2.x specific compilation flags */
Makefile-2.2.in
/* Linux-2.2 specific makefile template */
Makefile-2.4-flags
/* Linux 2.4.x specific compilation flags */
Makefile-2.4.in
/* Linux-2.4 specific makefile template */
Makefile-2.6.in
/* Linux-2.6 specific makefile template */
/usr/local/vspd-1.11-dist/man:
vspd
vspm
/* VSPD manuals */
/usr/local/vspd-1.11-dist/sbin:
vspd*
/* VSPDaemon binary */
[root@dvhome local]# cd /usr/local/vspd-1.11-dist/
[root@dvhome vspd-1.11-dist]# ./install.sh /usr/local/vspd
installing to /usr/local/vspd
creating cache ./config.cache
checking for target KERNEL... ok
checking for target KERNEL name... linux
checking for target KERNEL version... 2.4.22-10mdk
checking for target KERNEL subversion... 2.4
checking for target KERNEL path... /usr/src/linux-2.4.22-10mdk
checking for target MAKE_ARGS... make
checking for DEVFS... ok
********************* checking for required programms ******************
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for install... /usr/bin/install
checking for cp... /bin/cp
****************** checking for required header files ******************
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for ctype.h... yes
*********************** checking for functions *************************
checking for strerror... yes
************************ current settings ******************************
CC: gcc
CXX version: gcc-3.3.1 (GCC) 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
CXXFLAGS:
EXTRA_DEFINES:
EXTRA_SOURCES:
Using kernel: linux
Using kernel version: 2.4.22-10mdk
Using kernel subversion: 2.4
********************** making config.h and Makefile ********************
updating cache ./config.cache
creating ./config.status
creating lib/src/_makewrapper
creating lib/src/Makefile
creating lib/src/linux/Makefile-2.4
creating ./bin/vspd.sh
creating ./bin/vspm.sh
creating ./etc/vspd.conf
compiling the vspm kernel module ...
gcc -Wall -O2 -fomit-frame-pointer -I./ -D__KERNEL__ -DLINUX -DMODULE -DEXPORT_SYMTAB
-I/usr/src/linux-2.4.22-10mdk/include/ -c vspm.c -o ../vspm.ko
/* line split for documentation purposes - the two above should be one line. */
... (skipped) ...
installing ...
installing vspm ...
installing vspd ...
setting runlevels for vspm ...
setting runlevels for vspd ...
| %N% | it may take a long time to compile VSPModule on 2.6.x kernels, because some Linux distributions do not include precompiled kernel source tree. |
[root@dvorkin vspd-1.11-dist]# ls -1 -R /usr/local/vspd/
/usr/local/vspd/:
bin/
/* vsptty and startup scripts */
etc/
/* configuration files */
lib/
/* compiled VSPModule */
man/
/* manuals and docs*/
sbin/
/* VSPDaemon directory */
var/
/* logs directory */
/usr/local/vspd/bin:
vspd.sh*
/* VSPDaemon startup script */
vspm.sh*
/* VSPModule startup script */
vsptty*
/* simple tty interaction programm */
/usr/local/vspd/etc:
vspd.conf
/* running VSPDaemon configuration */
vspd.conf.in
/* VSPDaemon configuration template */
vspd.conf.sample
/* VSPDaemon configuration example */
vspm.conf
/* VSPModule configuration */
/usr/local/vspd/lib:
vspm.ko*
/* VSPModule compiled binary */
/usr/local/vspd/man:
vspd
vspm
/* VSPDaemon and VSPModule manuals */
/usr/local/vspd/sbin:
vspd*
/* VSPDaemon binary */
/usr/local/vspd/var:
/* directory for log files */
install.sh shell script takes one command-line parameter: Installation path.
[root@dvorkin vspd-1.11-dist]# ./install.sh
You don't have to install to the same path
Use ./install.sh <path>
First, it runs ./configure script. The ./configure script takes system enviroment and creates ./lib/src/_makewrapper (from ./lib/src/_makewrapper.in), ./lib/src/Makefile (from ./lib/src/Makefile.in) and ./lib/src/linux/Makefile-X.Y (from ./lib/src/linux/Makefile-x.y.in, where <x.y> is linux kernel subversion code). The ./configure script takes a number of parameters:
[root@dvorkin vspd-1.11-dist]# ./
[root@dvorkin vspd-1.11-dist]# ./configure --help
Usage: configure [options] [host]
Options:
Configuration:
--cache-file=FILE cache test results in FILE
... (skipped) ...
--enable and --with options recognized:
--with-kernel=<name>: compile for <name> kernel (example: "linux")
--with-kernel-ver=<ver>: compile for <ver> kernel version (example: "2.4.22-10mdk")
--with-kernel-subver=<ver>: compile for <subver> kernel version (example: "2.4")
You can change script parameters by editing install.sh
./configure script tries to detect your kernel version and use suitable kernel sources from /usr/src/linux-x.y…/. You must have kernel sources in /usr/src/linux-…/ directory to successfully install VSPDL
Second, install.sh runs /usr/local/vspd-x.yy-dist/lib/src/_makewrapper script, created from /usr/local/vspd-x.yy-dist/lib/src/_makewrapper.in by ./configure script. ./_makewrapper returns 0 (on success) or error code (on compilation error) to ./install.sh shell sript. ./_makewrapper runs “make <OS-specific params>”. It uses ./lib/src/linux/Makefile-x.y, included in ./lib/src/Makefile.
You can change compilation parameters (for example, to compile for other kernel subversions) by editing ./lib/src/Makefile and ./lib/src/linux/Makefile-x.y.
Third, install.sh places startup scripts into your RC.* directories, and creates /usr/local/vspd directory tree.
[root@dvorkin vspd-1.11-dist]# cd /usr/local/vspd-1.11-dist/
[root@dvorkin vspd-1.11-dist]# uname -a >> ./report.txt
[root@dvorkin vspd-1.11-dist]# ./install.sh /usr/local/vspd >> ./report.txt 2>> ./report.txt
[root@dvorkin vspd-1.11-dist]# cat ./lib/src/Makefile >> ./report.txt
[root@dvorkin vspd-1.11-dist]# cat ./lib/src/linux/* >> ./report.txt
Please, attach ./report.txt to your message when requesting support from Tibbo.
There are four configuration files in the VSPD installation directory:
[root@dvorkin vspd-1.11-dist]# ls /usr/local/vspd/etc/
[root@dvorkin src]# ls -1 /usr/local/vspd/etc
vspd.conf
/* VSPDaemon configuration file */
vspd.conf.in
/* VSPDaemon configuration template */
vspd.conf.sample
/* VSPDaemon configuration example */
vspm.conf
/* VSPModule configuration file */
[root@dvorkin etc]# cat /usr/local/vspd/etc/vspm.conf
# Virtual Serial Port module config file
# Copyright (C) 2003, Tibbo Technology Inc.
# ----- module section
# You may use # as comment
# For example if you want to set MAXDEV as default,
# you have to comment the string
# "MAXDEV=100" -> "#MAXDEV=100"
# maximum number of devices
# default MAXDEV=128
#MAXDEV=128
# major number for serial devices
# set major number, if you aren't using devfs
# default MAJOR0=100
MAJOR0=100
# major number for daemon devices
MAJOR1=101
# debug level
# 0 = no debug
# 1 = simple kernel messages
# 2 = development debug
# 3 = development debug with <select>
# default DEBUG=1
DEBUG=0
# ----- /dev section
# set DEVFS=true if you are using devfs
# otherwise set DEVFS=false
# set DEVFS=auto if you not sure about your devfs state
# default: auto
# DEVFS=auto
# device files prefix
# default FNAME=vsp
FNAME=vsp
# group name for the device files
# default FGRP=root
FGRP=root
# access mode for the device files
# default FMOD=660
FMOD=660
You don't have to edit this file - all variables are set up to correct values automatically at the installation phase. All you need to know is how to set up debug level. For VSPModule debugging you have to change “DEBUG=…” variable to the appropriate value and restart VSPModule. All messages will be sent to syslog (/var/log/messages usually).
[root@dvorkin etc]# cat /usr/local/vspd/etc/vspd.conf
...(skipped)...
Change all IPs and PORTs in vspd.conf to suitable values, in the following sections:
<bind .../>, =<vsp num=...><bind .../></vsp>, <vsp num=...><destination .../></vsp>
(Device servers should be configured to allow connections from or connect to these IP addresses)
Choose connection mode for your device using the following section:
<vsp ...><connection .../></vsp>
Don't forget to put device servers into the corresponding connection mode.
Optionally, change packet settings:
<vsp ...><packets .../></vsp>
Uncomment
<!-- <log type="file" level="DBG" path="var/dev.0.log"/> -->
string for debugging output:
<log type="file" level="DBG" path="var/dev.0.log"/>
and replace
<!-- Example: <dump port="yes" path="var/vspd.log"/> -->
by
<dump port="yes" path="var/vspd.0.log"/>
to see hexadecimal dump of data transferred through the virtual serial ports.
There are two startup scripts installed into /etc/rc.d/init.d/ directory and started during OS boot:
[root@dvorkin etc]# ls -l /etc/rc.d/init.d/vsp*
-rwxr--r-- 1 root root 2439 Dec 7 12:28 /etc/rc.d/init.d/vspm*
-rwxr--r-- 1 root root 2290 Dec 7 12:28 /etc/rc.d/init.d/vspd*
and symlinks in /etc/rc.d/rc<X>.d/vsp*.
Run these scripts without parameters to see help:
[root@dvorkin etc]# /etc/rc.d/init.d/vspd
Usage /etc/rc.d/init.d/vspd {start|stop|restart|reloadconf|status|extstatus}
[root@dvorkin etc]# /etc/rc.d/init.d/vspm
Usage /etc/rc.d/init.d/vspm {start|stop|restart|status|conf|modinfo}
You can call startup scripts from command line. Here are some examples:
[root@dvorkin etc]# /etc/rc.d/init.d/vspm start
installing vspm.ko module to kernel... [ OK ]
[root@dvorkin etc]# /etc/rc.d/init.d/vspm restart
removing vspm.ko module from kernel... [ OK ]
installing vspm.ko module to kernel... [ OK ]
[root@dvorkin etc]# /etc/rc.d/init.d/vspm status
vspm.ko module is loaded
[root@dvorkin etc]# /etc/rc.d/init.d/vspm conf
module name: vspm.ko
module path: /usr/local/vspd/lib/
module conf: /usr/local/vspd/etc/vspm.conf
insmod : /sbin/insmod
rmmod : /sbin/rmmod
lsmod : /sbin/lsmod
modinfo : /sbin/modinfo
[root@dvorkin etc]# /etc/rc.d/init.d/vspm modinfo
filename: /usr/local/vspd/lib/vspm.ko
description: "Virtual Serial Port driver"
author: "(C) by Tibbo Technology Inc., 2004"
license: "GPL"
parm: major0 int, description "Major number for tty devices"
parm: major1 int, description "Major number for daemon interface devices"
parm: debug int, description "Debug level (0-2)"
parm: maxdev int, description "Max. number of devices"
[root@dvorkin etc]# /etc/rc.d/init.d/vspd start
starting vspd... [ OK ]
[root@dvorkin etc]# /etc/rc.d/init.d/vspd restart
stopping vspd... [ OK ]
starting vspd... [ OK ]
[root@dvorkin etc]# /etc/rc.d/init.d/vspd reloadconf
tell vspd to reload configuration... [ OK ]
[root@dvorkin etc]# /etc/rc.d/init.d/vspd status
vspd is loaded
[root@dvorkin etc]# /etc/rc.d/init.d/vspd extstatus
vspd is loaded
[root@dvorkin etc]# /etc/rc.d/init.d/vspd stop
stopping vspd... [ OK ]
[root@dvorkin etc]# /etc/rc.d/init.d/vspd extstatus
/var/run/vspd.pid not found
vspd is NOT loaded
To start VSPD run /etc/rc.d/init.d/vspm followed by /etc/rc.d/init.d/vspd:
[root@dvorkin etc]# /etc/rc.d/init.d/vspm start
installing vspm.ko module to kernel... [ OK ]
[root@dvorkin etc]# /etc/rc.d/init.d/vspd start
starting vspd... [ OK ]
After calling /etc/rc.d/init.d/vspm start check if there are device files created in /dev/:
[root@dvorkin etc]# ls -l -R /dev/vsp*
/dev/vsp:
total 0
crw------- 1 root root 101, 0 Jan 1 1970 vspd0
... (skipped) ...
crw------- 1 root root 101, 0 Jan 1 1970 vspd127
crw------- 1 root root 101, 0 Jan 1 1970 vsps0
... (skipped) ...
crw------- 1 root root 101, 0 Jan 1 1970 vsps127
The /dev/vsps<N> (or /dev/vsp/vsps<N>) device files are virtual serial ports to be used by your device control software,
/dev/vspd<N> (/dev/vsp/vspd<N>) device files are used for internal purposes by VSPDL itself and should not be opened by third-party software.
[root@dvorkin etc]# uname -a >> ./report.txt
[root@dvorkin etc]# /etc/rc.d/init.d/vspm start >> ./report.txt
[root@dvorkin etc]# /etc/rc.d/init.d/vspd start >> ./report.txt
[root@dvorkin etc]# cat /usr/local/vspd/etc/vspm.conf >> ./report.txt
[root@dvorkin etc]# cat /usr/local/vspd/etc/vspd.conf >> ./report.txt
[root@dvorkin etc]# tail -n 1000 /var/log/messages >> ./report.txt
[root@dvorkin etc]# tail -n 1000 /usr/local/vspd/var/vspd.log >> ./report.txt
[root@dvorkin etc]# tail -n 1000 /usr/local/vspd/var/dev.0.log >> ./report.txt
Stop VSPmodule and VSPDaemon
#/etc/rc.d/init.d/vspd stop
#/etc/rc.d/init.d/vspm stop
Set up debug mode:
in /usr/local/vspd/etc/vspm.conf change
DEBUG=0
to
DEBUG=3
in /usr/local/vspd/etc/vspd.conf change
<!-- <log type="file" level="DBG" path="var/dev.0.log"/> -->
to
<log type="file" level="DBG" path="var/dev.0.log"/>
and
<!-- Example: <dump port="yes" path="var/vspd.log"/> -->
to
<dump port="yes" path="var/dev.0.log"/>
Startup VSModule:
#/etc/rc.d/init.d/vspm start
Switch to the other console window and try to send data throw virtual ports :
(1st console):#cat /dev/vsp/vsps0
(2nd console):#echo "testing - vspD" > /dev/vsp/vspd0
do you see “testing - vspD” on 1 console?
(1st console):#cat /dev/vsp/vspd0
(2nd console):#echo "testing - vspS" > /dev/vsp/vsps0
do you see “testing - vspS” on 1st console?
If you don't see any output, proceed to section 3.1
Please, attach ./report.txt to your message when requesting support from Tibbo
Start up VSPDaemon:
[root@dvorkin etc]# /etc/rc.d/init.d/vspd start
Check if VSPDaemon running:
[root@dvorkin etc]# ps auxw | grep "vspd"
[root@dvorkin etc]# /etc/rc.d/init.d/vspd extstatus
If VSPDaemon is not running, proceed to section 3.1
Please, attach ./report.txt to your message when requesting support from Tibbo
Look at the /usr/local/vspd/var/dev.0.log:
[root@dvorkin etc]# tail -f /usr/local/vspd/var/dev.0.log
Most problems (wrong IP/ports etc.) can be diagnosed by checking this log file.
Make changes in /usr/local./vspd/etc/vspd.conf:
<connection rmode="server/client" proto="tcp" conmode="ondata" timeout="5" onthefly="outofband"/>
replace with
<connection rmode="server" proto="tcp" conmode="immediately" timeout="5" onthefly="disabled"/>
And restart VSPDaemon:
[root@dvorkin etc]# /etc/rc.d/init.d/vspd restart
Call minicom:
#minicom -o
press <Ctrl> + <A>, <O>
choose "Serial port setup", press <Enter>
press <A>, write /dev/vsp/vsps0, press <Enter>, press <Enter>
choose "Save setup as ...", press <Enter>,
write "vsps0", press <Enter>
choose "Exit", press <Enter>
press <Ctrl>+<A>, <Q>, press <Enter>
(minicom interrupted). Call minicom again:
#minicom -o vsps0
Open VSPD log in the second console window:
(console 2)#tail -f /usr/local/vspd/var/dev.0.log
you should see message: “port opened”
Open telnet session in the third console window:
(console 3)#telnet 10.1.1.1 3500
where 10.1.1.1 - ip addr from
<bind .../>
section of vspd.conf file and 3500 - port value from <vsp …><bind …/></vsp> section from vspd.conf file.
if connection was refused, check IP:port settings in vspd.conf file.
Now VSPDL is ready for data transfer. Type string “test<Enter>” in the second
console window (minicom) and look for the output in the third console window. Is “test” appeared in the output?
Write string “test again<Enter>” in the third console and look to the second console. Is “test” appeared in the output?
/dev/vsps<N> (/dev/vsp/vsps<N>) are virtual TTY device files.
/dev/vspd<N> (/dev/vsp/vspd<N>) are used by VSPDL for internal purposes.
[vspm] ioct1_D CMD0x5415 bad magic
[vspm] ioct1_D CMD0x5401 bad magic
[vspm] ioct1_D CMD0x5402 bad magic
[vspm] ioct1_D CMD0x5418 bad magic
You should not open /dev/vspd<N> devices by minicom.
Use /dev/vsps<N> devices instead.