gnokii 短信猫 中文安装使用文档

8月份做的一个东东,重新整理了一下发上来。当日后使用文档!
环境:
centos 5.2,短信猫设备: wave

安装软件地址:

http://opensource.hqcodeshop.com/gnokii/RHEL5/

gnokii-0.6.28cvs-20100613.i386.rpm
gnokii-smsd-0.6.28cvs-20100613.i386.rpm
gnokii-smsd-mysql-0.6.28cvs-20100613.i386.rpm

#### 下载软件 ###

#cd /usr/local/webserver/

#wget http://opensource.hqcodeshop.com/gnokii/RHEL5/gnokii-0.6.28cvs-20100613.i386.rpm
#wget http://opensource.hqcodeshop.com/gnokii/RHEL5/gnokii-smsd-0.6.28cvs-20100613.i386.rpm
#wget http://opensource.hqcodeshop.com/gnokii/RHEL5/gnokii-smsd-mysql-0.6.28cvs-20100613.i386.rpm

### 安装 ####

####gnokii-smsd-0.6.28cvs-20100613.i386.rpm 需要 libmysqlclient.so支持

#yum install mysql-devel

#rpm -ivh gnokii-0.6.28cvs-20100613.i386.rpm
gnokii-smsd-0.6.28cvs-20100613.i386.rpm
gnokii-smsd-mysql-0.6.28cvs-20100613.i386.rpm

#### 配置 ####

配置 gnokii

gnokii 的配置文件默认创建在 /etc/gnokiirc 。但gnokii程序每次会从用户的根目录中读取副配置文件 比如/root/.gnokiirc。所以gnokii配置可以在用户目录中创建

#vim /etc/gnokiirc

# This is a sample ~/.gnokiirc file. Copy it into your
# home directory and name it .gnokiirc.
# See http://wiki.gnokii.org/index.php/Config for working examples.
#

[global]

# Set port to the physical port used to connect to your phone.
# Linux version is:

#短信猫串口设备
port = /dev/ttyS0

#
# For MacOSX you will need something like:
# port = /dev/cu.USA28X1P1.1
#
# For Win32 and ports from 1 to 9 you want to use:
# port = com1:
# or similiar. For ports greater than 9 you want to use:
# port = \\.\COM10
# or similiar.
#
# FreeBSD (probably NetBSD and OpenBSD too) use:
# port = /dev/cuaa0
#
# With Linux-IrDA you will want to use
# port = /dev/ircomm0
# or similiar.
#
# Use this setting also for the Bluetooth connection:
# port = aa:bb:cc:dd:ee:ff
# when using it with AT driver set it to:
# port = /dev/rfcomm0
# or similiar.
#
# For the Linux USB cables you will need one of the following settings (or
# similiar)
# port = /dev/ttyUSB0
# port = /dev/tts/USB0
# port = /dev/ttyACM0
# the last one will work only with AT driver. The correct setting should be
# given in the dmesg output.
#
# If you use connection type dku2libusb use it to denote which use endpoint
# you’d wish to use. It is useful when you have more than one phone connected
# to your computer using DKU2 cable. Numbering goes from 1 upwards.
# Default is 1.
# port = 1

# Set model to the model number of your phone. For the
# Symbian phones use:
# model = symbian
# For other non-Nokia phones and when you want to use AT
# mode use:

#通信模式,对于非Symbian手机,使用AT模式

model = AT

# If you can’t figure out what to put here read the FAQ.
# If it still doesn’t help, consult gnokii-ml or #gnokii at freenode.
#model = 6510
# There are few main models that should make use of the certain drivers.
# These are: 6110, 7110, 6510, 3110, 2110, 6160.

# Set IrDA device name.
# If you use irda connection you may want gnokii to autodetect the irda
# device it connects to. This is fine for most of the cases. if you have
# more than one device in range you may want to give manually the device
# name so gnokii correctly recognizes it. Use the name that you can see
# in the discovery log when the phone with infrared is in the range of
# your irda port.
# Note that you need to set this for each phone_ section separately. It
# isn’t nested from the global section.
# irda_string = Nokia 6610i

# Initlength controls the number of characters sent to the
# phone during initialisation. You can either set it to
# the word “default” or a positive integer.
#
# You can try setting this value if you want to connect
# to the phone quicker. If you’ve never noticed the
# connection to be slow, it is suggested that you
# leave this alone. Read the initialisation code in fbus-xxxx
# to understand what this changes if you’re curious.

initlength = default

