Seeking Script Structuring Guidance for Web Appliance #13460
Unanswered
Chris-24MAY60
asked this question in
Using MicroPython
Replies: 1 comment 1 reply
-
Hi |
Beta Was this translation helpful? Give feedback.
1 reply
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 MicroPython on 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 uart_processing 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