Python 通过套接字发送消息时有多大延迟
我想通过2个树莓pis实现一个客户机服务器,通过以太网直接相互连接。我想通过插座从PI#1向PI#2发送一条消息,告知PI#2通过摄像头模块拍摄图像Python 通过套接字发送消息时有多大延迟,python,sockets,raspberry-pi,ethernet,Python,Sockets,Raspberry Pi,Ethernet,我想通过2个树莓pis实现一个客户机服务器,通过以太网直接相互连接。我想通过插座从PI#1向PI#2发送一条消息,告知PI#2通过摄像头模块拍摄图像 从我发送消息到PI接收消息(然后拍摄图像)有多少延迟?我希望所需时间不超过20毫秒。标准Linux命令行工具iperf将为您完成此任务 在服务器端: iperf -s 在客户端: iperf -c ip-of-the-server iperf将输出吞吐量统计信息 客户端输出: iperf -c localhost ---------------
从我发送消息到PI接收消息(然后拍摄图像)有多少延迟?我希望所需时间不超过20毫秒。标准Linux命令行工具
iperf
将为您完成此任务
在服务器端:
iperf -s
在客户端:
iperf -c ip-of-the-server
iperf
将输出吞吐量统计信息
客户端输出:
iperf -c localhost
------------------------------------------------------------
Client connecting to localhost, TCP port 5001
TCP window size: 2.50 MByte (default)
------------------------------------------------------------
[ 3] local 127.0.0.1 port 58950 connected with 127.0.0.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 37.2 GBytes 32.0 Gbits/sec
[sri@localhost ~]$
服务器:
iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 127.0.0.1 port 5001 connected with 127.0.0.1 port 59732
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.0 sec 40.1 GBytes 34.4 Gbits/sec
有很多选项可以帮助您调整iperf测试并获得所需信息。试试看。也许可以尝试测量往返时间和一半的结果,因为这比精确同步时钟更容易。rpi有一个以太网端口,支持300mbps的最大吞吐量。。。所以它不能比这更快…(估计比你要求的50帧速度要低)@JoranBeasley我没有把OP的问题理解为需要50帧速度-我觉得它更像是一个单发。希望OP能澄清…很高兴知道rpi以太网太慢了,无法实现我想要的!!