# The type of the connection, for IR set this to infrared or irda.
# For the nk6110 driver only infrared is valid for the IrDA connection.
# See Docs/gnokii-ir-howto for more detailes on this.
# If you have 6210/6250/7110 phone and dau9p cable (the one you can
# use with 6100 series and cannot use hardware modem from the phone)
# you may want to use ‘dau9p’ value to get faster initialization.
# If you use dlr3 or dlr3p cable for nokia phones in FBUS mode (ie.
# you don’t use model = AT) you may want to use ‘dlr3p’ value here.
# Note that it is recommended and currently the best way to use this
# cable with nk6510 driver.

#使用端口模式,串口或其他
connection = serial

# With DKU-2 cable use the following setting if you want to libusb driver
# (recommended):
# connection = dku2libusb
# or the following setting if you want to use Linux kernel driver
# connection = dku2
# With DKU-5 cable use the following setting
# connection = dku5
# For Bluetooth and AT driver use the following setting
# connection = serial
# For other Bluetooth settings use
# connection = bluetooth
# For infrared connection with phones other than Nokia 6110/6130/6150 use:
# connection = irda
# Don’t forget to run: ‘irattach irda0 -s’ or similiar before running gnokii
# For connection with a PC/SC compatible Smart Card reader use:
# connection = pcsc

# Set this to ‘yes’ if you want gnokii to set and check the lock file in
# /var/lock directory. It avoids potential conflicts with other serial
# port software (eg. minicom). If you have wrong permissions for the
# directory, a warning will be generated. If you don’t want a lockfile, set
# it to ‘no’.

#是否锁定
use_locking = yes

# Baudrate to use on serial port connections.
# Currently used only by models AT and BIP/CIMD. Defaults to 19200.

#传输比特率,这里选择9600,国情决定
serial_baudrate = 9600

# Force waiting after each sent character the specified usec time.
# Value -1 forces the fastest ‘block’ writing,
# value 0 writes each character separately without any explicit waiting,
# other positive values specify the appropriate 1/1000000 sec delaying.
# Siemens M20 requires at least “1″! FIXME: Model-driven autodetection
#serial_write_usleep = 10000

# Force serial port handshaking mode, useful primarily for “AT” model.
# Gnokii “AT” model uses software handshake by default.
# Possible values: hardware (RTS/CTS – 7 wires) or software (XON/XOFF – 3 wires)
#handshake = software

# If defined (not commented out by ‘#’) it will quit Gnokii anytime
# when DCD line will drop.
#require_dcd = 1

# If you are using a bluetooth connection, you can specify the rfcomm
# channel number here. If you don’t specify the value, it is autodetected
# on connection (it may take an additional second). FBUS connections always
# ignore this value and use channel 14.
#rfcomm_channel = 1

# There may happen various timeouts during the communication with the phone.
# This parameter enables the retransmission policy. Ie. if the phone doesn’t
# respond, we send the frame again. This happened mainly with the older
# phones. You may want to enable it when you see mysterious timeouts.
# Be very careful with this option. It is suspected to cause phone breakage
# with new DCT4 phones (like Nokia 6100). By default it is switched off
# (sm_retry = 0)
#sm_retry = 1

# Run the specified script(s) right after opening and initializing the device
# and before any communication (right before closing for disconnect_script).
# You may find handy to use it to connect your modem to SMS Center
# when using BIP or CIMD protocols
# Non-absolute path is relative to the specific directory where gnokii is run!
#connect_script = /absolute/path/to/gnokii/Docs/sample/cimd-connect
#disconnect_script =

# When sending SMS you can experience timeouts. This is the feature of the
# overloaded SMSCs. The phones waits for the response from the SMSC confirming
# that it received the short message. When the SMSC is DoSed with many requests
# it will take more time to get the response. Adjust it to your needs. The
# value is given in seconds to wait. Defaults to 10 seconds. Set to 0 to wait
# forever.
smsc_timeout = 10

# Set this to 1 if you want to break your phone with xgnokii. Works only
# with few Nokia models and FBUS communication
[xgnokii]
allow_breakage = 0

# Set bindir to point to the location of the various gnokiid binaries.
# In particular ensure that mgnokiidev is in this location, with
# permissions 4750, owned by root, group gnokii. Ensure you
# are in the gnokii group and that the group exists…
[gnokiid]
bindir = /usr/bin/

# Any entries in the following two sections will be set as environment
# variables when running the scripts.
# Handy for use for $VAR substitutions in your chat(8) script.
[connect_script]
# Don’t put your phone number here!!!
TELEPHONE = 12345678

