Direction Needed for Structuring a Script #13457
Unanswered
Chris-24MAY60
asked this question in
ESP32
Replies: 2 comments
-
Look into using |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you, Ned,
I've noticed Peter has helped many. It isn't so much that I need to be
told what to see - as I could use being shown where to look. This sounds
like a great place you gave me to look.
Chris
…On Wed, Jan 17, 2024, 11:38 AM Ned Konz ***@***.***> wrote:
Look into using asyncio. Microdot v2 uses asyncio. Couple this with
asyncio.StreamReader(uart). See Peter Hinch's excellent tutorial and
code: https://github.com/peterhinch/micropython-async
—
Reply to this email directly, view it on GitHub
<#13457 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF7CHS4V5CJWTTICQOHHGMDYPAD7RAVCNFSM6AAAAABB6ZHANSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DCNJZHA4TQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am using an ESP32S3 to read uart data and condition it, using some computations, to be written into various files. The files contain values that will serve as meta-data to update some html files - to be served, via URL requests - to mobile devices. I have a Microdot server function (app) working beautifully to serve the various html and csv files. I also have the uartprocessing function working swimmingly. But I can't figure out how to pass control back & forth between the two functions. I (think) I would like the server to run for, say 2 seconds, then suspend its operation, (but not drop the port!) handing control to the uart_processing function, (which only needs tens of milliseconds to update any new uart data) ideally then handing-back control to the server function , which resumes serving .....and so back & forth it goes. I am guessing that "suspending" server operation may not be the conventional or preferred approach - since then it hinges on the URL request to keep pending. I haven't any experience with sharing files, locking files, sequential-vs-simultaneous operation of functions- and so am looking for guidance or best practices. I am a little surprised I'm struggling so!
Beta Was this translation helpful? Give feedback.
All reactions