Speaker beep and Wait
-
Hi folks
If I use a "speaker beep" and "wait" in uiflow, all my m5stack cores hangs up after 3-8 beeps.
Is it wrongly implemented in uiflow?
best regards
Thomas -
Post your flow or code and someone might be able to help.
-
@m5stickfreakler said in Speaker beep and Wait:
If I use a "speaker beep" and "wait" in uiflow, all my m5stack cores hangs up after 3-8 beeps.
Is it wrongly implemented in uiflow?
best regardssimple example
from m5stack import *
from m5ui import *
from uiflow import *
import unittof0 = unit.get(unit.TOF, unit.PORTA)
@timerSch.event('timer1')
def ttimer1():
global unit
wait(1)
speaker.sing(831, 1/16)
passtimerSch.run('timer1', 1000, 0x00)
-
-
@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.
-
Its just an example to demonstrate the bug. The use case is much more complicate.
-
@m5stickfreakler try to delete the wait block in the callback program.
-
-
-
Hi.That is unusual...Try to upload it on a different device(if you have)and check.
-
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. -
@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.)
-
thank you sysdl132 for confirmation this bug :-)
-
@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
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.
-
@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.try it out and you will see what I mean :-)
-
@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.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.
-
@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.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.
-
@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. -
This post is deleted! -
This post is deleted!