OpenSIM + Raspberry Pi + Rasbian Hard-Float= WORKs!

OpenSim + Raspian hard-float = What was once broken now works!

A while ago I decided to go into a journey of OpenSim because I liked working offline from SecondLife and I like keeping a backup of my stuff. It’s good to have backups in the event Linden Labs completely fails you. Anyhow! In my past blog about the Raspberry Pi I talked about how I must have fried my Pi from running quake 3 on it overclocked like crazy, and it still maybe the case! but for now I’m not going to use my Pi for accessing it’s GLES capabilities but instead use it to act as a server for OpenSim. Because I do not know the learning curve of the average Pi or OpenSim User; I should note that this guide is going to a bit long and has bits from installing OpenSim as well as compiling all of the sources needed to get OpenSim functioning properly.

Instruction.

When you look at the server specs for OpenSim and what they suggest would be a good server for OpenSim. You would be quick to notice that your average spec for a island sim is about 2Ghz of CPU power and 1GB of ram. I later found out that the programming language Mono which OpenSim is based around really likes multi-core processors. So suddenly a raspberry Pi 2 becomes a very workable unit. To those which are still rocking the single-core Raspberry Pi A or B+ you’ll find that running OpenSim works but will be very slow as physics/scripting/assets are all being bounced off of just that one armv6 700Mhz processor.

My Raspberry Pi operating in semi-headless mode.

 

When I first tried OpenSim a long time ago. I ran into roadblock after roadblock. Eventually finding out that you cannot install MONO onto a raspberry Pi which is running hard-float from the Debian libraries. You either had to run Wheezy or Pidora in soft-float mode. Which in soft-float everything feels like your running on a 300Mhz Pentium II desktop! It’s painfully slow.

Until now!

But First! Lets do the basics and update your Pi!

sudo apt-get update

sudo apt-get upgrade sudo ldconfig sudo apt-get install libgdiplus

Use MySQL instead of OpenSim SQL-Lite!

After a bit of usage on my Pi I noticed I was getting a lot of file not found errors flying on my console just by simply camera panning in and out on my phoenix/firestorm viewer. It seemed like the hyper experimental Mono compile is simply having issues looking up null table references. It didn’t effect moving around the sim. Once again this was an annoyance. So understanding that the build of Mono I have is experimental. The goal is to take as much as you can out of the hands of the Mono development language so that OpenSim runs smooth and stable.

sudo apt-get install mysql-server

It’s going to queue you for the root password for MySQL. This is really important to write this down! We will need it later in the chapter!

We’re going to create the initial opensim database for it to use and generate a userid “opensimuser” within MySQL with the password “opensimpassword”. I prey you use something slightly more original then these user/pass.

$ mysql -u root -p
Enter password:
mysql> create database opensim;
Query OK, 1 row affected (0.00 sec)
mysql> use opensim;
Database changed
mysql> create user 'opensimuser'@'localhost' identified by 'opensimpassword';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all on opensim.* to 'opensimuser'@'localhost';
Query OK, 0 rows affected (0.01 sec)
mysql> quit

Mono Language installation onto your Pi.

Update 10/19/2015

The Command:

apt-get install mono-complete
mono --version

Your Mono will report with the following information:

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

This is a start to get you up to at least version 3.2.x. However, this is no longer an effective means of getting OpenSim or OSGrid stable. Mono version 3.2.x works fine in stand-alone mode but when you run it in hypergrid or region mode with other servers you’ll quickly find out that people can teleport into your region but can’t teleport out.

Doing a bit of reading about how mono v3.2.8 came to be on Debian Wheezy and the Raspberry Pi community the person porting it states that it was “Mostly” working. OpenSim/OSGrid is really not the kind of program you want to say “Mostly” with because weird things occur such as my teleportation on OSGrid error blog.

Upgrading from Mono 3.x to mono 4.x

The good folks at Mono-Project have not only compiled a version of 4.0 for debian wheezy but made a sub-compilation for Armv7 processors. This is fantastic news for people like me which have a Banana Pi or people that have Raspberry Pi 2’s. To get the latest version following their Linux installation instructions you pass the following commands onto your Pi.

 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get upgrade

If you are getting the following errors stating that Mono 4.0 packages are being “held back” then WITH EXTREME CAUTION pass the following command.

sudo apt-get dist-upgrade

And this will begin the process of replacing the mono-complete package provided you even installed that.

To confirm you have version 4.x or better, type in the following.

mono --version

and it should respond with something like this.

Mono JIT compiler version 4.0.4 (Stable 4.0.4.1/5ab4c0d Tue Aug 25 23:45:14 UTC 2015)
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

Congratulations! The mono language is now up to date and setup properly.

