9 Replies Latest reply on Mar 13, 2014 5:44 PM by dtung

    Web Server on Galileo


      Just to get people motivated a bit:


      My Galileo is now a stand-alone web server running Ruby on Rails. This gives web based access to Arduino shields.


      It would be really nice to have a distribution we could download packages from - and I really miss apt-get.

      But we do have wget and gcc in the tools build, and most packages can be downloaded from source.


      I am not good on Python, so Ruby is my interpreter of choice. It may have been available in the Yocto distribution, but I did not see it.

      The Ruby 2.0.0 source tarball is downloadable from MIT, and builds really smoothly on the Galileo.

      Git was installed the same way - we all need a source control program.

      With Ruby in place, we also have "gem install rails" to bring in the web server.


      Nice thing about Rails is that less than a minute after the install, I have a working web server accessible from anywhere on my network that provides useful configuration information from my running system.


      Now to get some of those Arduino sketches converted, running from the web, and accessing Arduino shields...

        • 1. Re: Web Server on Galileo
          Michal Pawlowski

          Nice work. I'm getting into yocto and baking my own images so if I figure out the way how to include ruby on the board, I'll let you know.

          Keep us posted on your Arduino <-> ruby bridge

          • 2. Re: Web Server on Galileo

            hi rmm200,

            Is your ruby on rail running with reasonable performance? How much percentage of CPU power and memory it used when running?

            • 3. Re: Web Server on Galileo

              There's a recipe in one of the default layers. I haven't tried to compile it, but chances are it will compile.


              Just find what the layer name is with "find . -type d -name '*ruby*'", add the path to yocto_build/conf/bblayers.conf if not there, then run bitbake ruby and install the resulting package using opkg (or add to image by modifying local.conf).

              • 4. Re: Web Server on Galileo

                My Ruby on Rails takes about 30 seconds to initialize. It takes about 5 seconds for a client to connect and get the initial web page (file attached). Performance seems very good to me. I don't have any metric tools installed, so I can't tell you anything about cpu percent busy or memory utilization. Best thing to me is reliability. "uptime" has been as high as ten days between boots, and even then it was me booting. I don't think I have had a crash since I installed 0.8.0.

                • 5. Re: Web Server on Galileo
                  Michal Pawlowski

                  Just managed to customize the image for galileo by adding ruby 1.9.3 to it. See this quick and dirty writeup of how to do this Customizing what goes onto yocto image

                  • 6. Re: Web Server on Galileo

                    Out of curious, I also git clone the openembedded recipes. After comparison, I find Intel's clanton distribution has included a meta-oe folder, which pretty much has duplicated the recipes in openembedded. Specifically, as Alex pointed out, the ruby recipe is included in meta-oe. (but I haven't tried to compile it.)


                    For people playing Linux on Galileo, eventually you will encounter a package you needed but can not find a recipe anywhere. More fundamental question seems to be on how to create a new recipe from scratch, or at least compile a package on the sideline and then merge into yoctco image. But that is totally another question. In the mean time, compile a missing package on Galileo directly seem to be a more straight way to go.

                    • 7. Re: Web Server on Galileo
                      Michal Pawlowski

                      meta-oe from OpenEmbedded repo seems to be a lot larger than one supplied with intel iot layer, but maybe you are referring to a different intel layer?

                      As for ruby, it compiles fine, but agree that it is unproductive to rebuild image every time you need to add something to it. The solution seems to be Yocto Project Development Manual but I didn't play with it yet. Anybody tried it?

                      If you have ability to compile sources on Galileo, that's by far the easiest way (unfortunately my image doesn't have compilers on board). Where did you get your image from?

                      As for creating a new recipe, here is a good read Yocto Project Development Manual

                      • 8. Re: Web Server on Galileo

                        The distribution I got is Board_Support_Package_Sources_for_Intel_Quark_v0.7.5. I use "du -h meta-oe" to check the size of the meta-oe folder of this distribution, which is 17M. While I use "du -h meta-openembedded" to check the cloned folder, it shows the size to be 16M.


                        But I follow the document you referred and find this link OpenEmbedded Metadata Index - layers , which includes more recipes (lots of them are platform related.). I find under OpenEmbedded Metadata Index - openembedded-core the expect package I tried to build few days ago. I will try to compile it and then build  the image under Yocto project later.


                        I open expect's .bb file and find it is much more complicate than I thought. I just compiled the package on Galileo yesterday, it seems to be not much more than ./configure && make && make install, after it finding the right header and library files. Anyway, enough material for me to persuade on.  

                        • 9. Re: Web Server on Galileo

                          After building an image with Luby (version 1.9.3), I tried to install rails, but it gave me an error because of unable to include some file or find some library. This is the same type of problem keep happening when I try to compile or install a new package in Galileo board (the part I don't like about this board).


                          So I did what rmm200 suggested to compile a new Luby tarball, then "gem install rails" works, even though it took me half day to compile and install everything.