Open Grovkillen opened 5 years ago
Datasheet shows no sign of multiple units in the same bus
https://www.sparkfun.com/datasheets/Sensors/Temperature/MLX90614_rev001.pdf
Also the device has only the 4 basic pins so I do not see how and address can be set.
BUT
A quick google search resulted into a : "how to assign different slave address other than the default 0x5A"
https://chrisramsay.co.uk/posts/2014/09/arduino-and-multiple-mlx90614-sensors/
So I guess one could have up to 127 units on the same bus if wanted to push the envelop.
-D
Port is used as an offset to 0x5A (90). So in general ... leave it 0 (no offset) .. is my experience.
So we should remove it until we have a better way of doing that (my opinion). It's not clear how to use that setting in current implementation.
By the way, if used as an offset the port number is wrong in the device page.
My vote is to remove it (anything else is just asking for trouble)
Address seems to be stored in an EEPROM, writeable. http://forum.arduino.cc/index.php?topic=54170.0 https://chrisramsay.co.uk/posts/2017/09/arduino-and-multiple-mlx90614-sensors-take-two/
To any-one who can read the code ... Is P024_MLX90614.ino supporting the address change via the power cycle procedure? As explained here https://chrisramsay.co.uk/posts/2017/09/arduino-and-multiple-mlx90614-sensors-take-two/
Once the current address is read out, I start the process of setting a new slave address (NewMLXAddr)
Address change ...something as seems possible (??) with _P047_i2c-soil-moisture-sensor.ino
// check if we want to change the sensor address
if (Settings.TaskDevicePluginConfig[event->TaskIndex][4]) {
addLog(LOG_LEVEL_INFO, String(F("SoilMoisture: Change Address: 0x")) + String(_i2caddrP47,HEX) + String(F("->0x")) +
String(Settings.TaskDevicePluginConfig[event->TaskIndex][3],HEX));
if (Plugin_047_setAddress(Settings.TaskDevicePluginConfig[event->TaskIndex][3])) {
Settings.TaskDevicePluginConfig[event->TaskIndex][0] = Settings.TaskDevicePluginConfig[event->TaskIndex][3];
}
Settings.TaskDevicePluginConfig[event->TaskIndex][4] = false;
}
https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P024_MLX90614.ino
We shouldn't use the port setting for this hardware, it's set to 0x5A (90) and is not changeable (or is it?).
should be?
I don't have this unit close by but will try to test my change this week.
We should also clean up the comments regarding mysensors etc.
EDIT: it might be that I'm wrong and it's possible to have up to 127 units in the same bus...? How should we go about that?