Pinning/Downloading Mono

Update 8/19/2016

Since mono development is rather fluid in its upgrades there will be times where downgrading to a more stable version of mono is preferred for OpenSim. At the time of this update Mono version 4.2.2.11 is released and although it takes less memory to run OpenSIM it increases its idle processor to %50 and crashes every few hours. This is not cool.

To start we are going to blow up any previous versions of Mono that exist on our pi.

sudo apt-get remove mono-complete

sudo apt-get purge mono-complete sudo apt-get autoremove

Next, we will take a earlier snapshot from the repo tree index. We prefer version 4.0.5.1 as it was about the version that was released at the time of this blog but you may try others.

sudo echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1/. main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

Finally, install mono onto this unit.

sudo apt-get update

sudo apt-get mono-devel mono-complete

 

Note: If you are receiving an error as follows:

W: Conflicting distribution: http://download.mono-project.com wheezy/snapshots/4.2.3 Release (expected wheezy/snapshots but got wheezy)

You can try the following:

sudo echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

or

sudo echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.0.5.1/main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

It really depends on your flavor of linux that is running on your Pi.

Legacy Mono 2.x instruction for Rpi-b’s

If you are still looking for the old instruction for Mono 2.x for your Raspberry Pi v1 then click here. 

Configuring OpenSim.

Continuing on we do the basics such as setup the OpenSim.ini to operate in standalone mode by default. And then we have to modify the StandAlone.ini file to switch database control over to MySQL

wget http://opensimulator.org/dist/opensim-0.7.6.tar.gz
sudo tar zxvf ./opensim-0.7.6.tar.gz 
cd opensim-0.7.6
cd bin
cp OpenSim.ini.example OpenSim.ini
nano OpenSim.ini

Now go to cursor position 1064 where it says the following:

  ; Include-Architecture = "config-include/Standalone.ini"

Change to:

  Include-Architecture = "config-include/Standalone.ini"

Ctrl-X and ‘y’ to save changes then:

cd config-include
nano StandaloneCommon.ini

Then Change the following lines so it shows like this.

    ; SQLite
;Include-Storage = "config-include/storage/SQLiteStandalone.ini";
; MySql
; Uncomment these lines if you want to use mysql storage
; Change the connection string to your db details
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensimuser;Password=opensimpassword;Old Guids=true;"

Effectively, you are turning off the built in SQLite that is handled poorly by the experimental MONO package by commenting it out and uncommenting the Storage Provider and Connection String for MySQL, filling out your database name, username and password and then saving this file Ctrl-X and “y”

mono OpenSim.exe

Now it’s important that when executing mono files that it is case sensitive, in this case “OpenSim.exe” is the file we need to launch.

Choose your physics engine:

Click here to learn how to install BulletXNA onto your Pi (This is currently the default physics engine for OpenSim Regions.)

 

If you want your Pi to run physics natively which means more faster collisions. You may want to choose the legacy ubODE/ODE physics. Click here to learn how to install it onto your Pi.

The LibOpenJpeg module:

This library is responsible for generating map-tiles of your Region so that users can see you on the world map. It may be responsible for other functions within the OpenSim engine.

OpenSim System.DllNotFoundException libopenjpeg errors!

After you’ve installed and configured your estate and parcel for the first time, you’ll see this annoying errors that pop up 3 times every few minutes talking about how it cannot take a snapshot of your terrain because your missing libopenjpeg now! Following the Troubleshooting section it says to do the following:

git clone git://github.com/openmetaversefoundation/libopenmetaverse.git libopenmetaverse
cd ./libopenmetaverse/openjpeg-dotnet/

I should note that the address on my site and the address in OpenSim troubleshooting is different. OpenMetaverse Foundation changed their file structure without telling anyone! So I updated my link. Before we continue any further! We’re going to pass the command:

nano Makefile

The reason why is we have to strip the -m32 flag out or else when we pass the “Make” command it will get pissed off because we’re not on a X86 processor. go to line 37 where it says the following

ARCHFLAGS=-m32

and change it to:

ARCHFLAGS=

save the file and continue to compile the library

make
cp -p libopenjpeg-dotnet-2-1.5.0-dotnet-1-i686.so /opensim/bin/lib32/libopenjpeg.so

Finally we have to tell OpenSim where our new library is which mean editing the OpenMetaverse.dll.config in the opensim-0.7.6/bin with nano so “nano OpenMetaverse.dll.config” to get there. This is the original file.

