Closed ThatRed closed 7 years ago
yep its a bug. the global variable should be stored in taskvalue arrays.
@psy0rz add this to 2.0.0 milestone
I think the same applies for the BME280/BMP280 plugins. But it is more likely to use multiple power-sensors at the same controller, compared to how likely it is to use several temperature sensors at the same controller. i2c address is also stored in a global variable, but the boolean flags for init and calibration are stored in an array as I think it should be.
Is it safe to assume also these parameters of the INA219 may be affected when using more sensors with different ranges set?
uint32_t ina219_calValue;
// The following multipliers are used to convert raw current and power
// values to mA and mW, taking into account the current config settings
uint32_t ina219_currentDivider_mA;
I just made some changes and created a pull request, as I think it should fix this issue. I do not have this sensor, so please test with real hardware.
@ThatRed can you test it?
also try powering it off and on when it works, to see if all important data is actually stored in flash. :)
ordered hardware, will test later myself.
Today I received 3 of these sensors and tested them. See pull request #540 Only minor changes in comments and log-entries, but is working fine.
Just a note on testing the sensors. The Vin- and Vin+ pins on both sides are connected to the 0.1 Ohm shunt. So do not connect a power source to both these pins, like I did. (oops) Voltage is just measured between GND and Vin- Current is measured between Vin- and Vin+
fixed in PR #519
Hello!
The last submitted i2c address will be used for both devices:
Steps to reproduce
How can we trigger this problem?
Create one INA219 Device with address 0x40 and a second one with 0x41. In the log you can see that the last address 0x41 is used for both devices.
ESP Easy Mega: ESP8266-PD1 MainConfigControllersHardwareDevicesRulesNotificationsTools Log 2527551 : WD : Uptime 42 ConnectFailures 0 FreeMem 21288 2555790 : INA219 0x41: Voltage: 23.93 Current: 0.03 Power: 0.62 2555790 : EVENT: InputA#VoltageA=23.93 2555918 : EVENT: InputA#CurrentA=0.03 2556051 : EVENT: InputA#PowerA=0.62 2556799 : INA219 0x41: Voltage: 23.95 Current: 0.03 Power: 0.64 2556800 : EVENT: InputB#VoltageB=23.95 2556926 : EVENT: InputB#CurrentB=0.03 2557058 : EVENT: InputB#PowerB=0.64 2557552 : WD : Uptime 43 ConnectFailures 0 FreeMem 21040 Powered by www.letscontrolit.com
If you go back to the device with 0x40 and click „Submit“ again then it uses 0x40 for both devices:
ESP Easy Mega: ESP8266-PD1 MainConfigControllersHardwareDevicesRulesNotificationsTools Log 2434661 : INA219 0x40: Voltage: 5.02 Current: 0.23 Power: 1.16 2434661 : EVENT: InputA#VoltageA=5.02 2434787 : EVENT: InputA#CurrentA=0.23 2434925 : EVENT: InputA#PowerA=1.16 2435667 : INA219 0x40: Voltage: 5.02 Current: 0.23 Power: 1.17 2435668 : EVENT: InputB#VoltageB=5.02 2435796 : EVENT: InputB#CurrentB=0.23 2435930 : EVENT: InputB#PowerB=1.17 2436638 : WD : Uptime 41 ConnectFailures 0 FreeMem 21288 2443645 : EVENT: Clock#Time=Thu,20:21 Powered by www.letscontrolit.com
Does the problem presist after powering off and on? (just resetting isnt enough sometimes)
Yes, the problem persists after powering off and on.
Expected behavior
Tell us what should happen?
Every INA219 Device should get the right address:
e.g. the log should look like this:
INA219 0x40: Voltage: 5.02 Current: 0.23 Power: 1.17 EVENT: InputB#VoltageB=5.02 EVENT: InputB#CurrentB=0.23 EVENT: InputB#PowerB=1.17 INA219 0x41: Voltage: 23.93 Current: 0.03 Power: 0.62 EVENT: InputA#VoltageA=23.93 EVENT: InputA#CurrentA=0.03 EVENT: InputA#PowerA=0.62
Actual behavior
Tell us what happens instead?
see description above (### Steps to reproduce)
System configuration
Hardware: D1 mini, two IDA219 Devices and an OLED SSD1306 Framed
Software or git version: Release v2.0.0-dev11 (I downloaded from github and built the Version yesterday)
Thanks in advance.