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

    Edukit ATECC608B & AWS IOT & UiFlow

    Core2 for AWS
    4
    35
    58.3k
    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.
    • ajb2k3A
      ajb2k3
      last edited by

      And a guide:
      https://www.hackster.io/AJB2K3/accessing-the-atecc608b-in-uiflow-part-1-5ac679

      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
      • felmueF
        felmue
        last edited by

        Hello @ajb2k3

        thank you for putting together the guide. Unfortunately I cannot get it to work. I do not fully understand the following instructions from your guide.

        Now I have the basics after poking away at micropython I import machine and units._ID0

        import units
        from units import _ID
        ID_0 = unit.get(unit.ID, (21,22))
        

        Using Thonny and ...
        ... trying to import units._ID0 results in an error.
        ... where is _ID used?
        ... trying to run ID_0 = unit.get(unit.ID, (21,22)) still crashes my M5Core2.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

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

          @felmue It will.
          You have to run the commands in that exact order or it will crash and restart!

          If you run help('modules') in Thonny you will find the module units/_ID this took me house to work out.

          _ID0 does not exist, the module is _ID

          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
          • felmueF
            felmue
            last edited by

            Hello @ajb2k3

            thank you. I appreciate all your help. Unfortunately for some reason I cannot get it to work on my side. Whatever steps I execute before, every time I try to execute ID_0 = unit.get(unit.ID, (21,22)) my M5Core2 crashes.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

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

              @felmue Sorry, you need to import unit
              Then import units then from units import _ID

              also the code is

              import units
              import unit
              from units import _ID
              ID_0 = unit.get(unit.ID, (21,22))
              

              however you can also use:

              import units
              import unit
              from units import _ID
              ATECC = unit.get(unit.ID, (21,22))
              

              I don't know why both unit and units (with an S) must be called but they both do.

              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
              • felmueF
                felmue
                last edited by

                Hello @ajb2k3

                thank you again. I tried both your code sequences - still no luck. M5Core2 still reboots after the last command.

                Which UIFlow firmware version is running on your M5Core2?

                Thanks
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

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

                  @felmue ok, its been working all day and now crashing
                  1.10.2

                  OK if you make 1 single mistake, you to to disconnect and power down the Core2 to empty the memory
                  0_1659898393874_Screenshot 2022-08-07 at 19.53.03.png

                  this works.

                  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
                  • felmueF
                    felmue
                    last edited by

                    Hello @ajb2k3

                    at this point I think whether the commands succeed or result in a crash depends on the amount of free memory.
                    With a freshly rebooted M5Core2 the following commands (sometimes) can be executed w/o crash.

                    >>> import unit
                    >>> ID_0 = unit.get(unit.ID, (21,22))
                    >>> print(ID_0.wakeup())
                    True
                    >>> print(ID_0.readConfigZone())
                    Traceback (most recent call last):
                      File "<stdin>", line 1, in <module>
                      File "units/_ID.py", line 186, in readConfigZone
                      File "units/_ID.py", line 363, in read
                      File "units/_ID.py", line 377, in read_output
                      File "units/_ID.py", line 161, in idle_mode
                      File "i2c_bus.py", line 100, in write_list
                    OSError: I2C bus error (110)
                    >>> print(ID_0.readConfigZone())
                    True
                    >>> print(ID_0.revisionNumber)
                    bytearray(b'\x00\x00`\x03')
                    

                    Note: The commands need to be executed manually one by one.
                    Note: I don't need the import units nor the from units import _ID commands.

                    Thanks
                    Felix

                    GPIO translation table M5Stack / M5Core2
                    Information about various M5Stack products.
                    Code examples

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

                      @felmue said in Edukit ATECC608B & AWS IOT & UiFlow:

                      Hello @ajb2k3

                      at this point I think whether the commands succeed or result in a crash depends on the amount of free memory.
                      With a freshly rebooted M5Core2 the following commands (sometimes) can be executed w/o crash.

                      >>> import unit
                      >>> ID_0 = unit.get(unit.ID, (21,22))
                      >>> print(ID_0.wakeup())
                      True
                      >>> print(ID_0.readConfigZone())
                      Traceback (most recent call last):
                        File "<stdin>", line 1, in <module>
                        File "units/_ID.py", line 186, in readConfigZone
                        File "units/_ID.py", line 363, in read
                        File "units/_ID.py", line 377, in read_output
                        File "units/_ID.py", line 161, in idle_mode
                        File "i2c_bus.py", line 100, in write_list
                      OSError: I2C bus error (110)
                      >>> print(ID_0.readConfigZone())
                      True
                      >>> print(ID_0.revisionNumber)
                      bytearray(b'\x00\x00`\x03')
                      

                      Note: The commands need to be executed manually one by one.
                      Note: I don't need the import units nor the from units import _ID commands.

                      Thanks
                      Felix
                      Agreed, once the error occurs then memory gets filled requiring hard reset.
                      You didn’t need unit or the from? I will try again later.
                      I have spent all weekend writing up the atecc for my av2 book including logging the MP modules. I’ll try without those two line tonight.

                      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
                        last edited by

                        The issue of found was that the basic unit functions are in the unit module with unit.ID being empty but the ATecc function are all in units._ID

                        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
                          last edited by ajb2k3

                          @felmue try adding the following before defining ID_0

                          From esp import gc
                          gc.collect.

                          This should help clean up some memory.

                          Nope that was wrong. the min code I can get running is

                          import unit
                          import units
                          from units import _ID
                          import gc
                          ATECC = unit.get(unit.ID, (21,22))
                          gc.collect()
                          

                          Oh cool, I got import units._ID to work.

                          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
                            last edited by

                            @gabrielgc75 @felmue I now present to you the configuration loaded from the ATECC608b in my Core2 AWS
                            0_1660068336244_Screenshot 2022-08-09 at 19.02.56.png

                            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
                            • felmueF
                              felmue
                              last edited by

                              Hello @ajb2k3

                              thank you. I've tried to add the gc.collect() command. The result is still not 100% persistent. From time to time I still get a crash.

                              Thanks
                              Felix

                              GPIO translation table M5Stack / M5Core2
                              Information about various M5Stack products.
                              Code examples

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

                                @felmue thanks for letting me know. It’s been stable for the testing but I’m yet to move beyond. I tried looking at provisioning for vets and codes but my brain is not taking it in hence the low level MP stuff.

                                I’m sure there will s an issue with MP but I don’t deal directly and not getting feedback from @m5stack or @IAMLIUBO

                                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
                                • First post
                                  Last post