<configuration>
<dllmap os="osx" dll="openjpeg-dotnet.dll" target="lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib" />
<dllmap os="!windows,osx" cpu="x86-64,ia64" dll="openjpeg-dotnet.dll" target="lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64" />
<dllmap os="!windows,osx" cpu="x86-64,ia64" dll="openjpeg-dotnet-x86_64.dll" target="lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64" />
<dllmap os="!windows,osx" cpu="x86" dll="openjpeg-dotnet.dll" target="lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686" />
<dllmap os="!windows,osx" cpu="x86" dll="openjpeg-dotnet-x86_64.dll" target="lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686" />
</configuration>

And this is what mine is:

<configuration>
<dllmap dll="openjpeg-dotnet.dll" target="lib32/libopenjpeg.so" />
</configuration>

Once again, stripping out the OS detection flag and pointing it to the right folder. save your file and restart OpenSim.exe

[quote]Can I get libopenjpeg.so from you as well?[/quote]

LibOpenJpeg binary download.

Once again, most people in the Linux community will give you the lecture of how pre-compiled binaries and slamming them into other linux environments can produce unstable results, and they are right! But for those who do not want to go through all of the “fun” of compiling the uploaded pre-compiled version is available right here. It was originally compiled on Raspbian with a Raspberry Pi v1 unit. It does work on the banana Pi which has a ARMv7 processor and thus it should work on the Pi v2 just fine. If you have a different processor other then ARM or running another flavor of Linux then the pre-compiled version will not work out for you.

Finishing touches on OpenSim configuration files

from the /opensim/installation/directory/bin/ folder wherever you installed it to. We are going to edit “nano /config-include/StandaloneCommon.ini” So that when we configure our viewer it will auto-populate with the correct login information and not give us any crap in terms of connection issues to it.

[LoginService]
    WelcomeMessage = "Welcome, Avatar!"
    ;; If you have Gatekeeper set under [Hypergrid], no need to set it here, le$
    ; GatekeeperURI = "http://127.0.0.1:9000"
    SRV_HomeURI = "http://opensimpi:9000"
    SRV_InventoryServerURI = "http://opensimpi:9000"
    SRV_AssetServerURI = "http://opensimpi:9000"
    SRV_ProfileServerURI = "http://opensimpi:9000"
    SRV_FriendsServerURI = "http://opensimpi:9000"
    SRV_IMServerURI = "http://opensimpi:9000"
    ;; For Viewer 2
    MapTileURL = "http://opensimpi:9000/"

You’re going to want to find the [LoginService] in StandaloneCommon.ini around line 110. We are going to change it from localhost to whatever the logical DNS that your Raspberry Pi is. If you have a Domain Name for your Pi web-server that automatically resolves the IP to you that is even better. In this example I am using the unix hostname ‘opensimpi’ that I configured in the advanced options in “sudo raspi-config” this will give the SecondLife client all of the information it needs when connecting to your Pi.

[GridInfoService]
    ; These settings are used to return information on a get_grid_info call.
    ; Client launcher scripts and third-party clients make use of this to
    ; auto-configure the client and to provide a nice user experience. If you
    ; want to facilitate that, you should configure the settings here according
    ; to your grid or standalone setup.
    ;
    ; See http://opensimulator.org/wiki/GridInfo
    ; login uri: for grid this is the login server URI
    login = http://opensimpi:9000/
    ; long grid name: the long name of your grid
    gridname = "Raspberry Pi OpenSim Default Load"
    ; short grid name: the short name of your grid
    gridnick = "opensimpi"

Next, go to [GridInfoService] and do the same down here which is around line 190 on my configuration. Give it a unique grid-name and gridnick so that you can easily see it when you configure your SecondLife Client.

 Configuration of OpenSim complete launch it!

Which after all of this, go back into your /opensim/bin folder and mono OpenSim.exe . it should launch nice and clean like the window below.

For those who want a snap-shot of the configuration files that I have altered above. you may download this file and unzip it into your /opensim/bin folder to replace the .config files. In my zip file i created a new directory /bin/lib/ where I pointed the libode.so and libopenjpeg.so files to so I can separate them from the other platforms that exist.

Client configuration.

In this example I am using an older FireStorm v2 viewer so that I get mesh support and can build within the sim with something I already like on SecondLife.

Click on Viewer and Preferences or simply hit Ctrl+P to open the FireStorm preferences menu.

As a note the beta versions of FireStorm do not have the Opensim tab in the preferences section of their client. I really don’t know why! So download the older final release and install it (Installing the final release while using the beta releases on Second Life do not conflict with each other. So you can have one configured for your Pi and the other that logs in normally.)

Under Add new grid type in opensimpi:9000 or whatever YOUR hostname that you defined in the StandaloneCommon.ini file. Once you have that typed in, you can hit the Apply button and it will disappear with an entry being added into your Manage Grids second. simply choose your new Pi and click Apply and OK.

