2

I have an Linksys WRT54GL with a hacked serial port. I can use it normally via

echo "Test" > /dev/tts/1

and my Windows/Serial/Putty combo gets the data just fine.

I used RS232 Analyser on a Windows machine to check my Pelco device and it works fine.

After some reading and installing I changed the serialport settings via stty to 2400 and checked it with putty.

Still fine with putty, but sending something like

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

doesn't work. The Pelco device doesn't move.

Any suggestions?

4

1 回答 1

2

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

假设您正在控制摄像机 1(地址 1)高速向左平移,前 6 个字节的命令字符串为: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

它有效。

于 2012-03-17T12:53:21.583 回答