我有一个 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/