Click here to Skip to main content
15,896,359 members
Articles / All Topics

Running the GA Framework on a Raspberry Pi using Mono

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
7 Aug 2017MIT 3.5K  
Running the GA Framework on a Raspberry Pi using Mono

It’s hard to ignore Mono these days, and like many I have played around with it using Xamarin Developer. However, my excitement grew when I noticed that Mono now supports the Hardware Floating Point of the Raspberry Pi, meaning that I can now write/re-use C# code on my collection of Raspberry Pis running Rasbian.

Assuming Debian/Raspian, the following command adds the latest version of Mono to the Pi.

$ sudo apt_get install mono-complete

Once this has completed, the following command will confirm the installation.

$ mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

To test the mono installation, I simply copied the Visual Studio 2013 compiled binaries (TravelingSalesman.exe and GAF.dll) from the Traveling Salesman example project to the Raspberry Pi. Using the SCP command using the Mac Terminal program, I simply navigate to the bin folder where the binaries live and execute the scp command to copy the files over. I used the Mac Terminal program, but any SSH client should work.

$ scp *.exe pi@10.0.1.66:mono
$ scp *.dll pi@10.0.1.66:mono

Once the copy is complete, all that is required is to run the EXE on the Raspberry Pi, e.g.:

$ mono TravellingSalesman.exe

The results are shown below:

GAF on Raspberry Pi 2

To see a .NET managed library, compiled for Windows, running perfectly on a Raspberry Pi is awesome.

This article was originally posted at https://glasstty.com/2015/02/07/80

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
United Kingdom United Kingdom
John is the author of the free Genetic Algorithm Framework for .Net (GAF) and the series of GeoUK NuGet packages. John studied at Leicester De Montfort University and gained a Distinction for the highly regarded Masters Degree in Computational Intelligence and Robotics. John can provide commercial product support for the GAF or GAF based projects and can be contacted via the Code Project, LinkedIn or the usual social channels.

Comments and Discussions

 
-- There are no messages in this forum --