This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot set pypilot to IMU only
#11
I acknowledge that I don't fully understand this system, but I don't understand how cannot it be possible to reinstall some packages, reinstall missing dependencies, or something else.
The idea of starting over everytime some installation is corrupt makes the whole system if not unusable, very annoying to use  Big Grin


I've spent months in having everything working together, and I don't mind spending more time in fixing this issue, but starting over again, configure everything again... I honestly don't know if I have the strenght for it.
If the problem is purely related to the global variable PKEXEC_UID i could run

echo 'export PKEXEC_UID=$(id -u)' >> ~/.bashrc

But that is not the case. ChatGPT suggested me to modify the python script that tries to get the user like this, in order to add a fallback to default user "pi":
Code:
def __init__(self):
    self.user = os.environ.get('USER')
    if self.user == 'root':
        try:
            self.user = os.path.expanduser(os.environ["SUDO_USER"])
        except KeyError:  # SUDO_USER not set
            try:
                import pwd
                pkexec_uid = os.environ.get("PKEXEC_UID")
                if pkexec_uid is not None:
                    self.user = pwd.getpwuid(int(pkexec_uid)).pw_name
                else:
                    # Handle the case where neither SUDO_USER nor PKEXEC_UID is set
                    # Fallback to a default or use another method to determine the user
                    self.user = 'pi'  # Or any other fallback mechanism
            except KeyError:  # PKEXEC_UID not set
                # Additional fallback logic here if necessary
                self.user = 'pi'  # Fallback to a default user or handle differently
    self.home = '/home/'+self.user

Do you think that could be a valid workaround?
Reply


Messages In This Thread
Cannot set pypilot to IMU only - by MigGat - 2024-03-30, 12:08 PM
RE: Cannot set pypilot to IMU only - by Sailoog - 2024-03-30, 12:13 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-03-30, 12:20 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-03-31, 03:47 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-02, 05:06 PM
RE: Cannot set pypilot to IMU only - by Sailoog - 2024-04-02, 05:55 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-02, 10:32 PM
RE: Cannot set pypilot to IMU only - by Sailoog - 2024-04-03, 11:16 AM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-02, 10:46 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-03, 10:19 AM
RE: Cannot set pypilot to IMU only - by ironman - 2024-04-03, 10:48 AM
RE: Cannot set pypilot to IMU only - by Sailoog - 2024-04-03, 11:12 AM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-03, 11:37 AM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-03, 03:48 PM
RE: Cannot set pypilot to IMU only - by PaddyB - 2024-04-03, 03:58 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-03, 04:07 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-04, 04:43 PM
RE: Cannot set pypilot to IMU only - by PaddyB - 2024-04-04, 04:47 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-04, 04:55 PM
RE: Cannot set pypilot to IMU only - by PaddyB - 2024-04-04, 05:46 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-04, 05:54 PM
RE: Cannot set pypilot to IMU only - by MigGat - 2024-04-04, 07:22 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)