serial-port - OpenWRT 通过串行端口发送 Pelco D 代码

标签 serial-port openwrt pelco

我有一个 Linksys WRT54GL,其串行端口被黑客入侵。我可以通过

正常使用它
echo "Test" > /dev/tts/1

我的 Windows/Serial/Putty 组合可以很好地获取数据。

我用了RS232 Analyser在 Windows 计算机上检查我的 Pelco 设备,它工作正常。

经过一些阅读和安装后,我通过 stty 将串行端口设置更改为 2400 并使用 putty 检查它。

仍然可以使用腻子,但发送类似的内容

echo "255,1,0,4,32,0,37," > /dev/tts/1 

不起作用。 Pelco 设备不动。

有什么建议吗?

最佳答案

解决方案非常简单。纪录片中的例子:

Suppose you are controlling camera 1 (address 1) to pan left at high speed, the command string of the first 6 bytes would be: FF 01 00 04 3F 00

Linux下的命令:

echo -e -n "\xFF\x01\x00\x04\x3F\x00" > /dev/tts/1

联机帮助页告诉我们:

-e enable interpretation of backslash escapes
-n do not output the trailing newline

并且它有效。

关于serial-port - OpenWRT 通过串行端口发送 Pelco D 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9519450/

相关文章:

Python没有名为serial的模块/没有名为requests的模块

linux - Linux 中的 USB 串行驱动程序和设备名称

c - 无法使用 Openwrt 工具链 : Undefined reference to _Unwind_Resume and __gcc_personality_v0 构建静态二进制文件

php - 如何从 ash (bash) 将数据发布到 php

sockets - Unix-如何将消息发送到多个进程?

c# - 你如何模拟串行设备?

delphi - 在delphi中分割串行数据