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

fix/enhance: allow telemetry sensors connected to second I2C port #2891

Merged
merged 2 commits into from
Oct 15, 2023

Conversation

mverch67
Copy link
Collaborator

When connecting a telemetry sensor to the I2C port 1 the sensor is detected during the I2C scan but cannot be used. Only sensors connected to I2C port 0 are functional.

INFO  | ??:??:?? 15 [EnvironmentTelemetryModule] Environment Telemetry: Initializing
INFO  | ??:??:?? 15 [EnvironmentTelemetryModule] Init sensor: BMP280
WARN  | ??:??:?? 15 [EnvironmentTelemetryModule] Could not connect to detected BMP280 sensor.

The telemetry sensor classes use only the global variable "Wire" even the sensor was detected on "Wire1".

This PR fixes this behavior by passing the wire pointer to the sensor class using an enhanced version of the nodeTelemetrySensorsMap.

INFO  | ??:??:?? 14 [EnvironmentTelemetryModule] Environment Telemetry: Initializing
INFO  | ??:??:?? 14 [EnvironmentTelemetryModule] Init sensor: BMP280
INFO  | ??:??:?? 14 [EnvironmentTelemetryModule] Opened BMP280 sensor on i2c bus
DEBUG | ??:??:?? 15 [EnvironmentTelemetryModule] BMP280Sensor::getMetrics
INFO  | ??:??:?? 15 [EnvironmentTelemetryModule] (Sending): barometric_pressure=949.862549, current=0.000000, gas_resistance=0.000000, relative_humidity=0.000000, temperature=23.020000, voltage=0.000000

@mverch67 mverch67 mentioned this pull request Oct 14, 2023
@mverch67 mverch67 requested a review from thebentern October 14, 2023 13:06
@github-actions
Copy link
Contributor

🤖 Pull request artifacts

file commit
pr2891-firmware-2.2.12.4721059.zip 4721059

thebentern added a commit to meshtastic/artifacts that referenced this pull request Oct 14, 2023
@thebentern thebentern merged commit 142d56c into meshtastic:master Oct 15, 2023
56 checks passed
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

Successfully merging this pull request may close these issues.

2 participants