Failure in library "TSL2561-Arduino-Library"
-
Hi,
i'm using the sensor TLS2561 and NodeManager 1.7. I installed the libraray "TSL2561-Arduino-Library" as it is described in the README.md.
The function TSL2561::begin returns always true notwithstanding if the address mode (TSL2561_ADDR_HIGH|FLOAT|LOW) not matches the hardware setting of the address line (high|floating|low).Wire.requestFrom(_addr, 1); #if ARDUINO >= 100 int x = Wire.read(); #else int x = Wire.receive(); #endif //Serial.print("0x"); Serial.println(x, HEX); if (x & 0x0A ) { //Serial.println("Found TSL2561"); } else { return false; } _initialized = true;
So, if the address matches the TLS2561 anwers with 0x0A. If the address does not match the I2C bus will read as 0xFF. In this case the statement "if (x & 0x0a)" will also be true.
I changed the statement to "if (x == 0x0A)" and the function works correctly.
@user2864 Maxbe you could intiate a change in the library. I don't know how to do that in the github environment.
Greatings from germany, mabe with a special german english
-
@ab13akl thanks for reporting this issue, tracking it down with https://github.com/mysensors/NodeManager/issues/402, will definitely look at it throughout v1.8 development. Thanks again!
-
@ab13akl I was reviewing this in more details and if I have understood correctly the change you have made was in the Adafruit library, right? Do you think there is anything we can do on the NodeManager's side? Thanks!
-
@user2684 Yes, i have changed the Adafruit library. NodeManager code is ok: it generates an "ERROR" message when "(_tsl->begin())" fails. But, in the current Adafruit library begin() never fails. Thanks for the fast response.
-
@ab13akl thanks for confirming, I'll then close the issue on the NodeManager side but by keeping track of it other users facing the same problem should at least be able to identify it quicker and have a ready-to-use workaround, many thanks for sharing!
Suggested Topics
-
Sensors db
My Project • 16 Apr 2014, 07:06 • Dvbit 16 Apr 2014, 17:37 -
Nodemanager: How to control a local output from a local input?
NodeManager • 30 Jan 2022, 21:01 • A3V 5 Feb 2022, 16:24 -
Nrf5x on NodeManager
NodeManager • 9 Apr 2019, 14:26 • nullos 6 Nov 2020, 09:28 -
DS18B20 ESP32 nodemanager problem
NodeManager • 13 Sept 2022, 10:59 • A3V 15 Sept 2022, 22:11 -
Help needed with connecting MySensors node to Home Assistant
NodeManager • 16 May 2024, 09:59 • HJ_SK 19 May 2024, 15:01 -
Compilation error
NodeManager • 19 Sept 2020, 15:41 • htaxil 18 Oct 2020, 09:37