[yocto] Web frameworks on embedded linux

Edward Wingate edwingate8 at gmail.com
Thu Nov 13 23:12:28 PST 2014


I've been trying to get an existing python flask application running on an
embedded linux distro (Poky).  The web app was originally deployed on a
Debian distro.  I need to move the application to a less heftier board
and wanted to try a distro created by Yocto, rather than try to pare down
Debian.

I've been following the chain of dependencies for the web application and
adding them to Yocto to try and get the app to work (nginx, uwsgi, python,
pyserial, etc.), and hit a bump - Python's built-in logging and codecs
modules are not provided by Yocto.  Maybe I can add them myself, or maybe
I'll rip them out of the application, but I wanted to take a step back and
see if maybe Python/Flask is not the best app framework to use in an
embedded linux distro.

CPU is not a problem.  This board has ARM Cortex A9 processor running at
667MHz.  RAM should be OK as well at 512MB, but I am limited by the 32 MB
flash size on the board. I started with core-image-minimal on Poky (which
was ~3MB), and I'm up to almost 8MB now.  I guesstimate that I'm maybe 50%
of the way along the dependency chain. I haven't even gotten to flask yet,
just the webserver, uwsgi and plain python.  The size I'm referring to is
just the ramdisk image, not including FSBL nor u-boot (which are minimal
and shouldn't grow much, if at all, at this point).  I don't know what I'll
eventually end up at, but I do have to share the 32MB flash with other
data; it's not dedicated to the OS/Linux.  How much space the OS gets is
still up in the air.  I'd say at least 16 MB and maybe as much as 20-24 MB.

While it would be nice to reuse the already written web application, if the
Python/Flask stack turns out to be too heavy, a port/rewrite is not out of
the question.  This application just displays a web frontend to get/set
values on a device over a serial port.

So I wanted to get the list's thoughts and experience on:

1) Web application frameworks to use with an embedded linux constrained by
image size.  How well supported by Yocto recipes is the framework?  I've
been intrigued by the Lua language and the Kepler/Orbit web framework for
Lua, but except for Lua, there doesn't appear to be Yocto recipes for them.


2) Python modules that Yocto doesn't provide recipes for, like logging and
codecs modules.  How difficult is it to augment python-core?  Is it just a
matter of adding your own recipe in your own layer? Logging and codecs is
normally a part of a default Python install, so not sure yet how I would go
about adding this.

Thanks for your help.

Edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20141113/e4d9ec67/attachment.html>


More information about the yocto mailing list