mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-06 08:53:46 +02:00
fix: add smbus2 dependency, i2c-tools, and use hex I2C addresses in docs
- Add smbus2>=0.4.0 to pyproject.toml core dependencies so it is always present in the venv rather than relying on runtime auto-install - Add i2c-tools to apt-get installs in both install and upgrade paths so /dev/i2c-* devices are accessible and i2cdetect is available for diagnostics (service user was already being added to the i2c group) - Switch ENS210 config examples to hex I2C address notation (0x43) to match datasheets and i2cdetect output; update contributor docs guidance accordingly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -242,7 +242,7 @@ sensors:
|
||||
# enabled: true
|
||||
# auto_install_packages: true
|
||||
# settings:
|
||||
# i2c_address: 67 # 0x43 in decimal (default ENS210 address)
|
||||
# i2c_address: 0x43 # Default ENS210 address
|
||||
# bus_number: 1 # I2C bus number (1 for Raspberry Pi default)
|
||||
# read_timeout_seconds: 1.0 # Max seconds to wait for valid data (polls every 50 ms)
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ Find the `sensors.definitions` block and add your sensor alongside the existing
|
||||
# some_option: value
|
||||
```
|
||||
|
||||
Use decimal for numeric config values that would naturally be written in hex (e.g. I2C addresses: `0x43` = `67`). Add a comment showing both forms if the value is commonly written in hex.
|
||||
Use hex notation for I2C addresses (e.g. `0x43`) as this matches how addresses are listed in datasheets and tools like `i2cdetect`.
|
||||
|
||||
### 3. Test locally
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ install_repeater() {
|
||||
|
||||
echo "25"; echo "# Installing system dependencies..."
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y libffi-dev libusb-1.0-0 sudo jq pip python3-venv python3-rrdtool wget swig build-essential python3-dev
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y libffi-dev libusb-1.0-0 sudo jq pip python3-venv python3-rrdtool wget swig build-essential python3-dev i2c-tools
|
||||
# Install polkit (package name varies by distro version)
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y policykit-1 2>/dev/null \
|
||||
|| DEBIAN_FRONTEND=noninteractive apt-get install -y polkitd pkexec 2>/dev/null \
|
||||
@@ -746,7 +746,7 @@ upgrade_repeater() {
|
||||
echo "[3/9] Updating system dependencies..."
|
||||
apt-get update -qq
|
||||
|
||||
apt-get install -y libffi-dev libusb-1.0-0 sudo jq pip python3-venv python3-rrdtool wget swig build-essential python3-dev
|
||||
apt-get install -y libffi-dev libusb-1.0-0 sudo jq pip python3-venv python3-rrdtool wget swig build-essential python3-dev i2c-tools
|
||||
# Install polkit (package name varies by distro version)
|
||||
apt-get install -y policykit-1 2>/dev/null \
|
||||
|| apt-get install -y polkitd pkexec 2>/dev/null \
|
||||
|
||||
@@ -39,6 +39,7 @@ dependencies = [
|
||||
"pyserial>=3.5",
|
||||
"pyjwt>=2.8.0",
|
||||
"ws4py>=0.6.0",
|
||||
"smbus2>=0.4.0",
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user