New user, question about script running in the background
Posted: Mon Jul 24, 2017 11:22 pm
Hi, I'm a new user.
I received my esp recently and flashed micropython on it. After about a week of reading the forum, it's working great: I got working telnet and ftp servers made by other users (thanks) and could write some scripts to save my external ip to a server, and to gather some info from my router about who is connected to the network.
However one last step I couldnt understand yet, it's how to make my script run in the background. I know, there is the uasyncio module, and I have tried to learn with the examples and with the tutorial, but so far I can't understand it. What i want to do seems to be simple: there is a loop like this:
while True:
time.sleep(3600)
function.start()
Which I run on main.py. I would like to have it run in the background, so that I can access the REPL without having to press control-C and interrupt this loop.
Can anyone help me?
I received my esp recently and flashed micropython on it. After about a week of reading the forum, it's working great: I got working telnet and ftp servers made by other users (thanks) and could write some scripts to save my external ip to a server, and to gather some info from my router about who is connected to the network.
However one last step I couldnt understand yet, it's how to make my script run in the background. I know, there is the uasyncio module, and I have tried to learn with the examples and with the tutorial, but so far I can't understand it. What i want to do seems to be simple: there is a loop like this:
while True:
time.sleep(3600)
function.start()
Which I run on main.py. I would like to have it run in the background, so that I can access the REPL without having to press control-C and interrupt this loop.
Can anyone help me?