What I want to achieve is:
The majority of my project will still be in C and ESP-IDF, like the network and all the hardware stuff. But some functions will be written in python and interpreted in runtime. So users can change those function in runtime by editing the python script via web browser. This does not require update the firmware or even reboot the board.
After researching, it looks like MicroPython can achieve this. Since it can do REPL.
After reading the micropython/ports/esp32/main.c, my guess was to use this as my base project and remove the mp_task .
Then uses the pyexec_file_if_exists("main.py"); to execute my python code. (There are no hardware related calls in the script)
Is this the right way? Anything in mp_task can must be called before pyexec_file_if_exists("main.py");
And most importantly how can I exchange data between C and the python script?
Thank you very much.
