Provided neither Nginx and Gunicorn are used, are the hardware specs of the Pico enough to handle a very simple flask app? Also, does the Pico's MicroPython support flask? If not, how can I simulate such behavior on the Pico?
2 Answers
No, even putting the severely under powered CPU and lack of dependency support aside, the 264KB of onboard ram is nowhere close to enough to run a flask server. Just importing flask into python takes over dozen megabytes of ram.
If you needed something very light and inexpensive to do this you would be much better off getting a Raspberry Pi Zero W.
-
1Thanks for the answer. Is it possible to make the pico handle HTTP requests then by any means? Maybe socket programming? Feb 13, 2021 at 14:23
-
1You probably could with some very basic c program and the right peripherals to connect it to a network. However, I still would not consider this idea because this will be much more challenging, much less capable, and even potentially more expensive when factoring in the external parts required. This is probably only a good idea when you need to remotely communicate with your device, for anything else including serving HTTP requests you should just stick with a normal Raspberry Pi. Feb 13, 2021 at 18:25
I'm using an automation 2040w board
Have a look here.
This has allowed me to run code remotely from a url in browser or with python requests module
requests.get("http://{IP}/?relay=on")
-
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotApr 25 at 16:56
-
It seems unlikely after 2 years that the poser will change their hardware; they probably already have.– KDMApr 30 at 8:10