[disconnect_script]

# The following parameters control how libgnokii handles the debugging messages.
# Currently there are three categories: “debug” controls the libgnokii
# normal debug output, “rlpdebug” controls the debug output of the RLP
# subsystem, and “xdebug” is used by the xgnokii or smsd.

[logging]

# where to log the debug output (on: stderr, off: /dev/null)
debug = on

# where to log the rlp debug output (on: stderr, off: /dev/null)
rlpdebug = off

# where to log X debug output (on: stderr, off: /dev/null)
xdebug = off

# Fake-phone can be used for testing Gnokii functionality without
# having a physical phone connected.
# Example usage:
# gnokii –config gnokiirc –phone fake –identify
[phone_fake]
port = foobar
model = fake
connection = serial

###### 测试 #########

1、测试gnokii
#gnokii –dialvoice 15800000000 ###拨打电话(最好使用自己的电话),测试是否能打通,如果能打通,证明能使用
#gnokii –sendsms 15800000000 ### 发送短信,输入信息后使用ctrl+D 结束并发送。这里要注意一个编码问题,统一使用utf-8,特别是在终端测试的时候,我这里使用的是putty

2、测试gnokii-smsd

######## 创建 数据库 ######

mysql> create database smsgw;
mysql> grant all priveliges on smsgw.* to [email protected] identified by ‘password’;
mysql> use smsgw;
mysql> source /usr/share/doc/gnokii-smsd-mysql-0.6.28cvs/sms.tables.mysql.sql;
mysql>insert into()

#### centos安装后会出现一个安装包:/usr/lib/gnokii-smsd/ 所以要做一个符号链接

#cd /usr/lib
#ln -s smsd gnokii-smsd

否则在测试的时候会出现以下错误信息:

[Invalid UTF-8] g_module_open error: /usr/lib/smsd/libsmsd_mysql.so:
\xce\xde\xb7\xa8\xb4\xf2\xbf\xaa\xb9\xb2\xcf\xed\xb6\xd4\xcf\xf3\xce\xc4\xbc\xfe:

\xc3\xbb\xd3\xd0\xc4\xc7\xb8\xf6\xce\xc4\xbc\xfe\xbb\xf2\xc4\xbf\xc2\xbc!
Cannot load database module mysql in directory /usr/lib/smsd!

# gnokii-smsd -u sms -p password -d smsgw -c localhost -m mysql -b SM ## 测试短信守护进程

如果出现错误信息:

F: gnokii-smsd -usms -p passwd -d smsgw -c localhost -m mysql
[Invalid UTF-8] g_module_open error: /usr/lib/smsd/libsmsd_mysql.so:
\xce\xde\xb7\xa8\xb4\xf2\xbf\xaa\xb9\xb2\xcf\xed\xb6\xd4\xcf\xf3\xce\xc4\xbc\xfe:

\xc3\xbb\xd3\xd0\xc4\xc7\xb8\xf6\xce\xc4\xbc\xfe\xbb\xf2\xc4\xbf\xc2\xbc!
Cannot load database module mysql in directory /usr/lib/smsd!
A:centos安装后会出现一个安装包:/usr/lib/gnokii-smsd/ 所以要做一个符号链接

#cd /usr/lib
#ln -s smsd gnokii-smsd

时间: 2024-10-26 20:50:26

gnokii 短信猫 中文安装使用文档的相关文章

怎么判断金笛单口短信猫驱动程序已经安装正常

对短信猫的使用不熟悉的客户初次使用会遇到各种各样的小问题,其实这些问题很容易解决,以下是关于驱动是否安装正常的判断方法. 如果短信猫是串口短信猫,不需要安装驱动,需要把sim卡,天线,电源线,串口线,一起接好,等设备的绿灯闪烁后,打开金笛短信设备1.4,查看com口的状态,看是否是正常(at是ok,读卡部分有数字信息,信号强度有数值)的. 如果是USB接口的短信猫,需要把sim卡,天线,usb数据线,一起接好后,打开计算机的设备管理器,看是否有未识别的usb设备,有的话,找到光盘,安装PL230

如何使用短信猫发送中文短信

使用短信猫收发短信,原理是通过串口通信发送AT指令.当你发送中文短信时,你会又喜悦又困惑,短信确实收到了,但是是乱码的.本文介绍如何正确发送中文短信. AT AT\r\r\nOK\r\n 设置modem为SMS text mode AT+CMGF=1<ENTER> AT+CMGF=1\r\r\r\nOK\r\n 查询当前参数 AT+CSMP?<ENTER> AT+CSMP?\r\r\r\n+CSMP:1,167,0,0\r\n\r\nOK\r\n displays the code

