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

Airpods Pro systemd service crashes #3

Open
dodalovic opened this issue Dec 28, 2021 · 12 comments
Open

Airpods Pro systemd service crashes #3

dodalovic opened this issue Dec 28, 2021 · 12 comments

Comments

@dodalovic
Copy link

Maybe this could help:

● airstatus.service - AirPods Pro Battery Monitor
     Loaded: loaded (/etc/systemd/system/airstatus.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Tue 2021-12-28 09:51:09 CET; 571ms ago
    Process: 58060 ExecStart=/usr/bin/python3 /home/dodalovic/me/projects/opensource/AirStatus/main.py /tmp/airstatus.out (code=exited, status=1/FAILURE)
   Main PID: 58060 (code=exited, status=1/FAILURE)
        CPU: 52ms
@dodalovic
Copy link
Author

When I execute the command /usr/bin/python3 /home/dodalovic/me/projects/opensource/AirStatus/main.py /tmp/airstatus.out, it works just fine, stays running indefinitely

Pop!_OS 21.10

uname -a
Linux pop-os 5.15.8-76051508-generic #202112141040~1639505278~21.10~0ede46a SMP Tue Dec 14 22:38:29 U x86_64 x86_64 x86_64 GNU/Linux

@delphiki
Copy link
Owner

Hello @dodalovic,

Does something show up with journalctl?

treibholz added a commit to treibholz/AirStatus that referenced this issue Jan 3, 2022
Pillow and pysystray are not used/needed here.

Also bleak 0.7 has a bug with not closing open file-handles which results in crashes (may also fix delphiki#1 and delphiki#3)
@dodalovic
Copy link
Author

@delphiki I'm getting this via journalctl:

Jan 26 15:35:56 pop-os systemd[1]: Started AirPods Battery Monitor.
Jan 26 15:35:56 pop-os python3[473254]: Traceback (most recent call last):
Jan 26 15:35:56 pop-os python3[473254]:   File "/home/dodalovic/me/tools/AirStatus/main.py", line 1, in <module>
Jan 26 15:35:56 pop-os python3[473254]:     from bleak import discover
Jan 26 15:35:56 pop-os python3[473254]: ModuleNotFoundError: No module named 'bleak'

@delphiki
Copy link
Owner

delphiki commented Jan 26, 2022

@dodalovic You probably forgot to install the requirements:

pip install -r requirements.txt

@dodalovic
Copy link
Author

@delphiki After doing that, and restarting service, i still have:

Jan 26 16:38:11 pop-os systemd[1]: airstatus.service: Scheduled restart job, restart counter is at 32.
Jan 26 16:38:11 pop-os systemd[1]: Stopped AirPods Battery Monitor.
Jan 26 16:38:11 pop-os systemd[1]: Started AirPods Battery Monitor.
Jan 26 16:38:11 pop-os python3[498384]: Traceback (most recent call last):
Jan 26 16:38:11 pop-os python3[498384]:   File "/home/dodalovic/me/tools/AirStatus/main.py", line 1, in <module>
Jan 26 16:38:11 pop-os python3[498384]:     from bleak import discover
Jan 26 16:38:11 pop-os python3[498384]: ModuleNotFoundError: No module named 'bleak'
Jan 26 16:38:11 pop-os systemd[1]: airstatus.service: Main process exited, code=exited, status=1/FAILURE
Jan 26 16:38:11 pop-os systemd[1]: airstatus.service: Failed with result 'exit-code'.
Jan 26 16:38:15 pop-os systemd[1]: airstatus.service: Scheduled restart job, restart counter is at 33.
Jan 26 16:38:15 pop-os systemd[1]: Stopped AirPods Battery Monitor.
Jan 26 16:38:15 pop-os systemd[1]: Started AirPods Battery Monitor.

@dodalovic
Copy link
Author

Also, the numbers read are way different from the ones i see on my IPad. Not sure why though.

@dodalovic
Copy link
Author

Thx @Movisivi, but it's not related to that. Also, I prefer not to use sudo for installing dependencies. :)

@FeryET
Copy link

FeryET commented Sep 18, 2022

I get the following error:

 /usr/bin/python3: can't open file '/tmp/airstatus.out': [Errno 2] No such file or directory

What might cause the problem?

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

No branches or pull requests

4 participants
@delphiki @dodalovic @FeryET and others