我无法发送AT命令

时间:2019-01-13 09:20:41

标签: serial-port modem ussd

我正在尝试使用php串行类php运行usd AT命令/ dev / ttyUSB。但是我没能得到正确的回应。我也尝试使用gsm-ussd命令,该命令找不到串行端口或不响应。我的实际问题我找不到正确的串行端口。我的调制解调器是8端口调制解调器 这是我运行dmesg时的结果| grep tty

[76457.370819] ftdi_sio ttyUSB2: FTDI USB Serial Device converter now disconnected from ttyUSB2
[76457.372393] ftdi_sio ttyUSB3: FTDI USB Serial Device converter now disconnected from ttyUSB3
[76457.376506] ftdi_sio ttyUSB4: FTDI USB Serial Device converter now disconnected from ttyUSB4
[76457.376777] ftdi_sio ttyUSB5: FTDI USB Serial Device converter now disconnected from ttyUSB5
[76457.377852] ftdi_sio ttyUSB6: FTDI USB Serial Device converter now disconnected from ttyUSB6
[76457.378124] ftdi_sio ttyUSB7: FTDI USB Serial Device converter now disconnected from ttyUSB7
[76578.022453] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB0
[76578.023336] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB1
[76578.024222] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB2
[76578.025570] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB3
[76578.217939] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB4
[76578.218812] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB5
[76578.219668] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB6
[76578.220681] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB7
[77176.773114] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[77176.774200] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[77176.775010] ftdi_sio ttyUSB2: FTDI USB Serial Device converter now disconnected from ttyUSB2
[77176.777951] ftdi_sio ttyUSB3: FTDI USB Serial Device converter now disconnected from ttyUSB3
[77176.778581] ftdi_sio ttyUSB4: FTDI USB Serial Device converter now disconnected from ttyUSB4
[77176.778931] ftdi_sio ttyUSB5: FTDI USB Serial Device converter now disconnected from ttyUSB5
[77176.779285] ftdi_sio ttyUSB6: FTDI USB Serial Device converter now disconnected from ttyUSB6
[77176.779626] ftdi_sio ttyUSB7: FTDI USB Serial Device converter now disconnected from ttyUSB7
[77177.605795] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB0
[77177.606284] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB1
[77177.606773] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB2
[77177.607270] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB3
[77177.944691] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[77177.945209] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[77177.945696] ftdi_sio ttyUSB2: FTDI USB Serial Device converter now disconnected from ttyUSB2
[77177.946170] ftdi_sio ttyUSB3: FTDI USB Serial Device converter now disconnected from ttyUSB3
[77178.778047] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB0
[77178.778887] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB1
[77178.779749] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB2
[77178.781139] usb 2-3.1: FTDI USB Serial Device converter now attached to ttyUSB3
[77178.974015] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB4
[77178.974893] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB5
[77178.975748] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB6
[77178.976632] usb 2-3.2: FTDI USB Serial Device converter now attached to ttyUSB7

这是我的php代码

<?php 
include 'PhpSerial.php'; 
$serial = new PhpSerial;
$serial->deviceSet("/dev/ttyUSB2");
$serial->deviceOpen();
stream_set_timeout($serial->_dHandle, 10);
$serial->confBaudRate(9600);                                    
$serial->sendMessage("AT+CSCS=GSM");        
 $serial>sendMessage('AT+CUSD=1,"*555#"',15);
echo $serial->readPort();
$serial->deviceClose();

当我在浏览器中运行此文件时,它变得空白

如何获取正确的调制解调器端口并使用php发送命令

0 个答案:

没有答案