Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. NodeManager
  4. Failure in library "TSL2561-Arduino-Library"

Failure in library "TSL2561-Arduino-Library"

Scheduled Pinned Locked Moved NodeManager
tsl2561tsl2561-intializingtsl2561-address
5 Posts 2 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ab13Akl
    wrote on last edited by
    #1

    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:relieved:

    U 2 Replies Last reply
    1
    • A Ab13Akl

      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:relieved:

      U Offline
      U Offline
      user2684
      Contest Winner
      wrote on last edited by
      #2

      @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!

      1 Reply Last reply
      0
      • A Ab13Akl

        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:relieved:

        U Offline
        U Offline
        user2684
        Contest Winner
        wrote on last edited by
        #3

        @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!

        A 1 Reply Last reply
        0
        • U user2684

          @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!

          A Offline
          A Offline
          Ab13Akl
          wrote on last edited by
          #4

          @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.

          U 1 Reply Last reply
          0
          • A Ab13Akl

            @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.

            U Offline
            U Offline
            user2684
            Contest Winner
            wrote on last edited by
            #5

            @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!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            21

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular