Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restart jtop client -> BrokenPipeError: [Errno 32] Broken pipe #601

Open
jeronimoagullo opened this issue Jan 14, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@jeronimoagullo
Copy link

This issue is related to the issue #261

I have the following code in python 3.10 with jtop 4.3.0:

import jtop

jetson = None

while True:
    try:
        if jetson is None:
            print("Initializing jtop client...")
            jetson = jtop.jtop()
            jetson.start()

        while jetson.ok():

            # Temperature
            temperatures = jetson.temperature
            temp_cpu = temperatures['cpu']['temp']
            temp_gpu = temperatures['gpu']['temp']
            print(f"Temperature CPU: {temp_cpu}ºC and GPU: {temp_gpu}ºC")

    except jtop.JtopException as e:
        print(f"Jtop error: {e}")
    except Exception as e:
        print(f"Error getting metrics: {e}")
    finally:
        try:
            jetson.close()  # Ensure the client is closed
        except Exception as close_error:
            print(f"Error while closing jtop client: {close_error}")
        jetson = None # Reset the reference                

It works correctly until I stop and start again the jtop.service with systemctl command. I know from issue #261 that the jtop client must be restarted so that the SyncManager is restarted. However, I cannot get it working once the jtop service restarts.

Are I missing something? What should be the correct approach to restart jtop client?
Thanks

@jeronimoagullo jeronimoagullo added the bug Something isn't working label Jan 14, 2025
@rbonghi
Copy link
Owner

rbonghi commented Jan 15, 2025

Hi @jeronimoagullo
I never tried this case, I'll take a look to find a nice way to connect again to jtop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants