Xeroxxx
Posts: 3
Joined: Mon Apr 08, 2013 9:07 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Mon Apr 08, 2013 10:59 pm

Hey,
Source Code: https://code.google.com/p/runuo/source/ ... ersistence

Its working fine on x86/x64. It happens everytime the server trys a "world save".

Seems to be a problem with the "save" file. 3 empty files are created then he crashes.

protected void SaveMobiles(SaveMetrics metrics) in StandardSaveStrategy.cs is creating the files.

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Mon Apr 08, 2013 11:23 pm

I looked through the source code and the backtrace you provided and the problem appears to be an issue with the code being run, not the mono runtime. You can confirm this by running it on soft-float wheezy with the distro provided mono (you should see the same error).

You may wish to use monodevelop on a PC to compile and *remote* debug the application running on the Pi. See this link for more info: http://www.raspberrypi.org/phpBB3/viewt ... ug#p295172

6677
Posts: 382
Joined: Wed Mar 14, 2012 9:23 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Wed Apr 10, 2013 9:06 pm

I will have to try this ASAP although I already installed mono-complete.

How would I uninstall that first before trying this out?

jaytee
Posts: 7
Joined: Sat Dec 24, 2011 9:56 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Wed Apr 10, 2013 9:10 pm

Thanks for this - it seems to work OK for what I am doing - well at least the DateTime structure works properly now.

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Wed Apr 10, 2013 10:58 pm

To uninstall mono-complete package:

Code: Select all

sudo apt-get remove mono-complete
Be aware that installing *any* distribution provided package that has mono as a dependency will cause mono to be installed again.

Alex111
Posts: 32
Joined: Sun Oct 07, 2012 6:56 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Thu Apr 11, 2013 11:56 am

I'm really very happy that there is a working version now!!! But have some question for using mono in long term:

Is it possible to merge this version into the official mono repository?

Also would it be possible include the changes also in the latest mono version 3?

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Thu Apr 11, 2013 6:56 pm

Is it possible to merge this version into the official mono repository?

Also would it be possible include the changes also in the latest mono version 3?
This patch for this version of Mono contains code that is copyright Sony and myself, licensed under the GPL2. It will not be accepted upstream without reassigning that copyright to Xamarin.

I originally looked at patching 3.x, but enough has changed that it would require substantially more effort. Since the result would not be accepted upstream, I saw no point in continuing.

Chriso
Posts: 2
Joined: Thu Apr 11, 2013 9:42 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 12, 2013 6:50 am

Please test this application with mono.
It only just try to open selected serial port.
It raises error:

Code: Select all

System.EntryPointNotFoundException: is_baud_rate_legal
The essential point of code [file Form1.cs] is:

Code: Select all

sp = new SerialPort(comboBox1.Text, 115200, Parity.None, 8, StopBits.One);
                label3.Text = "Opening " + sp.PortName + "...";
                Application.DoEvents();
                sp.Open();
                label3.Text = "Opened " + sp.PortName;

Application crashes at line with sp.Open();
Info about System:

Code: Select all

>uname -a
Linux alarmpi 3.6.11-8-ARCH+ #1 PREEMPT Sat Mar 9 00:38:58 UTC 2013 armv6l GNU/Linux

