【问题标题】:Specified serial port is not valid in php_serial.class.php for windowswindows 的 php_serial.class.php 中指定的串口无效
【发布时间】:2020-02-27 07:35:32
【问题描述】:

我尝试使用 php_serial.class.php 将 NV200 智能支付设备连接到我的 php 项目,但收到此错误:

第 145 行的 D:\xampp-7\htdocs\testsocket\php_serial.class.php 中指定的串口无效

我使用的是 windows 7 并进入设备管理器,设备连接到 COM3。这是我的代码:

include "php_serial.class.php";
$serial = new PhpSerial;

$serial->deviceSet("COM3");

$serial->confBaudRate(2400);
$serial->confParity("none");
$serial->confCharacterLength(8);
$serial->confStopBits(1);
$serial->confFlowControl("none");

$serial->deviceOpen();

$serial->sendMessage("Hello !");

出了什么问题?连接串口的正确方法是什么?请帮忙。

【问题讨论】:

    标签: php windows serial-port php-socket


    【解决方案1】:

    对不起各位。我打开了一个也连接到 COM3 的软件。看来串口无法连接多个软件。

    【讨论】:

      猜你喜欢
      • 2023-01-25
      • 2011-08-25
      • 1970-01-01
      • 1970-01-01
      • 2015-06-03
      • 1970-01-01
      • 2021-05-12
      • 2018-09-03
      • 1970-01-01
      相关资源
      最近更新 更多