Running webserver and other code simultaneously

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
User avatar
Posts: 3247
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: Running webserver and other code simultaneously

Post by pythoncoder » Tue Jun 05, 2018 6:55 am

You can indeed precompile code with mpy-cross and copy the .mpy file into your filesystem. This works fine but is something I seldom use because all it saves on the target is the compilation phase. It doesn't save RAM at runtime. Its main use is where you have a module which is too large to compile on the target but not too large to run without freezing. I've used it then because the turn-round time is much faster than the compile-link-flash cycle for frozen bytecode.

It can also save time if you have a module you want to run as soon as possible after boot, but this is rather a niche situation.
Peter Hinch

Post Reply