Replies: 1 comment
-
See Reading partial output documentation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm wondering if anyone could point me in the right direction here. I have 4 devices that I'm using pssh to connect to an run the same python script. This script is used to run object detection on cameras connected to each device. What I need is to print the data from the cameras to the terminal of the host PC (this data is updated every frame from the cameras as the tracking is meant to happen in real-time). If possible I would like to be able to see the live video from each camera on the host PC (similar to the -Y argument when sshing to a device). I've been trying to follow the docs on this.
If anyone could point me in the right direction that would be great.
Code:
from pssh.clients import ParallelSSHClient
from pssh.exceptions import Timeout
hosts = ['xx', 'xx', 'xx', 'xx'] #IPs for devices to connect to
client = ParallelSSHClient(hosts, user='xx', password='xx') #Connect and log into each device
cmd = 'python PiSmartHangar/YoloTestCode.py'
output = client.run_command(cmd, use_pty=True, read_timeout=10)
stdout = []
for host_out in output:
try:
for line in host_out.stdout:
stdout.append(line)
print(stdout)
except Timeout:
pass
for host_out in output:
host_out.client.close_channel(host_out.channel)
client.join(output)
rest_of_stdout = list(output[0].stdout)
Thanks,
Luke
Beta Was this translation helpful? Give feedback.
All reactions