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

    Speaker beep and Wait

    UIFlow
    4
    22
    52.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.
    • m5stackM
      m5stack @M5StickFreakler
      last edited by

      @m5stickfreakler if you just want control it play 1/16 beep each second , why you use interrupt and wait at the same time? you can just use a loop block. then put the wait and beep program inside.

      1 Reply Last reply Reply Quote 0
      • M5StickFreaklerM
        M5StickFreakler
        last edited by

        Its just an example to demonstrate the bug. The use case is much more complicate.

        m5stackM 1 Reply Last reply Reply Quote 0
        • m5stackM
          m5stack @M5StickFreakler
          last edited by

          @m5stickfreakler try to delete the wait block in the callback program.

          1 Reply Last reply Reply Quote 0
          • M5StickFreaklerM
            M5StickFreakler
            last edited by

            :-)

            Of course it is the same behavior.
            Try it out yourself!
            Run the program and wait for some beeps and you will hear a continues tone.
            Its obviously a bug.

            0_1581763635467_Unbenanntes Bild.png

            world101W 1 Reply Last reply Reply Quote 0
            • M5StickFreaklerM
              M5StickFreakler
              last edited by

              Same problem occurs with LED and with 3 different M5Stack units.
              Try it out and you will see that after some blinking phase it will stuck up in a permanent light.

              0_1581765871734_Unbenanntes Bild.png

              I think that is a big problem...

              world101W 1 Reply Last reply Reply Quote 0
              • sysdl132S
                sysdl132
                last edited by

                Hi.That is unusual...Try to upload it on a different device(if you have)and check.

                Baudrate for M5 core/Stick/camera:115200/921600
                For M5StickC:115200/230400/750000/1500000
                For M5StickV:115200/921600/1500000
                For Atom:115200/230400/921600

                1 Reply Last reply Reply Quote 0
                • M5StickFreaklerM
                  M5StickFreakler
                  last edited by

                  Thank you for reply
                  I told you I have uploaded it to 3 different devices. Same behavior.
                  The timer functionality is implemented buggy. It works only in a normal loop but not with events.

                  sysdl132S 1 Reply Last reply Reply Quote 0
                  • sysdl132S
                    sysdl132 @M5StickFreakler
                    last edited by

                    @m5stickfreakler Seems a UIFlow bug.You can contect the m5stack group.(Actually I have the same problem on an old device and a new device.They both has the problem.)

                    Baudrate for M5 core/Stick/camera:115200/921600
                    For M5StickC:115200/230400/750000/1500000
                    For M5StickV:115200/921600/1500000
                    For Atom:115200/230400/921600

                    1 Reply Last reply Reply Quote 0
                    • M5StickFreaklerM
                      M5StickFreakler
                      last edited by

                      thank you sysdl132 for confirmation this bug :-)

                      1 Reply Last reply Reply Quote 0
                      • world101W
                        world101 @M5StickFreakler
                        last edited by

                        @m5stickfreakler said in Speaker beep and Wait:

                        This Code generates no sound or an endless sound but not the expected 1/16 beep each second

                        0_1581454695356_Unbenanntes Bild.png

                        This flow has issues because it's trying to fire a timer callback at the same time as the 1 second wait, which causes a blocking function. I do get a continuous beep as you describe, but I don't think it's a bug. I would consider it bad code design because you have two functions at 1 second firing at the same time, which causes blocking. You really only need the timer and not the 1 second wait function to achieve a beep ever 1 second.

                        M5StickFreaklerM 1 Reply Last reply Reply Quote -1
                        • M5StickFreaklerM
                          M5StickFreakler @world101
                          last edited by

                          @world101 said in Speaker beep and Wait:

                          This flow has issues because it's trying to fire a timer callback at the same time as the 1 second wait, which causes a blocking function. I do get a continuous beep as you describe, but I don't think it's a bug. I would consider it bad code design because you have two functions at 1 second firing at the same time, which causes blocking. You really only need the timer and not the 1 second wait function to achieve a beep ever 1 second.

                          As I mentioned earlier, the bug has nothing to do with the "Wait".
                          You can check it by yourself:

                          :-)

                          Of course it is the same behavior.
                          Try it out yourself!
                          Run the program and wait for some beeps and you will hear a continues tone.
                          Its obviously a bug.

                          0_1581763635467_Unbenanntes Bild.png

                          try it out and you will see what I mean :-)

                          1 Reply Last reply Reply Quote 0
                          • world101W
                            world101 @M5StickFreakler
                            last edited by

                            @m5stickfreakler said in Speaker beep and Wait:

                            :-)

                            Of course it is the same behavior.
                            Try it out yourself!
                            Run the program and wait for some beeps and you will hear a continues tone.
                            Its obviously a bug.

                            0_1581763635467_Unbenanntes Bild.png

                            I tested this exact flow and let it run for over 20 minutes and I'm still getting beep every 1 second. I have no issues with this flow on the M5Stack Core Grey and M5Stack Fire. I'm using uiFlow 1.4.4 and firmware v1.4.4.

                            M5StickFreaklerM 1 Reply Last reply Reply Quote 0
                            • world101W
                              world101 @M5StickFreakler
                              last edited by world101

                              @m5stickfreakler said in Speaker beep and Wait:

                              Same problem occurs with LED and with 3 different M5Stack units.
                              Try it out and you will see that after some blinking phase it will stuck up in a permanent light.

                              0_1581765871734_Unbenanntes Bild.png

                              I think that is a big problem...

                              I have no issues with this flow either. It's been running for more than 20 minutes along with the beep flow on my other m5stack.

                              M5StickFreaklerM 1 Reply Last reply Reply Quote 0
                              • M5StickFreaklerM
                                M5StickFreakler @world101
                                last edited by M5StickFreakler

                                @world101 said in Speaker beep and Wait:

                                I tested this exact flow and let it run for over 20 minutes and I'm still getting beep every 1 second. I have no issues with this flow on the M5Stack Core Grey and M5Stack Fire. I'm using uiFlow 1.4.4 and firmware v1.4.4.

                                I have the bug on every device here (3 different units), like user "sysdl132". I also use Firmware 1.4.4 (but its buggy in firmware 1.4.3 also)
                                Simply use the "RUN" button and you will have the same UIFlow bug. Dont upload it into the device.

                                M5StickFreaklerM world101W 2 Replies Last reply Reply Quote 0
                                • M5StickFreaklerM
                                  M5StickFreakler @M5StickFreakler
                                  last edited by

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • M5StickFreaklerM
                                    M5StickFreakler @world101
                                    last edited by

                                    This post is deleted!
                                    1 Reply Last reply Reply Quote 0
                                    • world101W
                                      world101 @M5StickFreakler
                                      last edited by world101

                                      @m5stickfreakler said in Speaker beep and Wait:

                                      @world101 said in Speaker beep and Wait:

                                      I tested this exact flow and let it run for over 20 minutes and I'm still getting beep every 1 second. I have no issues with this flow on the M5Stack Core Grey and M5Stack Fire. I'm using uiFlow 1.4.4 and firmware v1.4.4.

                                      I have the bug on every device here (3 different units), like user "sysdl132". I also use Firmware 1.4.4 (but its buggy in firmware 1.4.3 also)
                                      Simply use the "RUN" button and you will have the same UIFlow bug. Dont upload it into the device.

                                      I tested Run and Download to the device and it made no difference. It still runs longer than 20 mins.

                                      Your deleted message said something about connecting a device to see the issue. I have noticed bugs when you have Units defined in uiFlow’s UI simulator but don’t actually connect them to the device. If you connect to REPL it should tell you what the error is... typically “unit not found” and the device is locked up. However it’s not obvious because they’re is no on screen error, leaving the user stumped on what the issue actually is.

                                      If you want additional testing help, you’ll need to post exactly what your entire flow/program looks like, including connections and Units. Obviously there is something unique in your setup that I don’t have, because it’s working for me.

                                      M5StickFreaklerM 1 Reply Last reply Reply Quote 0
                                      • M5StickFreaklerM
                                        M5StickFreakler @world101
                                        last edited by M5StickFreakler

                                        @world101 said in Speaker beep and Wait:

                                        If you want additional testing help, you’ll need to post exactly what your entire flow/program looks like, including connections and Units. Obviously there is something unique in your setup that I don’t have, because it’s working for me.

                                        from m5stack import *
                                        from m5ui import *
                                        from uiflow import *

                                        @timerSch.event('timer1')
                                        def ttimer1():
                                        speaker.sing(220, 1/16)
                                        pass

                                        timerSch.run('timer1', 1000, 0x00)

                                        --> It works if I download it to the device
                                        --> It does not work if I run it from UIFlow

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