The Log into Grid section will change to your Raspberry Pi and from there you simply type your username and password. hit Login and be patient as your OpenSim console on your Pi creates all of the assets of your new user for the first time logging in!

Welcome!

Performance of OpenSim

If you are expecting lightning quick action of OpenSim out of a arm7 processor that only eats a few watts of power. Well, we’re simply not up to the task! You can tell just by how long it takes to make a map-file. On my dual-core Pentium E6300 unit it takes about 5ms, on the Pi 47ms.

Perhaps you can run this in something like OSGrid since the amount of people that visit your Sim may be only a handful at a time. But for the person that wants a DIY Metaverse and to work offline peacefully or with just a few people connecting for group projects. Then the Raspberry Pi is a great alternative of making your 24 hour OpenSim station. Building and working with prim’s is fast. Using scripts is average but it really depends on the complexity of your SLscripts. Physics and Terra-forming is SLOW. it’s really better off to modify your sims parcel on a Linux box and then port it over later to your Pi.

You click on one section of the land and it takes a second for it to respond. The ODE Physics although it works you could potentially lag out your entire sim by rezzing about 32 cubes and turning physics on to watch them collide with each other. You will not only find it painful to move around, but your console will start to send you warnings about latency issues between server and client.

Performance Update with Banana Pi

Update note 12/24/2014:

I have now upgraded to a Banana Pi which is made by LeMaker. It is a dual-core ARMv7 processor which runs at 1Ghz and has a gig of ram. Which falls in line with OpenSim specifications much better then the Raspberry Pi.

Terraforming is almost real-time. Scripts now work as if I was on a low-end dual-core Pentium. Because of the Dual-Core action as well as the DDR3 ram on the Banana Pi which is separate from the On-chip ram of the Raspberry Pi I would say performance is about 4-5 times faster then the Pi.

As for power consumption it’s actually better then my classic B pi because it uses a switching power supply similar to the Raspberry Pi B+. Which means during idle it takes 320ma and when I hammer on the Sim with physics you are looking at 420-500ma which is better then the 700ma idle of the old Raspberry Pi. And for $20 extra you simply cannot beat that kind of price. I will be running my OpenSim on a Banana Pi until I can find something else.

OpenSim will probably run great on the Raspberry Pi 2/3. Anything with multi-core processing helps out mono and therefore helps out OpenSim for all of it’s physics and processing needs. It should be noted that you realistically only need two cores unless you plan on running multiple regions on one ARM based Pi.

Raspian vs. Pidora in OpenSim

I tried Pidora (Fedora for Raspberry Pi) for this procedure and the experimental mono package got even more unstable! Although it lets me login just fine. If you shift-clicked on a prim to make a clone of a pre-existing prim in OpenSim. It would crash giving null database errors even when switching to MySQL on. Although I love Pidora for it’s firewall features which Raspian does not have. And it DID seem to run a little faster under Pidora.. The stability issues was just too much. I also tried to follow the instructions to hand-compile mono hard-float and it didn’t work.

Screenshot above as to the world that is inside of my Pi upon launch. We have since linked it to OpenSim as you could see my progress in this blog entry.

 Some final touches to background OpenSIM so you can log off of your headless server

You probably don’t want to keep an SSH connection going all of the time on another computer. You want to run your Raspberry Pi in a headless state like I am doing. Well, there’s a very old Unix command that can help you with this.

sudo apt-get install screen

The screen command is a great tool allowing you to background processes so that even when you logout the process continues to perpetually run to get this started. type the following:

screen

It will just go back to a blank shell prompt then cd into your OpenSim directory and launch your application:

mono OpenSim.exe

Once that is done simply hit control+A and then control+d to detach this screen session. You can type ‘top’ to verify that mono is still running in the background before you logoff.

To restore your detached session simply type in:

screen -r

And your right at your OpenSim console!

You may want to have a script that automatically reloads OpenSim in the event of a crash (Since depending on the version of MONO Installed it may happen often) follow this script:

until mono OpenSim.exe ; do
    EXIT_CODE=$?
    echo "`date +%Y-%m-%d\ \ %T` # OpenSim crashed with exit code
 $EXIT_CODE. Restart in 10 seconds." >> crash.log
    sleep 10
done

Fin.

This will put it in a loop to restart in case of crash unless you of course quit out of OpenSim Normally

Hope this has helped you! Take care and server protect you!

END OF LINE+++

