-
-
Notifications
You must be signed in to change notification settings - Fork 32
Raspbian trixie #1106
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
base: main
Are you sure you want to change the base?
Raspbian trixie #1106
Changes from all commits
db98f0a
67dac1f
4fd8eca
7c2d6e9
8b71fd2
da2f043
6f27095
3c3cc21
6ab3d68
fcf2f34
9a0e10a
93d2a6c
1d56f62
f6e4480
59ce620
acdfa6e
1f9c303
5985907
ac38b7e
e726383
d6f9d64
2d5c71a
1743c3a
4ee2771
7fda498
c9127f2
e22593c
860c472
64365d2
4e15c31
42880db
219df1d
2d2ae89
26ae9ab
bed6423
939cb4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/usr/bin/env python3 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The version of python we run has to be installed via UV on Trixie, so I had to move the invocation paths on a few files
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we replace this with something more generic like uv run? |
||
| #!/home/pi/.local/share/uv/python/cpython-3.8.20-linux-aarch64-gnu/bin/python3.8 | ||
| # This is a separate script as it must be run with root privileges | ||
| # Example: sudo python check_pass 'raspberry' | ||
|
|
||
|
|
@@ -9,5 +9,7 @@ import sys | |
| default_password = sys.argv[1] | ||
| current_password = spwd.getspnam('pi').sp_pwd | ||
| if crypt.crypt(default_password, current_password) == current_password: | ||
| print("Correct Password") | ||
| sys.exit(0) | ||
| print("Incorrect Password") | ||
| sys.exit(1) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,7 @@ class DefaultPass: | |
| the stored default AmpliPi password.""" | ||
|
|
||
| # Password config location | ||
| PASS_DIR = os.path.join(os.path.expanduser('~'), '.config', 'amplipi') | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole |
||
| PASS_DIR = os.path.join('/data', '.config', 'amplipi') | ||
| PASS_FILE = os.path.join(PASS_DIR, 'default_password.txt') | ||
| DEFAULT_PI_PASSWORD = 'raspberry' | ||
|
|
||
|
|
@@ -115,7 +115,7 @@ def get_default_pw(self) -> str: | |
| def check_pw(pw: str) -> bool: | ||
| """ Check if the given password is the pi user's current password. """ | ||
| try: | ||
| subprocess.run(f'sudo python3 amplipi/display/check_pass {pw}', shell=True, check=True) | ||
| subprocess.run(f'sudo ./amplipi/display/check_pass {pw}', shell=True, check=True) | ||
| return True | ||
| except subprocess.CalledProcessError: | ||
| return False | ||
|
|
@@ -177,9 +177,9 @@ def get_zone_status(zone, sources) -> STATUS: | |
| else: | ||
| return STATUS.PLAYING | ||
| elif source_for_zone.state == 'stopped': | ||
| return STATUS.STOPPED | ||
| return STATUS.STOPPED | ||
| elif source_for_zone.state == 'paused': | ||
| return STATUS.PAUSED | ||
| return STATUS.PAUSED | ||
| return STATUS.IGNORE | ||
| return STATUS.IGNORE | ||
|
|
||
|
|
@@ -222,7 +222,7 @@ def get_emoji_status(url: str, max_length: int = 16) -> Union[str, int]: | |
|
|
||
| result = '' | ||
| if status_counts[STATUS.PLAYING] > 0: | ||
| result += f'▶x{status_counts[STATUS.PLAYING]} ' | ||
| result += f'▶x{status_counts[STATUS.PLAYING]} ' | ||
| if status_counts[STATUS.PAUSED] > 0: | ||
| result += f'⏸x{status_counts[STATUS.PAUSED]} ' | ||
| if status_counts[STATUS.STOPPED] > 0: | ||
|
|
@@ -248,7 +248,7 @@ def get_status(url: str, no_serial_ok: bool = False, emoji: bool = True, max_len | |
| result_status = st | ||
|
|
||
| # Check if API is running | ||
| api_on = subprocess.run("systemctl --user is-active amplipi.service".split(), stdout=subprocess.DEVNULL) | ||
| api_on = subprocess.run("systemctl is-active amplipi.service".split(), stdout=subprocess.DEVNULL) | ||
| if api_on.returncode != 0: | ||
| return DisplayError.NO_AMPLIPI_SERVICE, None, 0 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -283,6 +283,10 @@ def _recover_preamps(self) -> bool: | |
| try: | ||
| self.reset_preamps() | ||
| self.set_i2c_addr() | ||
| try: | ||
| self.bus.close() | ||
| except Exception: | ||
| pass | ||
|
Comment on lines
+286
to
+289
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an additional fix for the issue fixed by #1098 which was merged in #1091 My unit actually got into a bad state during testing, which led to me having the ability to test those changes and add a little more to the fix My own issue was downstream of some configuration file providing an environment that the I2C didn't like |
||
| self.bus = SMBus(1) | ||
| for addr, regs in list(self.preamps.items()): | ||
| for reg, val in enumerate(regs): | ||
|
|
@@ -319,6 +323,10 @@ def write_byte_data(self, preamp_addr, reg, data): | |
| # Fallback 1: reopen the bus handle and retry (transient bus glitch). | ||
| try: | ||
| time.sleep(0.001) | ||
| try: | ||
| self.bus.close() | ||
| except Exception: | ||
| pass | ||
| self.bus = SMBus(1) | ||
| self.bus.write_byte_data(preamp_addr, reg, data) | ||
| except Exception: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a rebase error. This branch is long lived and had some merge conflicts on rebase and so may need to be combed for reversions like this before merging