MOXA Nport在二所ATC的使用方式(川大是UDP方式)

mi_zy發表於2013-06-19
NPort 5610-8
Firmware Version:3.3 Build 08042219
AirNet的GPS/QNH/AFTN使用Real COM Mode方式引接!

一、配置
這是moxa驅動的安裝指令碼:
function install_moxa_driver
{
 if [ "$nodeApp" == "BSDP" ] ; then
  index=$nodeNum
  index=$(($index+4))
#  echo index=$index
 else
  index=$nodeNum
 fi
 #  [-abcEFGhHilLnqrsvVwxy][-A][-B][-C][-d][-e][-f][--help][範本樣式][檔案或目錄...]

 nportIpAdd=`grep "NPORT$index\>" config/system/hosts_NetA |awk '{if(NF==2) print $1}'`
 echo "install moxa driver..."
 rm -rf /tmp/moxa
 cp drivers/moxa/npreal2_1.14_Build_07062310.tgz /
 
 cd /
 tar zxvf npreal2_1.14_Build_07062310.tgz
 
 (sleep 1;echo 1;) | /usr/lib/npreal2/driver/mxdelsvr $nportIpAdd > /dev/null 2
 /usr/lib/npreal2/driver/mxuninst > /dev/null 2
 cd /tmp/moxa
 ./mxinst SP1
 if [ "$nodeApp"="FDP" ] || [ "$nodeApp" = "MSDP" ] || [ "$nodeApp" = "BSDP" ] || [ "$nodeApp" = "ALR" ] ;then
  cd /usr/lib/npreal2/driver
  ./mxaddsvr $nportIpAdd 8
  ./mxloadsvr
 fi
 rm -f /npreal2*.tgz
 cd $pkgPath
}
透過Nport引接GPS、報文和QNH訊號,將串列埠訊號轉為網路訊號:Nport必須配置為real com方式。

 

安裝驅動NPort Linux Real TTY Driver,安裝指令碼定義驅動目錄:driverPath="/usr/lib/npreal2/driver"
!!!!!!!!!!!!!!!!!!!!!!!!!!!! NOTE 1!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   For Red Hat AS/ES/WS and Fedora Core1, extra argument is
   needed: # /tmp/moxa/mxinst SP1
!!!!!!!!!!!!!!!!!!!!!!!!!!!! NOTE 1!!!!!!!!!!!!!!!!!!!!!!!!!!!!
安裝完驅動後在 "/usr/lib/npreal2/driver"目錄產生以下檔案:
     - mxaddsvr (Add Server, map tty port)
     - mxsetsec (Set secure communication mode)
     - mxdelsvr (Delete Server, un-map tty port)
     - mxloadsvr (Reload Server)
     - mxuninst (Remove tty port and driver files)
需要完成TTY埠對映:
 run "./mxaddsvr" to add tty port.: 
語法:mxaddsvr [NPort IP Address] [Total Ports] ([Data port] [Cmd port])
      In Example 1:
       # cd /usr/lib/npreal2/driver
       # ./mxaddsvr 192.168.3.4 16
 16 tty ports will be added, all with IP 192.168.3.4,
      but with data ports equal to (950, 951, ..., 965), and command ports
      equal to (966, 967, 968, ..., 981).

 

tty命名規則:
The driver difference under 2.6 and 2.4 kernel:
The cur* device is obsolete. That is,you can't use cum* device under kernel 2.6.
    The tty name of the Real TTY driver is configured in npreal2d.cf.
     The pre-defined tty name is ttyrXX, and the callout name is curXX.
     The naming convention is illustrated as follows:
     Nport Server     TTY Name                Callout Name(標註名稱)
     1st(4port)       ttyr00 - ttyr03         cur00 - cur03
     2nd(8port)       ttyr04 - ttyr0b         cur04 - cur0b
     3rd(16port)      ttyr0c - ttyr1b         cur0c - cur1b
     4th(8port)       ttyr1c - ttyr23         cur1c - cur23
     ...(etc.)
標註名稱: 標註裝置在Linux 2.6是過時不可用的。
For Red Hat
       The script. file "/etc/rc.d/rc.local" will be executed when Linux
       boots up. Therefore the driver will append the instructions which
       is used to load Real TTY driver in the script. file.
這個任務由mxinst指令碼以下語句完成:
#append "modprobe npreal2" in /etc/rc.d/rc.local.
cd $NPPATH/driver
./mxloadsvr install

二、問題
 1) 使用伺服器IBM System x3650(記憶體1G)安裝32位RHEL5.8,將記憶體擴到16G,需要安裝 /vmlinuz-2.6.18- 53.el5PAE,以<1span style="color:#434343;font-family:" font-size:16px;text-indent:32px;white-space:normal;background-color:#ffffff;"="">支援4G以上記憶體。
但是引起MOXA驅動異常:
ERROR: Module npreal2 does not exist in /proc/modules
=========================================================
Copyright (C) 2002-2007  Moxa Technologies Co., Ltd.
All Rights Reserved.

MOXA NPort Server Real TTY Driver V1.14 Installation.
System Imformation: Kernel 2.6.18-53.el5PAE; 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].
make -C /lib/modules/2.6.18-53.el5PAE/build SUBDIRS=/tmp/moxa modules
make: *** /lib/modules/ 2.6.18-53.el5PAE/build: No such file or directory.  Stop.
make: *** [module] Error 2
Check Driver...
FAILED !!!
 
Install Not Completed !
 
./install: line 505: cd: /usr/lib/npreal2/driver: No such file or directory
./install: line 506: ./mxaddsvr: No such file or directory
./install: line 507: ./mxloadsvr: No such file or directory

MOXA驅動異常,造成FDP(fdp程式)MSDP(tsp/qnh程式)啟動失敗,因為該伺服器有程式是Down狀態,該伺服器只能是Standby狀態。
* 記憶體加到8G後,重新安裝RHEL5.8,使用“ 一致”的 PAE核心,重新安裝MOXA驅動OK。這樣與MOXA串列埠有關的程式FDP/tsp/qnh均執行正常( 否則程式為Down狀態)。

*:為了支援大記憶體,rpm -ivh kernel-PAE-2.6.18-308.el5.i686.rpm,出現上述報錯:“make -C /lib/modules/2.6.18-53.el5PAE/build SUBDIRS=/tmp/moxa modules...”,需要rpm -ivh kernel- PAE-devel-2.6.18-308.el5.i686.rpm後,再次執行命令安裝/tmp/moxa/mxinst,重啟OS後OK。


2)關於NPORT的監控:

檢查nport的snmp協議是否開啟,方法如下:任意網域內的終端輸入 :
    snmpwalk -v 1 nportIp -c public 1.3.6.1.2.1.2.1
如果輸出是nport擁有的埠數量(硬體)就是開啟了snmp協議;SMC對NPORT的監控判定中,對於返回的埠數<=8才是有效的,超過認為是無效的,所以16個埠的NPort 5610-16監控是灰色的,但是不影響訊號使用。

2018.3.29

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7970627/viewspace-764358/,如需轉載,請註明出處,否則將追究法律責任。

相關文章