Search found 409 matches

by kevinkk525
Tue May 21, 2019 10:25 am
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

The micropython test revealed the offset (same as Roberthh's finding): >>> while True: ... gc.collect() ... t=time.ticks_ms() ... if time.ticks_us()<20: ... print("us overflow") ... time.sleep_us(20) ... delta = time.ticks_diff(time.ticks_ms(), t) ... if delta < 0 or delta >5: ... print("Fail time i...
by kevinkk525
Tue May 21, 2019 9:12 am
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

jomas wrote:
Tue May 21, 2019 9:04 am
MICROPY_PY_UTIME_TICKS_PERIOD = 2^30.
So MICROPY_PY_UTIME_TICKS_PERIOD-1 is used as a mask of 30bits (0b111111111111111111111111111111)
Ah thanks. This however gives exactly the same result.
by kevinkk525
Tue May 21, 2019 8:56 am
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

I tried to run some tests on my arduino: uint32_t system_time_high_word=0; uint32_t current_time = 4294967295; //just before overflow uint32_t MICROPY_PY_UTIME_TICKS_PERIOD =0; uint32_t system_get_time(void) { return current_time; } uint32_t mp_hal_ticks_ms(void) { return ((uint64_t)system_time_high...
by kevinkk525
Tue May 21, 2019 6:46 am
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

I had an event with @pythoncoder's simple test code this night. I used the settings for COUNT, MAX, MIN = 10000, 38, 34. There was a fail with a time gap of 4295005 ms, which is 1h 11m 35s 5 ms, or about 2^32 µs. A single pass runs ~35ms, which is the deviation to 2^32. Thank you @Roberthh for test...
by kevinkk525
Mon May 20, 2019 10:09 pm
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

No, your assumption is right. The whole uasyncio is blocking for 1h 11 minutes, not only one coroutine. I tested this when I first discovered the problem by running multiple testing codes (publishing sensor values and logging if there's a too big delay between executions in another coroutine) and al...
by kevinkk525
Mon May 20, 2019 9:17 pm
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

I thought I understand the implications but had to edit my post because I had thought it wrong. In uasyncio core.py in method run(): [...] if not self.runq: delay = -1 if self.waitq: tnow = self.time() t = self.waitq.peektime() delay = time.ticks_diff(t, tnow) if delay < 0: delay = 0 self.wait(delay...
by kevinkk525
Mon May 20, 2019 8:38 pm
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

That is an interesting find! If that's true, it could explain why only the esp8266 is affected as the esp32 seems to use "esp_timer_get_time()" instead in mphalport. I checked the functions you mention and to me (I don't know the inner workings of micropython) it looks like it is indeed possible to ...
by kevinkk525
Mon May 20, 2019 4:51 pm
Forum: ESP8266 boards
Topic: How to switch on a electric bulb with ESP8266 board?
Replies: 50
Views: 1659

Re: How to switch on a electric bulb with ESP8266 board?

Code: Select all

t = time.localtime()  
t = t[0:3] + (0,) + (t[3] + TIMEZONE_OFFSET,) + t[4:6] + (0,)
print("{}-{:02d}-{:02d} {:02d}:{:02d}:{:02d}".format(t[0], t[1], t[2], t[3],t[4],t[5])
Creates this output: 2019-05-20 14:56:03 (YYYY-MM-DD HH:mm:SS)
by kevinkk525
Mon May 20, 2019 3:39 pm
Forum: General Discussion and Questions
Topic: Greenhouses automation botnet. Need your advice.
Replies: 3
Views: 240

Re: Greenhouses automation botnet. Need your advice.

This is a very interesting project! I'm currently building a small Greenhouse on my balcony... Got almost all libraries ready for it. Why not send the current task by mqtt instead of all daily tasks? I see no need for a separate socket server (but could point you to a library pythoncoder and I creat...
by kevinkk525
Sun May 19, 2019 3:10 pm
Forum: ESP8266 boards
Topic: [SOLVED] uasyncio is blocked for 1 hour, 11 minutes on ESP8266
Replies: 26
Views: 875

Re: uasyncio is blocked for 1 hour, 11 minutes (Bug?)

I would also assume that it is something esp8266 specific. Either in micropython firmware or the esp-idf. I'm only running an ESP32 occasionally so I don't have a good comparison but didn't encounter the problem there. Only devices anyone reported this problem yet is the esp8266. If the problem affe...