我正在使用phpSerial在 COM 端口 (COM10) 上进行通信。
这是我的代码:(与示例代码非常相似)
<?php
require('php_serial.class.php');
echo "<html>
<head><title>Test MySQL</title></head>
<body>";
// Let's start the class
$serial = new phpSerial;
$serial->deviceSet("COM10");
$serial->confBaudRate(1200);
$serial->confParity("none");
$serial->confCharacterLength(7);
$serial->confStopBits(1);
$serial->deviceOpen();
$serial->sendMessage("Hello !");
$read = $serial->readPort();
echo "here it is";
echo $read;
echo "here it was";
sleep(1);
$serial->deviceClose();
?>
</body></html>
Run Code Online (Sandbox Code Playgroud)
这是我得到它运行的响应:
Warning: Specified serial port is not valid in D:\xampp\htdocs\Serialport\PHP-Serial-develop\PHP-Serial-develop\php_serial.class.php on line 141
Warning: Unable to set the baud rate : the device is either not set or opened …Run Code Online (Sandbox Code Playgroud) 我正在尝试do_compile_append通过打印消息来调试 Yocto 配方中的函数:
do_compile_append() {
for i in 1 2 3 4 5
do
echo "My yocto Looping ... number $i"
done
}
Run Code Online (Sandbox Code Playgroud)
在此示例中,我添加了一个循环来在构建期间回显一些消息。但是,当我运行bitbake构建它时,我没有看到这些消息输出到我的终端。
输出记录在哪里?