🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Connecting Env Unit and RFID Unit via Grove Hub on M5StickC

    M5 Stick/StickC
    4
    12
    16.2k
    Loading More Posts
    • 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.
    • W
      ws1088
      last edited by ws1088

      Individually connect to the Grove Hub works. But if I put both on the hub, it will gives

      ENV unit maybe not connect

      This is the code from UIFlow:

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import unit
      
      setScreenColor(0x111111)
      rfid0 = unit.get(unit.RFID, unit.PORTA)
      env1 = unit.get(unit.ENV, unit.PORTA)
      
      wait(1)
      while True:
        lcd.print((('C: ' + str((env1.temperature)))), 0, 0, 0x3366ff)
        lcd.print((('RFID: ' + str((rfid0.readUid())))), 0, 10, 0x3366ff)
        wait_ms(200)
      

      Even if I manually switched the order to:

      env1 = unit.get(unit.ENV, unit.PORTA)
      rfid0 = unit.get(unit.RFID, unit.PORTA)
      

      I still get:

      ENV unit maybe not connect

      What am I doing wrong? Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • W
        ws1088
        last edited by

        I use the following code to test:

        from m5stack import *
        from m5ui import *
        from uiflow import *
        import i2c_bus
        
        setScreenColor(0x111111)
        
        
        devices = None
        scan = None
        
        i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x68)
        devices = []
        while True:
          scan = i2c0.scan()
          if devices != scan:
            lcd.clear()
            lcd.print(str(scan), 0, 0, 0xffffff)
          devices = scan
          wait_ms(2)
        

        I can see the I2C addresses for the Env unit and RFID unit combinations when I plug them into the Grove Hub. I can plug the Env unit in to see addresses 92 and 118, then add RFID unit to see [40, 92, 118] etc.

        So I am pretty clueless why the following will fail:

        rfid0 = unit.get(unit.RFID, unit.PORTA)
        env1 = unit.get(unit.ENV, unit.PORTA)
        

        Looks like I need to go to the source code and see what's going on...

        robskiR 1 Reply Last reply Reply Quote 0
        • W
          ws1088
          last edited by

          It looks like Env unit has 2 I2C addresses (92, 118)? But many times 92 will go away in the scan loop. Strange...

          ajb2k3A 1 Reply Last reply Reply Quote 0
          • ajb2k3A
            ajb2k3
            last edited by ajb2k3

            All I can think is that the two sensors are drawing too much power for the bus.

            I have both units and also the hat versions. if I find time over the week end I may have some time to test but I may need a reminder on saturday.

            Double check the address's. The published addresses are in Hex but they are displayed in binary on the screen!

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            1 Reply Last reply Reply Quote 0
            • ajb2k3A
              ajb2k3 @ws1088
              last edited by

              @ws1088 Confirmed, the RFID Unit will not work with the ENV unit and will not work with the ENV hat

              UIFlow, so easy an adult can learn it!
              If I don't know it, be patient!
              I've ether not learned it or am too drunk to remember it!
              Author of the WIP UIFlow Handbook!
              M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

              W 2 Replies Last reply Reply Quote 0
              • W
                ws1088 @ajb2k3
                last edited by

                @ajb2k3 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:

                @ws1088 Confirmed, the RFID Unit will not work with the ENV unit and will not work with the ENV hat

                Is the reason as you mentioned that there is not enough power? I guess not because you test it on the ENV hat with RFID unit. I noticed a lot of bus error (timeout), maybe it's a software issue? I am using UIFlow, btw. Are you using Arduino IDE and C++?

                ajb2k3A 1 Reply Last reply Reply Quote 0
                • ajb2k3A
                  ajb2k3 @ws1088
                  last edited by

                  @ws1088 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:

                  @ajb2k3 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:

                  @ws1088 Confirmed, the RFID Unit will not work with the ENV unit and will not work with the ENV hat

                  Is the reason as you mentioned that there is not enough power? I guess not because you test it on the ENV hat with RFID unit. I noticed a lot of bus error (timeout), maybe it's a software issue? I am using UIFlow, btw. Are you using Arduino IDE and C++?

                  Nope, only UIFlow as I'm trying to write the book on it.

                  UIFlow, so easy an adult can learn it!
                  If I don't know it, be patient!
                  I've ether not learned it or am too drunk to remember it!
                  Author of the WIP UIFlow Handbook!
                  M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                  W 1 Reply Last reply Reply Quote 0
                  • W
                    ws1088 @ajb2k3
                    last edited by

                    Could this be related?

                    http://community.m5stack.com/topic/523/problems-with-the-i2c-grove-interface

                    1 Reply Last reply Reply Quote 0
                    • W
                      ws1088 @ajb2k3
                      last edited by

                      @ajb2k3 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:

                      @ws1088 Confirmed, the RFID Unit will not work with the ENV unit and will not work with the ENV hat

                      wow, RFID unit will not work with ENV hat even? I though RFID unit is I2C (G32 and G33) and ENV hat is on G26 and G36...

                      ajb2k3A 1 Reply Last reply Reply Quote 0
                      • ajb2k3A
                        ajb2k3 @ws1088
                        last edited by

                        @ws1088 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:

                        @ajb2k3 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:

                        @ws1088 Confirmed, the RFID Unit will not work with the ENV unit and will not work with the ENV hat

                        wow, RFID unit will not work with ENV hat even? I though RFID unit is I2C (G32 and G33) and ENV hat is on G26 and G36...

                        I could not get them to work together but then i am not a good programmer.

                        UIFlow, so easy an adult can learn it!
                        If I don't know it, be patient!
                        I've ether not learned it or am too drunk to remember it!
                        Author of the WIP UIFlow Handbook!
                        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                        1 Reply Last reply Reply Quote 0
                        • M
                          maknis3
                          last edited by

                          Fellow users from the past, I encountered the same problem but managed to get it working. The problem lies in the paralell access of the RFID and ENV module. If the access is isolated in a paralell process and saved in to variables, further getting the values by using these variables, you should be able to use the two modules in unison.

                          1 Reply Last reply Reply Quote 0
                          • robskiR
                            robski @ws1088
                            last edited by

                            @ws1088 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:

                            I use the following code to test:

                            from m5stack import *
                            from m5ui import *
                            from uiflow import *
                            import i2c_bus
                            
                            setScreenColor(0x111111)
                            
                            
                            devices = None
                            scan = None
                            
                            i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x68)
                            devices = []
                            while True:
                              scan = i2c0.scan()
                              if devices != scan:
                                lcd.clear()
                                lcd.print(str(scan), 0, 0, 0xffffff)
                              devices = scan
                              wait_ms(2)
                            

                            I can see the I2C addresses for the Env unit and RFID unit combinations when I plug them into the Grove Hub. I can plug the Env unit in to see addresses 92 and 118, then add RFID unit to see [40, 92, 118] etc.

                            So I am pretty clueless why the following will fail:

                            rfid0 = unit.get(unit.RFID, unit.PORTA)
                            env1 = unit.get(unit.ENV, unit.PORTA)
                            

                            Looks like I need to go to the source code and see what's going on...

                            are modules working ok on their own and you see issue when both connected?

                            M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post