Linux系统下配置短信猫

我们的安装系统: redhat linux as 4 2.6.9 功能:通过服务器上的外接modem,利用gnokii发送短信. 安装的软件:gnokii 硬件:gprs modem 设备一个,电话卡一张 我在安装gnokii 之前,必须安装gettext-devel-0.14.1-13.i386.rpm gnokii通过sim卡发送短信,他主要是linux下面用来管理nokia手机的一个软件,当然所有支持AT指令的都可以使用. linux上面安装好gnokii之后,/etc/gnokiirc是

使用 AT 命令实现西门子短信猫收发短信实例

通过AT指令对西门子短信猫收发短信的控制共有三种实现途径: (1) 最初的 Block 模式(2) 基于 AT 命令的 Text 模式 (3) 基于 AT 命令的 PDU 模式 本文记录的大量的TC35/TC35T 实验数据,总结了使用TC35/TC35T 短信猫收发短信的方法. 准备工作: 使用 TC35 收发短信息,用户必须准备一张已开通短信息服务 SIM 卡,并将其插入 MC2002 之 TC35 扩展模块 SIM 卡座中或 TC35T 的 SIM 卡座中. 使用 PC 配合 TC35T

zabbix使用短信猫实现报警

因为公司运维的对象是政府单位,所以在实际的监控过程中无法连接到外网,所以最后报警选择的媒介是短信猫,下边就是具体的实施过程. 一.面临的问题 因为手头上的设备是串口的短信猫,但是zabbix server端不支持,所以无法直接在服务器端挂载串口的短信猫,这样也就无法直接使用gnokii来调用,所以实施方案的选择上大体有两个,一个是在维持服务器端不变,使用一个中间的主机来挂载短信猫,再使用方法来调用短信猫.第二个就是直接在能够使用串口的主机上部署zabbix服务器.最后选择的方案是第二种,是为了保

读短信猫或手机

将sms.dll 文件拷贝到系统安装目录中的system32 文件夹中,然后再根据以下接口函数说明和提供的例程源码开发接口函数:1.Sms_Connection(Com_Port As Integer,Com_BaudRate As Integer, Mobile_Type As String) AsIntegerSms_Connection 函数说明如下:功能描述:用于初始化终端与串口的连接Com_Port:串口号(0 为红外接口,1,2,3,...为串口)Com_BaudRate:波特率Mo

让我来告诉你短信猫怎么配合zabbix3.2发短信的

                zabbix利用短信猫发短信(总结) 短信猫简介 所谓短信猫,其实是一种用来收发短信的设备,他和我们用的手机一样,需要手机SIM卡的支持,在需要收发短信的时候,在短信猫里面插入一张我们平时用的手机卡,插上电源,通过(USB或者串口.网口)数据线和电脑相连,在电脑的应用管理软件中就可以实现短信收发的功能! 安装短信猫 首先因为我的服务器是虚拟机,在VMware虚拟化上,这就涉及到物理机的USB口或者串口对虚拟机做映射,把短信猫安装在物理机后的USB口,在VMware

深圳短信猫厂家自带短信猫开发包支持多种开发语言

深圳最早从事短信猫生产与销售的短信猫厂家-深圳百利通科技,是深圳短信猫厂家中质量上乘.服务周到的正规公司.提供有丰富短信猫开发软件包及接口程序,支持GSM MODEM短信猫二次开发,可广泛用于二次开发领域,将sms.dll文件拷贝到系统安装目录中的system32文件夹中,然后再根据以下接口函数说明和提供的例程源码开发.支持多种程序短信开发语言如:C#.delphi.VC++等,并提供有程序开发示例DEMO,方便参考.实现快速短信二次开发应用.多应用于如OA.ERP.用友.金蝶等办公系统的短信功

配送短信猫二次开发接口提供多种开发语言示例

免费配送的信猫二次开发接口提供有多种开发语言示例,如C#.C++.Delphi.PowerBuilder.VB.net.VC++.VisualBasic等多种开发示例方便程序开发人员开发调试.使用简单方便,将sms.dll文件拷贝到系统安装目录中的system32文件夹中,然后再根据以下接口函数说明和提供的例程源码开发,无需安装,免加密狗. 短信猫二次开发接口提供的开发语言示例有: 部分短信猫二次开发接口函数说明: 1.Sms_Connection(Com_Port As Integer,Com