-
Notifications
You must be signed in to change notification settings - Fork 344
uasyncio not working #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've the same problem. |
The issue is caused by the fact that in my port the I have fixed this in modutimeq.c and it should now work as expected. |
Update which should fix this issue is now committed. |
Thanks a lot for the quick answer and the bugfix! Sadly it does not fix the problem:
(sysname='esp32', nodename='esp32', release='3.1.15', version='ESP32_LoBo_v3.1.15 on 2017-02-03', machine='ESP32 board with ESP32') |
It fixes the
I don't use asyincio, so I can't help, unless you point me to the module/method which causes the error. |
You are right, can confirm your code. That's weird.. Thanks for your help! |
I figured it out and it is still the utimeq module:
The asyncio library uses ticks_ms as a time reference, not the time.time() |
It is strange.
I'll check it tomorrow. |
To add a little more insight:
So apparently converting the input to float and back to int gets around the problem. |
I've just committed an update which includes more changes to |
Thanks a lot! |
It's probably worth noting that if you use the uasyncio from PyPi, ie: install with upip, asyncio will not work, as this is an incompatible fork. If you want to use asyncio following the instructions here: |
It is incompatible with version 2.0 of uasyncio. Using version 1.4.2 works perfectly fine. |
Sure. I just thought I'd leave an note for those that follow. |
Uh oh!
There was an error while loading. Please reload this page.
The uasyncio library is not working because of this problem:
Try running a code like this:
It is very simple but the test() coroutine is never entered and instead after a few seconds, the watchdog gets triggered:
So I got into debugging the issue and found, that the function utimeq.peektime() that is used inside the asyncio.wait() function (core.py line 71) for getting the delay to wait, is returning an incredibly high number leading to a very long poller.ipoll() triggering the watchdog.
This was the output:
As you can see the function utimeq.peektime() returns a huge number even before the coroutine is started, but it should return 0 (?) in the first iteration so self.wait() is not called yet as you can see in the following test on esp8266:
The function utimeq.peektime() in modutimeq.c is this:
But that's where my knowledge ends, I have no idea why this function returns this huge number even before the coroutine is executed.
The text was updated successfully, but these errors were encountered: