Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Print stings from multiple devices to host PC #374

LukeKcy started this conversation in General
Discussion options

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

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /