增加新开普POS机安装文档
diff --git "a/source/_posts/\344\270\200\345\215\241\351\200\232\346\226\260\345\274\200\346\231\256POS\346\234\272\345\256\211\350\243\205\350\257\264\346\230\216.md" "b/source/_posts/\344\270\200\345\215\241\351\200\232\346\226\260\345\274\200\346\231\256POS\346\234\272\345\256\211\350\243\205\350\257\264\346\230\216.md"
new file mode 100644
index 0000000..1d081a4
--- /dev/null
+++ "b/source/_posts/\344\270\200\345\215\241\351\200\232\346\226\260\345\274\200\346\231\256POS\346\234\272\345\256\211\350\243\205\350\257\264\346\230\216.md"
@@ -0,0 +1,186 @@
+---
+title: 一卡通新开普POS机安装说明
+date: 2016-07-08 10:08:03
+tags:
+---
+
+# 一卡通在线交易平台POS机安装指南
+
+## 1. 平台组成
+* 悦校平台 WebService 服务
+
+> WebService 服务是 J2EE 架构的服务程序,部署在 Tomcat 7 以上版本,服务器要求采用 Linux 64 为系统,硬件配置 CPU 双核、内存 4G 以上、硬盘 200G 以上。
+
+* 消费终端前置机
+
+> 消费终端前置机为网关提供接入服务。该程序支持 Linux Centos6 64 位或 Windows 64 位。服务器硬件配置要求  单核 CPU、内存 4G 以上、硬盘 200G 以上。
+
+* 新开普网关
+
+> 新卡普网关为专用设备,负责将 POS 机的 CAN 协议数据转换成 TCP 协议数据,并发送给消费终端前置机
+
+## 2. 部署指南
+### 消费终端前置机
+* 程序
+
+> 消费终端前置机程序包括主程序 newcapec-can-<os> 和配置文件 newcapec-can.cfg。Linux 平台程序名 newcapec-can-linux , Windows 平台程序名 newcapec-can-win.exe。
+
+> 前置程序不需要其它依赖环境既可运行
+
+* 配置文件
+
+```ini
+# log level
+log_level=info
+
+# server config, listen port , default 9876
+can_port=9876
+tcp_port=9877
+
+rpc_port=12451
+
+
+# app config
+appid=100001
+appsecret=3072a87ece234b728b519ded8dd152b1
+baseurl=https://172.28.200.122:18443/epayapi/services
+# 验证 ssl 证书合法性, 可选值 true , false
+ssl_verify=false
+
+# upgrade rom
+rom_name=SWPos.bin
+```
+
+<br/>
+一般情况下部署一个前置机只需要修改悦校平台服务器地址参数( baseurl )。
+
+* 启动方法
+
+在 Windows 下直接运行 newcapec-can-win.exe 既可。
+
+在 Linux 下运行 ./newcapec-can-linux 启动服务;如果需要在后台运行服务用以下命令:
+
+~~~bash
+$ nohup ./newcapec-can-linux &
+~~~
+
+* 前置服务监控
+
+前置服务可以通过监控命令获取运行状态报告,命令如下。该命令可以在 Window 电脑上运行, 运行的程序是 newcapec-can-win.exe。
+
+```bash
+$ ./newcapec-can-osx -showinfo -agent 172.28.200.128
+服务启动时间: 2015-08-19 10:08:32.481028525 +0800 CST
+程序版本: 1.1.0, Build: 2015-08-19.10:06:20
+Go Version: go1.5rc1
+Goroutines: 26
+====================================================
+连接数: 1, 最高连接数: 1
+最大处理POS机数 0
+
+CAN 统计信息    ====================================
+    帧统计: 接收 11886 , 发送 0
+    消息统计: 处理 2379, 丢弃 0
+
+请求统计信息(micro secs) ============================
+Cmd     Min      Max     Cnt    FCnt  Total(ms)  Avg(ms) CANMin CANMax
+0xA6    63882    63882    1       0    63         63    320    320
+0xB0    33959    133170   17      0    1142       67    182    593
+0xB2    19770    158987   15      0    699        46    115    290
+0xB4    27425    99000    4       0    251        62    92     186
+0xB6    28332    77213    9       0    431        47    356    718
+0xE0    30456    75669    4       0    169        42    88     155
+0xE1    52325    99456    4       0    286        71    227    514
+0xE2    956    3002509    2324    7    105096     45    47     851
+0xE4    32971    32971    1       0    32         32    93     93
+
+
+统计生成时间:2015-08-20 13:33:28.08915124 +0800 CST
+
+```
+
+### 消费网关
+* 修改网络配置参数
+
+> 使用浏览器登录网关管理界面 http://192.168.1.250, 默认用户名密码都是 admin。 登录成功后在菜单中选择“网络参数” => "LAN 配置“,在以下界面中输入新的网络地址。
+
+![图1](media/14400491129702/14400554797289.jpg)
+
+
+* 远程连接
+
+> 消费网关通过 SSH 远程登录到控制台进行参数配置和更新应用程序,默认 SSH 用户名和密码是 root 。
+
+* 网关应用程序
+
+> 网关应用程序包括主程序 can\_gateway 和配置文件 can\_cfg.ini 两个文件。配置文件如下:
+
+```ini
+[upserver]
+upserver_count=2
+# server 1
+upserver_ip_1=172.28.43.13
+upserver_port_1=9876
+# server 2
+upserver_ip_2=172.28.43.45
+upserver_port_2=9876
+# server 3
+upserver_ip_3=
+upserver_port_3=
+# server 4
+upserver_ip_4=
+upserver_port_4=
+
+[can]
+# can configuration
+# can baud rate , optinal value are 100000 , 250000
+can1_baud=100000
+can2_baud=100000
+can3_baud=100000
+can4_baud=100000
+
+[log]
+# log define
+#  10 means 10 MBytes
+log_size=10
+
+[ntp]
+ntp_server=
+```
+
+upserver 部分参数是消费前置机相关配置, upserver\_count 表示前置机数量可选值 1 ~ 4。upserver\_ip\_\<num\> 表示前置机 IP 地址, upserver\_port_\<num\> 端口号默认 9876 。
+
+
+can 部分配置是 CAN 模块的波特率,可选值 100000 kbps 或 250000 kbps, 默认值 100000 kbps,这个值必须和 POS 上配置的通讯参数一致。
+
+ntp 部分配置是网关自动进行 ntp 校时的服务器 IP。如果连接不通只是不能自动校时,不会影响网关正常工作。网关时钟不正确也不会影响 POS 机的时钟,POS 是通过前置机校时的。
+
+* 程序部署
+	* 通过 tftp 下载网关程序
+	
+	需要现在一台电脑上 tftp server , 然后将网关程序拷贝到 tftp 下载目录下。然后在网关控制台上执行以下命令下载程序。
+	
+	```bash
+	$ cd /home/bin
+	$ tftp -g -l can_cfg.ini -r can_cfg.ini <tftp 服务器IP>
+	$ tftp -g -l can_gateway -r can_gateway <tftp 服务器IP>
+	```
+
+	* 通过 NFS 服务下载程序
+
+	需要在一台 Linux 电脑上安装配置 nfs 服务,让后将网关程序拷贝到共享的目录下,执行以下命令
+	
+	```bash
+	$ mount -t nfs -o nolock <Linux 电脑 Ip>:/home/ykt /home/nfs &
+	$ cp /home/nfs/can_gateway /home/bin/
+	$ cp /home/nfs/can_cfg.ini /home/bin/
+	```
+	
+	* 配置网关启动任务
+	
+	配置网关启动任务,当网关重启能自动运行网关应用程序。网关启动配置文件路径 /etc/init.d/rcS,需要将原配置一行注释掉,增加一行配置。配置完成后如下:
+	
+	```ini
+	#/home/bin/dtg &
+	cd /home/bin && ./can_gateway &
+	```