>mono --version
Mono JIT compiler version 2.11.4 (tarball Thu Mar 14 14:32:54 CDT 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. http://www.mono-project.com
    TLS:           __thread
    SIGSEGV:       normal
    Notifications: epoll
    Architecture:  armel,vfp(hardfp-abi)
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            Included Boehm (with typed GC and Parallel Mark)
Attachments
SerialTest.zip
(20.74 KiB) Downloaded 256 times

Alex111
Posts: 32
Joined: Sun Oct 07, 2012 6:56 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 12, 2013 2:24 pm

I originally looked at patching 3.x, but enough has changed that it would require substantially more effort. Since the result would not be accepted upstream, I saw no point in continuing
Any Chance that there ever will be a mono 3 for the pi? Maybe directly from Xamarin, or maybe you can talk to Xamarin about the Copyright?

Alex

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 12, 2013 5:19 pm

Please test this application with mono.
I downloaded the .zip file to my Pi running Raspian.

Code: Select all

uname -a
Linux raspberrypi 3.6.11+ #397 PREEMPT Mon Mar 18 22:17:49 GMT 2013 armv6l GNU/Linux
From a terminal in X11, I executed

Code: Select all

sudo mono SerialTest.exe
I then chose "/dev/ttyAMA0" as the port and the status changed to "Opened /dev/ttyAMA0". No errors were reported.


The reason for your error is probably due to your distribution not setting up /usr/local/lib in the LDCONFIG path:
System.EntryPointNotFoundException: is_baud_rate_legal
https://github.com/mono/mono/blob/maste ... am.cs#L317

which in turn calls
https://github.com/mono/mono/blob/maste ... ial.c#L171

which is in the file
/usr/local/lib/libMonoPosixHelper.so

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 12, 2013 5:37 pm

Any Chance that there ever will be a mono 3 for the pi?


Anything is possible. However, as stated in another thread, I do not believe it to be a priority for them since they do not make any money off the Pi.
Maybe directly from Xamarin, or maybe you can talk to Xamarin about the Copyright?
Mono is now the financial foundation for a company (Xamarin). As of the date of this post, they charge a minimum of $300 per developer per year. Its hard pressed to find anyone willing to write code for their now commercial offering for free. They can license the code changes from Sony if they wished, but that would probably result in a $300/dev/year fee for use on the Pi.

Alex111
Posts: 32
Joined: Sun Oct 07, 2012 6:56 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 12, 2013 6:45 pm

Mono is now the financial foundation for a company (Xamarin). As of the date of this post, they charge a minimum of $300 per developer per year. Its hard pressed to find anyone willing to write code for their now commercial offering for free. They can license the code changes from Sony if they wished, but that would probably result in a $300/dev/year fee for use on the Pi.
I fear I do not understand? Does this also mean that it is expected that mono will not be free in the future? Especially for future versions of mono?

6677
Posts: 382
Joined: Wed Mar 14, 2012 9:23 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 12, 2013 7:19 pm

Mono itself is free.

The iOS and android ports are the paid for versions. They are also the versions which would require substantial modification from existing versions. That said, with regular mono being open source software there is a community made fork for android somewhere but I dont know how well it works.

Infact its because monotouch and monodroid (iOS and android ports respectively) are paid for software that the unity game engine also charges for the iOS and android licenses (as unity uses mono)

Chriso
Posts: 2
Joined: Thu Apr 11, 2013 9:42 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 12, 2013 7:52 pm

OtherCrashOverride wrote:
The reason for your error is probably due to your distribution not setting up /usr/local/lib in the LDCONFIG path:
System.EntryPointNotFoundException: is_baud_rate_legal
https://github.com/mono/mono/blob/maste ... am.cs#L317

which in turn calls
https://github.com/mono/mono/blob/maste ... ial.c#L171

which is in the file
/usr/local/lib/libMonoPosixHelper.so
after add /usr/local/lib to ldconfig port opening works.
In Arch linux I created new file mono.conf in /etc/ld.so.conf.d/ with only one line: /usr/local/lib/
And execute: ldconfig to update linkbindings.
But window with options now not opening. Config must be edited manually, like in Raspbian

User avatar
eried
Posts: 89
Joined: Mon Apr 15, 2013 2:11 am
Location: Chile

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Mon Apr 15, 2013 7:48 am

Thanks for this, I installed it and I will run some tests on a console app I wasn't able to get working on the apt-get available version
My website: www.ried.cl

zhangster
Posts: 5
Joined: Tue Mar 19, 2013 4:14 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Mon Apr 15, 2013 9:44 am

For those of you interested in getting this version of mono to run with apache, put this in your httpd.conf (or 000-default in sites-enabled).

Code: Select all

<IfModule mod_fastcgi.c>
  Alias /mono.fastcgi /usr/local/bin/fastcgi-mono-server4
  AddHandler mono-script .aspx .asmx .ashx .ascx .asax .axd .config .cs
  FastCGIServer /usr/local/bin/fastcgi-mono-server4 \
 -idle-timeout 300 \
 -socket /tmp/fastcgi-mono-server \
 -initial-env PATH=/bin:/usr/bin:/usr/local/bin \
 -initial-env LD_LIBRARY_PATH=/usr/local/lib: \
 -initial-env MONO_SHARED_DIR=/tmp/ \
 -initial-env MONO_FCGI_LOGLEVELS=Standard \
 -initial-env MONO_FCGI_LOGFILE=/tmp/fastcgi.log \
 -initial-env MONO_FCGI_ROOT=/var/www \
 -initial-env MONO_FCGI_APPLICATIONS=/net:/var/www/net
  Action mono-script /mono.fastcgi virtual
</IfModule>
you might also need to install libapache-mod-fastcgi via instructions on this page:
http://raspberryserver.blogspot.com/201 ... p-fpm.html

enjoy! :D

JakeSays
Posts: 2
Joined: Mon Apr 15, 2013 2:26 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Mon Apr 15, 2013 2:29 pm

Is there a patch set available? I'd like to take a look at the changes you made to make this work.

milasch
Posts: 3
Joined: Tue Oct 23, 2012 12:48 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Mon Apr 15, 2013 3:55 pm

Thanks a lot for it @OtherCrashOverride!!!!!

For those interested in archlinux PKGBUILD:

Code: Select all

pkgname=mono
pkgver=2.11.4
pkgrel=1
pkgdesc="Free implementation of the .NET platform including runtime and compiler for ARMV6 with hardfloat support provided by OtherCrashOverride. See: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=34&t=37174"
md5sums=('278564315af9223198b83b36a9aafdb1')
source="https://www.dropbox.com/s/sask17flot3zqlg/mono_2_11_4_armv6hf_binary.tgz"
arch=('any')

package() {
        cp -R ${srcdir}/usr ${pkgdir}
}
It's very basic, it doesn't build from src, but at least it allows you to pkg it and to install/uninstall it with pacman.

To use it, make sure you have a working makepkg environment (see: https://wiki.archlinux.org/index.php/AU ... ng_started), and then simply create the file PKGBUILD with the contents above into some directory and then issue makepkg, then install it with pacman. For example

Code: Select all

$ mkdir -p ~/dev/mono-2.11
then place the PKGBUILD in there, then package it, then install it:

Code: Select all

$ cd ~/dev/mono-2.11
$ makepkg
this will take a little time if you're doing it on the raspberry, but I guess you could use your PC archlinux installation if you have any. after it's done, install it with a root user, or sudo if you have it setup:

Code: Select all

# pacman -U mono-2.11.4-1-any.pkg.tar.xz

User avatar
eried
Posts: 89
Joined: Mon Apr 15, 2013 2:11 am
Location: Chile

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Mon Apr 15, 2013 5:04 pm

Nice! It worked for me, thanks.

At first glance I was getting errors about the serial ports, but then I installed mono-complete and then uncompressed the tar.gz file posted on this topic and everything worked nicely now. Serial communication, datetime, etc.

Image
My website: www.ried.cl

bema
Posts: 2
Joined: Wed Mar 20, 2013 8:17 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Thu Apr 18, 2013 9:36 am

so to make everything work your just did the following?

Code: Select all

apt-get install mono-complete
wget https://www.dropbox.com/s/sask17flot3zqlg/mono_2_11_4_armv6hf_binary.tgz
cd /
sudo tar zxvf /home/pi/mono_2_11_4_armv6hf_binary.tgz

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Thu Apr 18, 2013 10:07 am

I strongly advise against installing the distribution provided mono package. It sets up many things to point to the broken version of mono in addition to having two Global Assembly Caches (GAC). The serial port works with this hardfloat version of mono without any distribution provided mono packages (see posts earlier in this thread)

Edit: FYI, libgdiplus is a standalone package and does not depend on mono in Rasbian. For this reason it can be installed from apt-get without causing the distribution provided mono version to also be installed.

Edit2: For best results, use the latest version of Rasbian from the official download page. As noted in previous posts, other distributions may require additional setup.

bema
Posts: 2
Joined: Wed Mar 20, 2013 8:17 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Thu Apr 18, 2013 2:08 pm

Thank you very much!
I just installed your patch with:

Code: Select all

wget https://www.dropbox.com/s/sask17flot3zqlg/mono_2_11_4_armv6hf_binary.tgz
cd /
sudo tar zxvf /home/pi/mono_2_11_4_armv6hf_binary.tgz
as well as:

Code: Select all

apt-get install libgdiplus 
By now everything works fine :)

am I allowed to do an

Code: Select all

apt-get update && apt-get upgrade
in the future or will this break something with the mono version?

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Thu Apr 18, 2013 8:37 pm

You can upgrade and install distribution provided packages as normal with
sudo apt-get update
sudo apt-get upgrade
The only care that needs to be taken is that you do not install a new package that depends on mono. This will cause apt-get to install the distribution provided mono package that is broken.

Ideally the distribution provided mono packages should be blacklisted on your Pi so that they do not get unintentionally installed. Perhaps someone else could provide detailed instructions for doing this for the various package managers and distributions.

6677
Posts: 382
Joined: Wed Mar 14, 2012 9:23 pm

Re: Mono (C#) 2.11.4 hard-float for Raspberry Pi (EXPERIMENT

Fri Apr 19, 2013 11:07 pm

I still havent gotten around to testing this.

Waiting on a USB>TTL serial adaptor in the mail. I assume in mono I can actually access the serial on the GPIO strip with the default classes?

Code: Select all

using System;
using System.IO.Ports;

namespace Serial
{
    class Program
    {
        static void Main(string[] args)
        {
            SerialPort port = new SerialPort("COM1", 9600);
            port.Open();
            port.Write("write");
            port.Close();
        }
    }
}
Something like that should work right?
On that note, COM1 is of course windows, what would the equivalent be for the GPIO based serial under raspbian?


Return to “Other programming languages”