You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setting up a webserver providing graphs of logged data from SD card - a few times a day, in a scheduled context
mqtt listen for data and log data on SD card - every 10 mins, using Timer interrupt for calling non blocking check
Working ok after one day test.
What can happend - with both tasks running without disabling/ protection ?
Are the better ways?
Br /Stefan
# setting up a web server using:
srv.setsockopt(socket.SOL_SOCKET, 20, cln_handler) # register
# and subscribe to mqtt for logging on SD card using
class cb: # take care of first argument ()
def chk(self):
print('check_msg')
client.check_msg() # non blocking
cb1= cb()
from machine import Timer
tim1 = Timer(1)
tim1.init(mode=Timer.PERIODIC, period=10000, callback=lambda t:cb1.chk())
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Two assyncronous tasks in one script.
setting up a webserver providing graphs of logged data from SD card - a few times a day, in a scheduled context
mqtt listen for data and log data on SD card - every 10 mins, using Timer interrupt for calling non blocking check
Working ok after one day test.
What can happend - with both tasks running without disabling/ protection ?
Are the better ways?
Br /Stefan
Beta Was this translation helpful? Give feedback.
All reactions