I have built a webthing-python that interacts with GPIO over MRAA framework.
Calling a funcition by interrupt is supported my MRAA and documented here.
The problem is that it automaticaly creates a new thread and im not able to get out of that.
I added log atributes and it now looks like this:
format='%(asctime)s '
'%(filename)s:'
'%(lineno)s '
'%(processName)s '
'%(process)d, '
'%(threadName)s '
'%(thread)d, '
'%(module)s, '
'%(funcName)s, '
'[%(levelname)s] '
'%(message)s'
Copy of four lines:
2020-11-07 13:33:48,902 pwm-thing.py:382 MainProcess 29686, MainThread 2013261444, pwm-thing, get_motion, [DEBUG] currently [<_MainThread(MainThread, started 2013261444)>] are active while 1 are active and we are in <_MainThread(MainThread, started 2013261444)>
2020-11-07 13:33:49,020 pwm-thing.py:590 MainProcess 29686, MainThread 2013261444, pwm-thing, run_server, [INFO] starting the server
after run_server() and interrupt call:
2020-11-07 13:34:40,927 pwm-thing.py:393 MainProcess 29686, Dummy-1 1999891816, pwm-thing, interrupt_call, [DEBUG] currently [<_MainThread(MainThread, started 2013261444)>, <Engine(zeroconf-Engine, started daemon 1999748456)>, <Reaper(zeroconf-Reaper, started daemon 1999605096)>] are active while 3 are active and we are in <_DummyThread(Dummy-1, started daemon 1999891816)>
2020-11-07 13:34:40,929 pwm-thing.py:396 MainProcess 29686, Dummy-1 1999891816, pwm-thing, interrupt_call, [DEBUG] interrupt_call
Is there some python wizard here that can help me get back to the Tornado MainThread where webthing-python lives in?