41 thoughts on “OpenSIM + Raspberry Pi + Rasbian Hard-Float= WORKs!

  1. Your solution generating an sim in OpenSim with the raspi is very interesting for me. Your description is fine – but I tried to install it without effort. The Simulator does not find some of the files – I know no way to succeed. Can you please send me an image of your running system? This will help me very much

    Thank you for your work

    Any

    • I just noticed the Mono experimental link was broken. I have fixed that in my article. Also incorporated some of the instructions of basic setup and MySQL too. Give me a two days to make a clean image of Raspbian running the latest OpenSim so your not stuck with all of the other projects that I have running on my Pi.:) I also realized they just came out with Mono 3 for ARM.. I’m going to play with that on my second Pi and see if it’s any good.

      Thanks for checking out my site. I’ll reply again with a link once the image is ready for download.

    • Here it is. a fully operating version of my OpenSim image. Please change passwords once you have transferred the image. This image will require at least a 4GB MMC card and will need partition expanded through raspi-config.

      login to Raspbian:
      login username: pi
      password: pi

      MySQL:

      username: root
      pass: pi

      username: opensimuser
      password: opensimpass

      OpenSim information:

      Region Name: opensimpi
      Estate name: testersim

      username – FirstName: Test
      username – LastName: User
      password: Test

      Download the 1.5GB image here: Click to be taken to my DropBox link

  2. This looks really cool! Thank You for making this. I have wanted to have a sim that I could leave on all the time without using a lot of electricity.

  3. i tried following your instructions and for some reason the opensim.exe wont be found even after using the case sensative way of spelling it

  4. My thanks for the guidance, sir :-). I took a run at it on a new Raspberry Pi 2 – and I confess I failed dismally. I don;t think I actually got past the Physics error. Now, that’s most likely me being an Idiot – it was 2AM in the morning when I was trying it (blush). However, if I may, one question – would anything be more likely to fail if I was using the current release of OpenSim (0.0.0.4)?
    I was going to take a run at your DropBox link, but I’m guessing it’s got a 192 address for the Pi in it, so I’ll have to get me an HDMI to DVI cable to connect a screen before I try it so I can reset it to DHCP.
    My thanks again for the excellent work here! :-)).

    • A lot of how I got OpenSIM going on my Pi was a lot of trial and error myself and this article was back in the day when we didn’t have the luxury of the Mono programming language already pre-compiled with a simple apt-get.

      the only major difference between when I first published this article which was opensim 0.7.6.1 and now at 0.8.0.4 is they default to Bullet Physics instead of ODE. Now the first solution you should try is simply disable all physics in your SIM on your Raspberry Pi by opening the OpenSim.ini file in nano and around line 213 you should be in the physics section of OpenSim . comment out “physics = BulletSim” and remove the comment for “physics = basicphysics” and try to run your OpenSIM.. the only thing your avatar can interact with in this state is the SIM ground and that it!

      If all is working you are left with two options.. You can either follow my blog instructions to compile ODEPhysics natively and comment in “physics = OpenDynamicsEngine” OR if you don’t want to play around with compiling physics engines if you look further in your OpenSim.ini file around line number 627 which will put you into the [bullet] section of the configuration.

      Comment out BulletEngine = “bulletunmanaged” and remove the comment on BulletEngine = “bulletxna” what this will do is this will tell the Mono programming language to take over Physics instead of relying on your Pi’s pre-compiled library files. The penalty of course is speed as Mono is a heavy handed language.

      As of right now I have not figured out how to successfully compile libBulletSim.so natively for the very best results without getting a lot of float-crash errors even after following all of the compile instructions in OpenSims distro-tree. I do not receive any warnings of my compilation just crashing when Mono attempts to use the library that I compiled for it. ODE however works flawless on my Pi both raspberry and banana to this very day!.

      Anyhow, hope it helps. And good luck with starting your SIM!

      – S

      • Thanks for the reply :-). I took another run at it this weekend, with the 0.7.6.1 release, and got to a build that started up with no errors I could see. Unfortunately, when I tried to connect with a viewer, I couldn’t add it as a grid. It just kept coming back with ‘can’t find grid info’.
        I did a local port scan on the server-pi, and 9000 is reporting open. I did a net-based port scan on my public IP-9000 and my DynDns domain name-9000, and they both reported open. I tried to connect via the Dynamic Domain, the public IP and the local IP (just from my local machine), and allattempts said they couldn’t see grid details. I figure I’ve done something dumb in the config somewhere, but I can’t see it. I’ll take another run at it next weekend :-).
        Thanks for an excellent build page, sir! It got me to the build-run-no-errors point – the rest is, I am sure, me being stupid somewhere (blush).

        • Good to hear that you are making progress on your OpenSIM! Now one thing that you can try is I know port 9000 is used by other daemon programs in the past. In my case I had a Upnp media server that relied on port 9000 for its web interface. changing this port is easy in OpenSIM as all you have to go is go into /bin/region/regions.ini file and change the port name of your region in there. For example port 9001. You’ll start to play with regions.ini file more if you start setting up multiple regions where each region is a different port on your network.

          Also, for external hosting such as DNS resolution lookups you can also setup your “InternalAddress” and “ExternalHostName” in your regions.ini file. I ran into the region resolution not found problem before but it dealt more with a prior linux box I had configured with multiple network cards and OpenSIM simply couldn’t figure out what network card it should use.

  5. HI, did it as instructed on my new PI, but it stills crashes at the bulletsim point, I used the latest version opensim-0.8.1, any advice you have will be welcome.

    thank you
    Admin
    Msdcs

    • I actually had another blog post dealing with the troubles of compiling bulletsim for ARM on this posting. There is only two solutions can can be offered as a work-around right now until the OpenSim devs update their code to use the bullet3.so libraries directly like how ODE works. One of them is to simply let XNA take over bulletphysics at the penalty of CPU power by modifying your opensim.ini file to include the following statement.

      [BulletSim]
      UseSeparatePhysicsThread = true
      TerrainImplementation=0
      BulletEngine = "bulletxna"

      The BulletSim catagory does not exist in opensim.ini after 0.8.x for some reason. but telling it to run via XNA/mono does work. However, after further testing on OSGrid I’ve been finding out that bullet works with prims great but it kind of sucks at mesh objects with their own collisions defined.

      And of course the fallback is going into opensim.ini and modifying your physics to switch to ODE and compile your own ODE library which is the most efficient physics engine on the Pi and works great with mesh but it’s not great with when it deals with transferring physicals from region to region such as vehicles.

      Anyhow, hope that helps!

      • It worked, thank you very much, I now have to do the jpeg thing, but its is now running on my PI, have yet to try to log in yet, but thanks a lot.

        • Glad to hear it’s working out for you. I’ve revised my blog to include the binaries of libode.so and libopenjpeg.so which the only thing you have to do is modify the Ode.NET.dll.config and OpenMetaverse.dll.config to point to the respective files on your Pi.

          My Binaries were originally compiled on the Raspberry Pi v1 running Rasbian and when I upgraded to Banana Pi which runs Armv7 I simply transferred the .so files and it worked from there. Since Pi v2 is Armv7 as well, I don’t think there will be a problem in using the binaries there either.

          • I still get openjpeg errors it says not installed properly and also world map fails, but it is running and scripts work, not tried much else apart from landscaping

            The PI is on http://81.142.92.204/

            port 9500

            will the openjpeg errors and world map fails affect anything in the future.

            but your help has been invaluable, thank you

          • the only thing that libopenjpeg.so file does is it generates the world-map thumbnail for your sim. So it just gets annoying to see that pop up in your console every 10 or so minutes or whenever you terraform your region.

            Not installed properly? Hrmm. It sounds like one of your config files is not pointing towards your pre-compiled libopenjpeg.so file.

            Edit: It seems I can’t post code of this nature in the comments section! heheh. Okay, I made a zip file of all of the files I have modified and libraries I’ve compiled. if you extract this into your opensim folder overwritting the two .config files, it should correct your libopenjpeg errors, and as a bonus allow you to play with ODE physics if you so choose.

            Click here to download the zip file.

          • You have been a great help and the sim is working fine, I am just having problems getting the php to connect to the MySQL database, I want to make my own on it for combat meters that will be in the sim, when I use $con = mysqli(“localhost”, “root”, “password”, “database”); the php script crashes, am I doing it right, I made a new database like you did for the opensim, just used my names and password, that line works fine in all my php in my main server that is a synology DS213+ it just wont work in the pi,

            Any ideas, thank you.

          • PHP/SQL is a little beyond my scope of knowledge unfortunately. I know the basics such as transferring and backing up databases but haven’t played with doing queries via PHP with it. I’ll leave the question up if anyone else that reads has an answer I’ll approve it right away.

          • It is ok now, one of the servers was down I think and not all files were installed for php, I reinstalled the php this morning and now have all the files and the database is a sweet as a nut, running perfectly, thank you so much for all your help, every thing is working, the raspberry forum was a great help.

            Kind Regards.
            John Summers.
            Msdcs.

  6. John Summers,
    I like what you did with the Pi and your website, but I cannot find the link to actually buy one of your preloaded SD Cards. I’m working with a banana pi and wish to purchase a 32Gb card. Please advise.

    Also, I’ve done the steps above on my banana pi and I can run mono OpenSim.exe just fine, but I get a message about the jpeg.so not being installed correctly and I can’t log in to the sim on Firestorm. It’s a standalone to be accessible only behind my firewall, until I learn more. What do I need to do?

    I also bought two 8Gb cards from SanDisk and neither one is working. I formatted them in a windows 8.1 machine and the precess reported success, but the pi does nothing with it. It doesn’t recognize it, it doesn’t boot, nothing. Any advice?

    • jpeg.so ? Do you mean libopenjpeg.so? If so I did document that error and it not only has to be pointed to the right libopenjpeg.so file so it does not crash but you have to either compile it or download the pre-compiled binary of libopenjpeg.so and of course modify the OpenMetaverse.dll.config file so it can actually find the arm compiled version of libopenjpeg.so

      hope it helps!

      • Awesome! Thanks for getting back to me so soon! I’ll give that a shot as I think it might be pointing to the wrong directory. Also, do you have any ideas on why it won’t allow me to log in? I’m using a Linksys WRT54G router.

        I’d be interested in purchasing an SD card pre-configured and perhaps a whole pi with same and I think others might be as well, either on ebay or a website like this.

        • Okay, when it comes to network troubleshooting. One of the first things you can try the moment OpenSim comes up to the command prompt of your region is open up a web-browser and type in the ip-address along with the default opensim port which is typically 9000. for example, if i type in http://192.168.0.33:9000 it responds with the following 404 error:

          Ooops!

          The page you requested has been obsconded with by knomes. Find hippos quick!

          If you are trying to log-in, your link parameters should have: "-loginpage http:///?method=login -loginuri http:///" in your link

          If you can get this. Then this means opensim is visible on your network! And the rest may come down to second life client configuration . the OpenSim.ini file is responsible for the UDP port assignment in case you need to change it to something else. I had to change it personally because my banana pi was also running a UPNP server where port 9000 was its interactive web-page. so i modified my opensim.ini to move it up to 9100. since you are running in stand-alone local mode there’s no need to modify anything on your router. Router modification comes when you want to setup hypergrids and have opensim visible to the outside net. Also, your regions have their own UDP ports as stated in the /bin/regions/regions.ini file within opensim. You may want to change those to 9101, 9102 , etc just to keep things organized.

          I’m not sure if I should be doing pre-loadeded images of OpenSim. Part of the problem is the moving target scenario. Where there’s multiple distro’s of bananna pi that are available and each have their own advantage/disadvantages in their own rights. The other issue is because OpenSim is also a moving target in respects that they are slowly evolving and changing to adapt to the newer mono engine and switching physics engines. That it’s better for people to learn how to install it so when the next release comes out they know how to back up their region into .oar files and re-setup the updated software again.

  7. S-config,
    In the above post, the two 8Gb Sandisk Cards were purchased at Best Buy and I wrote the image to the disk that you posted above from dropbox. Could it be as simple as the Raspberry image won’t work on a Banana pi?

    • That is correct. The Raspberry Pi image I generated for that user in the reply section was a very long time ago when it was still Raspberry Pi A, and B models. Which is compiled for armv6f kernel. That will not boot properly on the banana pi. The reason why I made the pre-load during the start of the Raspberry Pi kickstarter days was compiling mono 2.x on the Pi was really brutal you can’t just get mono from apt-get like we do now.

      I ultimately decided that I had to revise my documentation a few times over the years to lean more on acquiring libraries and compiling it because of the sheer variety of different imbedded units that are out there.

  8. Thank you for this excellent article! It helped me to get OpenSim up and running on an ODROID XU4 (running the default latest Ubuntu distro) without a hitch… mostly :) After fiddling around with it a few days and figuring out how to transfer the operating system to a USB hard drive and run from that instead of the SD card read/write performance had dramatically improved. The 8 core processor and 2 GB of RAM on the XU4 is impressive to me in terms of how well it handles OS; You know just “eyeballing” it and watching how the viewer responds to different tasks but I don’t have any hard numbers to show how much of a measurable difference it would be against a Raspberry Pi 2.

    For the distro I used, mono-complete from the default repositories seems to work fine as it is, no recompile to hard-float was needed or the addition of the 4.x branch repository. Using mono v3.2.8.

    The ODE physics library compile and install went smoothly and is working great!

    I did run into a slight issue with the openjpeg library. It compiled without error and I followed the steps to copy the newly compiled file to the lib32 directory and made the change needed in OpenMetaverse.dll.config to point to the file but… OS still seems to think it’s not “installed correctly” on start up and gives me that red text error. Otherwise it would seem it’s generating map tiles and I can see them in the maptiles directory of OS and also when I open the map in the viewer.

    • Glad to hear it’s working out for you. I too transferred OS off of my SD card on my banana pi and over for my SATA-SSD drive and region reload time decreased by %30.

      As for the differences in Mono . I think it really depends on how you have your OS setup. for me v3.2.8 was very stable when running in standalone mode. However, the moment I activated hypergrid via using the OsGrid region is when I was having lots of issues with teleportation. People teleport in, but they can never teleport out. That’s what forced me to upgrade to 4.x . Then again, Ubuntu’s Mono 3.2.x might be a lot more stable then the Debian (Raspbian) side of things with Pi users.

      Mind copying what the red text is saying for LibOpenJpeg? Not sure if i can help . But I want to see if it’s a file-not-found error or something more serious. LibOpenJpeg does not interfere with region operation it just gets annoying to see in the logs every time it generates a new map-tile.

  9. Ah alright, I have been using OpenSim in standalone mode. Haven’t gotten adventurous enough to try hypergrid yet :)

    The error I got for OpenJPEG:

    15:31:00 – Failed generating terrain map: System.DllNotFoundException: libopenjpeg-dotnet.so
    at (wrapper managed-to-native) OpenMetaverse.Imaging.OpenJPEG:DotNetAllocDecoded (OpenMetaverse.Imaging.OpenJPEG/MarshalledImage&)
    at OpenMetaverse.Imaging.OpenJPEG.Encode (OpenMetaverse.Imaging.ManagedImage image, Boolean lossless) [0x00000]: in :0
    at OpenMetaverse.Imaging.OpenJPEG.EncodeFromImage (System.Drawing.Bitmap bitmap, Boolean lossless) [0x00000] in :0
    at OpenSim.Region.CoreModules.World.LegacyMap.MapImageModule.WriteJpeg2000Image () [0x00000] in :0

    I know that there is a slight discrepancy in the library name; it’s because I’m using OS 0.8.1 and in that version it was named libopenjpeg-dotnet.so so I left it named that, copied it over, and changed OpenMetaverse.dll.config to use that name instead of libopenjpeg.so

    My OpenMetaverse.dll.config:

  10. It would appear I spoke a bit too soon about mono 3.2.8. In standalone mode; while I can cross over to another region I can’t teleport directly. It gives me a “Could not teleport. Internal error.” popup and the OpenSim console outputs an exception similar to yours before you upgraded to mono 4.0.4. So I followed your procedure to upgrade mono and it installed but gave me mono 4.2.1. OpenSim does not seem to like 4.2.1 at all and crashes upon start up. How might I get specifically 4.0.4 installed? Thank you for your help :)

    • Since the blog posting of mono 4.0.4 I actually did upgrade to 4.2.1 and it’s operational on my OSGrid region banana pi. But perhaps things aren’t well in Ubuntu land. I will load Ubuntu on my Orange Pi to see if I can bring Mono and OpenSim up to speed. The only time I encountered crashing on startup was either the mysql daemon was not running (I use mysql for OpenSim to keep the database away from Mono) Or if I launched OpenSim as root by accident and went back to being just a user only to find out some of my log files were all locked up. Which a “sudo chown -Rf user:user /path/to/opensim” and whatever your “user” name is goes there cleans all of that up.

      As for your OpenJPEG error. System.DllNotFoundException is the big one, but it looks like it IS reading your OpenMetaverse.dll.config or else it would’ve simply said libopenjpeg.so instead of libopenjpeg-dotnet.so so you are making progress. You can try dropping your libopenjpeg-dotnet.so into the root of opensim as Mono can look for libraries in its root just for diagnostic reasons.

  11. Aha. Copying libopenjpeg-dotnet.so to opensim’s root did the trick. Thank you so much :)

    While I never did manage to figure out why Mono v4.2.1 crashes OpenSim so horribly on Ubuntu, I did manage to figure out how to upgrade mono to a not-so-current release; it was simply a matter of telling the package manager what branch to pull from so I told it to pull from 4.0.5.1 (i.e. ‘deb download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1/. main’) and that resolved the teleporting issue for me.

    All seems well now on my little ODROID OS server ^^

  12. I have a Raspberry PI 3 and I tried following your instructions and things seemed to be going fine until I hit sudo apt-get mono-devel mono-complete
    and got:
    pi@RaspBerryPI3:~ $ sudo apt-get mono-devel mono-complete
    E: Invalid operation mono-devel
    So I guess I didn’t get mono to successfully install. Where to go from here?

    • At the time of this article I think I included mono-devel for those who want to compile the OpenSim environment on their Pi from scratch. Which if you are just downloading OpenSim or OSGrid you don’t need mono-devel.

      as long as mono-complete installs successfully and you’re able to pass the

      mono --version

      command, then you should be good to go.

Leave a Comment