tronikos / esphome-magnetometer-water-gas-meter

Using ESP8266 or ESP32 and QMC5883L or HMC5883L, a triple-axis magnetometer, to read your water meter or gas meter
107 stars 24 forks source link

Two Meters not working #34

Open spydazcomputers opened 2 months ago

spydazcomputers commented 2 months ago

Based on the post tagged in #31 referring to #28, I have tried to get it working but get an i2c failure.

with both meters connected I can flash just water or just gas and it works fine.

below is my two-meters code

I have tried to get this to work, understanding that it is not tested however I have failed.

I can get the two meters to read individually using the gas and water yaml's however when I switch to the below code I get an error in the log buffer of i2c failed q*** failed.

Any thoughts, For now I am just using 2 separate esp32 devices but the meters are 3 feet apart using one would be ideal.

substitutions: i2c1_sda: GPIO6 i2c1_scl: GPIO5 i2c2_sda: GPIO22 i2c2_scl: GPIO23

packages: meter: url: https://github.com/tronikos/esphome-magnetometer-water-gas-meter ref: main file: esphome-two-meters.yaml refresh: 0s

tronikos commented 2 months ago

So you have connected one magnetometer to the 5 and 6 pins and another to 22 and 23 pins and it doesn't work? What's the exact error that you get? And without any rewiring, just changing the firmware to use one of the 2 magnetometers it works?

spydazcomputers commented 2 months ago

So you have connected one magnetometer to the 5 and 6 pins and another to 22 and 23 pins and it doesn't work? What's the exact error that you get? And without any rewiring, just changing the firmware to use one of the 2 magnetometers it works?

Yes, I have 3 firmwares, water only, gas only and water+ gas. Individual ones work the combined does not.

I will reconnect and reflash to get the exact error and post it here