Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Multiple devices does not work properly #92

Open
johntaves opened this issue May 23, 2022 · 3 comments
Open

Multiple devices does not work properly #92

johntaves opened this issue May 23, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@johntaves
Copy link

johntaves commented May 23, 2022

At 332:
readInafromEEPROM(deviceNumber); // Load EEPROM to ina structure
ina.maxBusAmps = maxBusAmps > 1022 ? 1022 : maxBusAmps; // Clamp to maximum of 1022A
ina.microOhmR = microOhmR;
initDevice(deviceNumber);
--------------- Should be:
readInafromEEPROM(deviceNumber); // Load EEPROM to ina structure
inaEE.maxBusAmps = maxBusAmps > 1022 ? 1022 : maxBusAmps; // Clamp to maximum of 1022A
inaEE.microOhmR = microOhmR;
ina = inaEE; // to execute inaDet with the new values.
initDevice(deviceNumber);


This makes no sense
_DeviceCount = ((_DeviceCount + 1) % maxDevices); // start again at 0 if overflow

maxDevices should match _expectedDevices when nonzero and of course, _DeviceCount should not overflow back to 0.

if _expectedDevices is nonzero then do not call EEPROM.begin

@johntaves johntaves added the bug Something isn't working label May 23, 2022
@PRosenb
Copy link

PRosenb commented Jun 13, 2022

I had this issue as well with using three different shunt resistors and maxBusAmps.
@SV-Zanshin, is there a plan when that fix can be released? Shall we create a pull request?

@SV-Zanshin
Copy link
Collaborator

SV-Zanshin commented Jun 13, 2022 via email

@PRosenb
Copy link

PRosenb commented Jun 13, 2022

Many thanks for replying @SV-Zanshin , enjoy your trip.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants