[yocto] Web frameworks on embedded linux

Nikolay Dimitrov picmaster at mail.bg
Fri Nov 14 09:33:19 PST 2014


Hi Edward,

On 11/14/2014 07:10 PM, Edward Wingate wrote:
> On Fri, Nov 14, 2014 at 12:13 AM, Maciek Borzecki
> <maciej.borzecki at open-rnd.pl <mailto:maciej.borzecki at open-rnd.pl>> wrote:
>
>     On czw, 2014-11-13 at 23:12 -0800, Edward Wingate wrote:
>     > 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.
>     Have you installed python-modules pacakge? This package pulls in all
>     standard python modules as dependencies.
>
>
> No, I haven't.  I still have a lot to learn about Yocto and recipes.  I
> went ahead and pulled python-modules in and and got a lot further in
> making this app work.  Thanks, Maciek, for your help.
>
> The ramdisk image ballooned to 22MB though.  It's expected, but due to
> flash size constraints, Python may not be an option in this case.
>
>     I've used Tornado to provide a REST-ful API for an Android application
>     and some basic web pages with status information and so on. Worked
>     quite well.
>
>
> Do you remember what your final ramdisk image size was?
>
> I would still love to hear what web frameworks others here have used on
> embedded linux.

I remember that before several years we worked on a prototype, that had
to deliver dynamic content over ethernet. It had to run on ARM board,
first with QNX and later with Linux. We then found a small web-server,
Mongoose (https://code.google.com/p/mongoose/), which had good license,
was lightweight, with very few dependencies, and had very clean
interface for extending (actually looking at the license, its now GPL,
but I remember that the older versions were licensed under MIT or BSD).

As far as I rememer, the whole thing boils down to registering a
callback, which is called each time you have to service a HTTP request.
We used this to write multiple small extensions in C that generated the
dynamic content, each plugins was responsible for a separate domain of
functionality. It sounds strange to do this in C instead of
higher-level language, but once you start seeing your memory usage to
be in KBytes instead of MBytes range, you start to like this little
component :D.

You can give it a spin, it builds easily for x86 and arm.

Regards,
Nikolay



More information about the yocto mailing list