Search found 102 matches

by p_j
Thu Aug 25, 2022 7:24 am
Forum: Programs, Libraries and Tools
Topic: Managing asyncio tasks
Replies: 4
Views: 38416

Re: Managing asyncio tasks

Where hardware is inaccessible the best solution is often to run a watchdog timer. This needs careful design: you need to ensure that, if any task fails, the task feeding the WDT is cancelled. You might want to study the global exception handler . Thanks Peter I will have a look at using watchdog t...
by p_j
Mon Aug 22, 2022 12:07 pm
Forum: Programs, Libraries and Tools
Topic: Managing asyncio tasks
Replies: 4
Views: 38416

Re: Managing asyncio tasks

If a task crashes it becomes very hard to reason about the state of your program. Restoring to a known good state (i.e. reboot) is very sensible. Perhaps I'm missing some context, but a task _shouldn't_ ever crash (i.e. have an unhandled exception). i.e. by definition if a task is crashing then the...
by p_j
Mon Aug 22, 2022 11:22 am
Forum: Programs, Libraries and Tools
Topic: Managing asyncio tasks
Replies: 4
Views: 38416

Managing asyncio tasks

What are the best practices for managing asyncio tasks, for example let's assume I have an event loop and three infinite tasks: 1. Streamreader capturing UART sensor data 2. Task updating display 3. Tasks sending data over modem If a task crashes, what would be the best way to detect this and correc...
by p_j
Thu Aug 18, 2022 11:45 pm
Forum: Development of MicroPython
Topic: Paid/sponsored development
Replies: 2
Views: 22030

Re: Paid/sponsored development

Any recommendations on how to go about this? Should I look for developers on freelancer/upwork etc or is there a better way? It might be worth asking in the slack or discord. https://slack-micropython.herokuapp.com/ https://discord.gg/zHgfNMgR Thanks Jimmo will do once I have some more specific det...
by p_j
Thu Aug 04, 2022 8:41 am
Forum: General Discussion and Questions
Topic: WebREPL and uasyncio
Replies: 9
Views: 11481

Re: WebREPL and uasyncio

pythoncoder wrote:
Thu Aug 04, 2022 8:39 am
There are a few specialist applications which can run in the background but they are very much the exception. Anything you write will not unless you've mastered some tricky programming techniques. Simply using uasyncio does not achieve background running.
Thanks Peter
by p_j
Thu Aug 04, 2022 8:33 am
Forum: General Discussion and Questions
Topic: WebREPL and uasyncio
Replies: 9
Views: 11481

Re: WebREPL and uasyncio

In Python (Cpython and MicroPython) while a program is running the REPL is inactive. You can interrupt execution with ctrl-C but any other typing is ignored. In this respect a uasyncio program is no different from any other. Hi Peter, Are you able to expand on this a little bit please, there are so...
by p_j
Thu Aug 04, 2022 8:15 am
Forum: General Discussion and Questions
Topic: WebREPL and uasyncio
Replies: 9
Views: 11481

Re: WebREPL and uasyncio

I don't fully understand the mechanics of it but you are correct, you can't use the REPL/WEBREPL while a uasyncio event loop is running.

For your case I would use a software WDT to put the chip in deepsleep

https://github.com/peterhinch/micropyth ... oft_wdt.py
by p_j
Thu Aug 04, 2022 7:15 am
Forum: Development of MicroPython
Topic: Updating a MicroPython Firmware
Replies: 10
Views: 42454

Re: Updating a MicroPython Firmware

Do you have your own server that you can use? Are you developing on a windows or linux machine? I am developing on Windows , and I don´t have my own server . You could use a low cost/free AWS server or S3 storage to host the firmware however if you are just testing you can host it on your home netw...
by p_j
Wed Aug 03, 2022 11:18 am
Forum: General Discussion and Questions
Topic: Using local time with Pico W
Replies: 17
Views: 53750

Re: Using local time with Pico W

Yes here it is, it works like 1 time out of 20 this morning... no idea why, wifi seems solid, wlan status is ok: main.py : time.localtime(ntptime.time() + 946684800) (2022, 7, 16, 17, 25, 50, 5, 197) ntptime.py : try: import usocket as socket except: import socket try: import ustruct as struct exce...
by p_j
Wed Aug 03, 2022 12:29 am
Forum: General Discussion and Questions
Topic: Using local time with Pico W
Replies: 17
Views: 53750

Re: Using local time with Pico W

I think I have found a way to make it work, but I keep getting this error (not every time): OverflowError: overflow converting long int to machine word I'm stuck on that, even if I try to reduce the length it doesnt seem to change the issue Whenever I dont get overflow I get this error: OSError: [E...