30-Jul-2014 These notes should accompany the word doc InstallingMOXAonDebian.docx r.schramm root@VENTANA1:~# apt-cache search linux-headers-$(uname -r) linux-headers-3.2.0-4-686-pae - Header files for Linux 3.2.0-4-686-pae root@VENTANA1:~# apt-get install linux-headers-$(uname -r) Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: cpp-4.6 gcc-4.6 gcc-4.6-base linux-headers-3.2.0-4-common linux-kbuild-3.2 Suggested packages: gcc-4.6-locales gcc-4.6-multilib libmudflap0-4.6-dev gcc-4.6-doc libgcc1-dbg libgomp1-dbg libquadmath0-dbg libmudflap0-dbg binutils-gold The following NEW packages will be installed: cpp-4.6 gcc-4.6 gcc-4.6-base linux-headers-3.2.0-4-686-pae linux-headers-3.2.0-4-common linux-kbuild-3.2 0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. Need to get 16.5 MB of archives. After this operation, 54.8 MB of additional disk space will be used. Do you want to continue [Y/n]? Y Get:1 http://debian.osuosl.org/debian/ wheezy/main gcc-4.6-base i386 4.6.3-14 [142 kB] Get:2 http://security.debian.org/ wheezy/updates/main linux-headers-3.2.0-4-common i386 3.2.60-1+deb7u3 [3,571 kB] Get:3 http://debian.osuosl.org/debian/ wheezy/main cpp-4.6 i386 4.6.3-14 [4,654 kB] Get:4 http://security.debian.org/ wheezy/updates/main linux-headers-3.2.0-4-686-pae i386 3.2.60-1+deb7u3 [610 kB] Get:5 http://debian.osuosl.org/debian/ wheezy/main gcc-4.6 i386 4.6.3-14 [7,338 kB] Get:6 http://debian.osuosl.org/debian/ wheezy/main linux-kbuild-3.2 i386 3.2.17-1 [233 kB] Fetched 16.5 MB in 3s (5,431 kB/s) Selecting previously unselected package gcc-4.6-base:i386. (Reading database ... 178519 files and directories currently installed.) Unpacking gcc-4.6-base:i386 (from .../gcc-4.6-base_4.6.3-14_i386.deb) ... Selecting previously unselected package cpp-4.6. Unpacking cpp-4.6 (from .../cpp-4.6_4.6.3-14_i386.deb) ... Selecting previously unselected package gcc-4.6. Unpacking gcc-4.6 (from .../gcc-4.6_4.6.3-14_i386.deb) ... Selecting previously unselected package linux-headers-3.2.0-4-common. Unpacking linux-headers-3.2.0-4-common (from .../linux-headers-3.2.0-4-common_3.2.60-1+deb7u3_i386.deb) ... Selecting previously unselected package linux-kbuild-3.2. Unpacking linux-kbuild-3.2 (from .../linux-kbuild-3.2_3.2.17-1_i386.deb) ... Selecting previously unselected package linux-headers-3.2.0-4-686-pae. Unpacking linux-headers-3.2.0-4-686-pae (from .../linux-headers-3.2.0-4-686-pae_3.2.60-1+deb7u3_i386.deb) ... Setting up gcc-4.6-base:i386 (4.6.3-14) ... Setting up cpp-4.6 (4.6.3-14) ... Setting up gcc-4.6 (4.6.3-14) ... Setting up linux-headers-3.2.0-4-common (3.2.60-1+deb7u3) ... Setting up linux-kbuild-3.2 (3.2.17-1) ... Setting up linux-headers-3.2.0-4-686-pae (3.2.60-1+deb7u3) ... root@VENTANA1:~# ************** root@VENTANA1:~# cd /usr/src root@VENTANA1:/usr/src# ls linux-headers-3.2.0-4-686-pae linux-headers-3.2.0-4-common linux-kbuild-3.2 root@VENTANA1:/usr/src# ls -la total 16 drwxr-xr-x 4 root root 4096 Jul 30 13:32 . drwxr-xr-x 10 root root 4096 Jul 30 10:13 .. drwxr-xr-x 4 root root 4096 Jul 30 13:32 linux-headers-3.2.0-4-686-pae drwxr-xr-x 4 root root 4096 Jul 30 13:32 linux-headers-3.2.0-4-common lrwxrwxrwx 1 root root 23 Jun 23 2012 linux-kbuild-3.2 -> ../lib/linux-kbuild-3.2 root@VENTANA1:/usr/src# ************************** root@VENTANA1:~# cd /lib/modules/3.2.0-4-686-pae/ root@VENTANA1:/lib/modules/3.2.0-4-686-pae# ls -la total 3048 drwxr-xr-x 3 root root 4096 Jul 30 13:32 . drwxr-xr-x 3 root root 4096 Jul 30 10:20 .. lrwxrwxrwx 1 root root 38 Jul 23 12:41 build -> /usr/src/linux-headers-3.2.0-4-686-pae drwxr-xr-x 10 root root 4096 Jul 30 10:20 kernel -rw-r--r-- 1 root root 741536 Jul 30 10:22 modules.alias -rw-r--r-- 1 root root 716862 Jul 30 10:22 modules.alias.bin -rw-r--r-- 1 root root 3034 Jul 23 12:41 modules.builtin -rw-r--r-- 1 root root 4158 Jul 30 10:22 modules.builtin.bin -rw-r--r-- 1 root root 352024 Jul 30 10:22 modules.dep -rw-r--r-- 1 root root 488620 Jul 30 10:22 modules.dep.bin -rw-r--r-- 1 root root 325 Jul 30 10:22 modules.devname -rw-r--r-- 1 root root 117483 Jul 23 12:41 modules.order -rw-r--r-- 1 root root 131 Jul 30 10:22 modules.softdep -rw-r--r-- 1 root root 287413 Jul 30 10:22 modules.symbols -rw-r--r-- 1 root root 365278 Jul 30 10:22 modules.symbols.bin lrwxrwxrwx 1 root root 37 Jul 23 12:41 source -> /usr/src/linux-headers-3.2.0-4-common root@VENTANA1:/lib/modules/3.2.0-4-686-pae# ************** rich@VENTANA1:/tmp$ ls /dev autofs dvdrw loop5 psaux sndstat tty19 tty34 tty5 tty8 vcsa1 block dvdrw1 loop6 ptmx sr0 tty2 tty35 tty50 tty9 vcsa2 bsg fd loop7 pts stderr tty20 tty36 tty51 ttyS0 vcsa3 btrfs-control full loop-control random stdin tty21 tty37 tty52 ttyS1 vcsa4 bus fuse lp0 rfkill stdout tty22 tty38 tty53 ttyS2 vcsa5 cdrom hidraw0 MAKEDEV root tty tty23 tty39 tty54 ttyS3 vcsa6 cdrom1 hidraw1 mapper rtc tty0 tty24 tty4 tty55 uinput vcsa7 cdrw hidraw2 mcelog rtc0 tty1 tty25 tty40 tty56 urandom vga_arbiter cdrw1 hpet mem sda tty10 tty26 tty41 tty57 vcs xconsole char input net sda1 tty11 tty27 tty42 tty58 vcs1 zero console kmsg network_latency sda2 tty12 tty28 tty43 tty59 vcs2 core log network_throughput sda3 tty13 tty29 tty44 tty6 vcs3 cpu loop0 null sg0 tty14 tty3 tty45 tty60 vcs4 cpu_dma_latency loop1 oldmem sg1 tty15 tty30 tty46 tty61 vcs5 disk loop2 parport0 shm tty16 tty31 tty47 tty62 vcs6 dvd loop3 port snapshot tty17 tty32 tty48 tty63 vcs7 dvd1 loop4 ppp snd tty18 tty33 tty49 tty7 vcsa rich@VENTANA1:/tmp$ ************************************* rich@VENTANA1:~$ cp ~/Downloads/MOXA/npreal2_1.18.33_build_14060316.tgz /tmp rich@VENTANA1:~$ cd /tmp rich@VENTANA1:~$ tar -xzvf npreal2_1.18.33_build_14060316.tgz rich@VENTANA1:~$ cd moxa rich@VENTANA1:/tmp/moxa$ sudo ./mxinst [sudo] password for rich: =============================================================================== Copyright (C) 2002-2014 Moxa Inc. All Rights Reserved. MOXA NPort Server Real TTY Driver V1.18.33 Installation. System Information: Kernel 3.2.0-4-686-pae; Machine i686. =============================================================================== Tar files, please wait ... OK! Building driver... If you want to use secure communication with target, you might choose [y] to enable the SSL function. Note: This function support RealCOM with secure mode only. Do you want to enable secure function? [y/N]. ***** PICK NO ****** N make -C /lib/modules/3.2.0-4-686-pae/build SUBDIRS=/tmp/moxa modules make[1]: Entering directory `/usr/src/linux-headers-3.2.0-4-686-pae' Building modules, stage 2. MODPOST 1 modules make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-4-686-pae' cp -p npreal2.ko /lib/modules/3.2.0-4-686-pae/kernel/drivers/char/ depmod -a cc -c npreal2d.c cc npreal2d.o -o npreal2d strip npreal2d cc -c redund_main.c cc -c redund.c cc redund_main.o redund.o -lpthread -o npreal2d_redund strip npreal2d_redund cc -o mxaddsvr mxaddsvr.c strip mxaddsvr cc -o mxdelsvr mxdelsvr.c strip mxdelsvr cc -o mxcfmat mxcfmat.c strip mxcfmat cc -o mxloadsvr mxloadsvr.c strip mxloadsvr cc -o mxsetsec mxsetsec.c strip mxsetsec Check Driver... Copying configurations files ... OK! Copying driver files ... OK! Load driver... OK! Loading TTY Driver... update-rc.d: using dependency based boot sequencing Complete. =============================================================================== Installation process is completed. The all driver files are installed on /usr/lib/npreal2/driver. Now you can cd /usr/lib/npreal2/driver and run ./mxaddsvr to add tty port. =============================================================================== rich@VENTANA1:/tmp/moxa$ *** look at /usr/lib/npreal2/driver **** **************** Map TTY Ports using MOXA mxaddsvr *********************** root@VENTANA1:/lib/modules/3.2.0-4-686-pae# cd /usr/lib/npreal2/driver root@VENTANA1:/usr/lib/npreal2/driver# ls config Makefile mxcfmat mxloadsvr mxrmnod mxuninst npreal2d npreal2d.cf npreal2.h killp mxaddsvr mxdelsvr mxmknod mxsetsec npreal2.c npreal2d.c npreal2d_redund root@VENTANA1:/usr/lib/npreal2/driver# ./mxaddsvr 134.89.10.205 8 Adding Server... ttyr00, cur00 ttyr01, cur01 ttyr02, cur02 ttyr03, cur03 ttyr04, cur04 ttyr05, cur05 ttyr06, cur06 ttyr07, cur07 Added RealCom server: ip : 134.89.10.205 mknod -m 666 ttyr00 c 33 0 mknod -m 666 cur00 c 38 0 mknod -m 666 ttyr01 c 33 1 mknod -m 666 cur01 c 38 1 mknod -m 666 ttyr02 c 33 2 mknod -m 666 cur02 c 38 2 mknod -m 666 ttyr03 c 33 3 mknod -m 666 cur03 c 38 3 mknod -m 666 ttyr04 c 33 4 mknod -m 666 cur04 c 38 4 mknod -m 666 ttyr05 c 33 5 mknod -m 666 cur05 c 38 5 mknod -m 666 ttyr06 c 33 6 mknod -m 666 cur06 c 38 6 mknod -m 666 ttyr07 c 33 7 mknod -m 666 cur07 c 38 7 update-rc.d: using dependency based boot sequencing Complete. root@VENTANA1:/usr/lib/npreal2/driver# ********************************************** ls /dev should now show: ttyr00, cur00 ttyr01, cur01 ttyr02, cur02 ttyr03, cur03 ttyr04, cur04 ttyr05, cur05 ttyr06, cur06 ttyr07, cur07 ***************** look at the cfg file...******** rich@VENTANA1:/usr/lib/npreal2/driver$ more npreal2d.cf #=========================================================# # This configuration file is created by Moxa NPort # # Administrator Program automatically, please do not # # modify this file by yourself. # #=========================================================# ttymajor=33 calloutmajor=38 #[Minor] [ServerIP] [data] [cmd] [FIFO] [SSL] [ttyName] [coutName] [interface][mode][BackIP] 0 134.89.10.205 950 966 1 0 ttyr00 cur00 0 0 1 134.89.10.205 951 967 1 0 ttyr01 cur01 0 0 2 134.89.10.205 952 968 1 0 ttyr02 cur02 0 0 3 134.89.10.205 953 969 1 0 ttyr03 cur03 0 0 4 134.89.10.205 954 970 1 0 ttyr04 cur04 0 0 5 134.89.10.205 955 971 1 0 ttyr05 cur05 0 0 6 134.89.10.205 956 972 1 0 ttyr06 cur06 0 0 7 134.89.10.205 957 973 1 0 ttyr07 cur07 0 0 rich@VENTANA1:/usr/lib/npreal2/driver$ ************************ install dinc and test ************ sudo cp dinc.tar.gz /usr/local/share cd /usr/local/share sudo gunzip dinc.tar sudo tar -xvf dinc.tar cd dinc sudo make sudo ln -s /usr/local/share/dinc/dinc /usr/bin/dinc install loopback DB9 connector on first port then type: dinc /dev/ttyr00 ------ DINC --- port=/dev/ttyr00 ------ 9600 BAUD 8 NONE 1 SWFC=ON HWFC=OFF CAR=OFF DTR=ON RTS=ON CTS=OFF DSR=OFF Type ~? for help. this is a test!! ~x <<<<<<<<<<<