Saturday, July 23, 2011

Multi-user Sim-on-a-stick

CAUTION: This is a pretty old post, SoaS may have changed, probably has. Just keep in mind...
I love how accessible Sim-on-a-stick makes OpenSimulator. Just plug it in and double click one batch file and after a succession of pretty windows a virtual world awaits. It's like a virtual Rube Goldberg machine unfolding right before your eyes. By default the Sim-on-a-stick flavor of Opensim is for a single user. So teachers with access to a bunch of PCs (yes, it only runs on PCs so far, but I'm sure some dedicated people will figure it out for Mac) could make as many copies on USB drives as they have students, hand them out, and let students manage their own personal sims. Or students could pair up or whatever.

I mentioned in a previous post that an adventurous teacher could configure a Sim-on-a-stick for multiple users, so you'd have all of your students logging into the same sim from their own computers. This would be nice for collaborating on a project, like when I had students build The Parthenon together. In keeping with the Sim-on-a-stick's ease-of-use, here's a step-by-step to doing that. So here goes.

You can go ahead and plug in your USB stick, download the latest version of Sim-on-a-stick from the website and unzip it to the stick. Before you run the Opensim_autostart you have to change a few things.
First, open the folder 'config-include' on the stick at the path in the image.
Find the file 'MyWorld.ini'. 
Right click on it and open it with Notepad.
Before you can make the necessary changes to it, you need to know your computer's IP address. So click Start and in the search bar (or Run window if on XP) type 'cmd' and hit enter.
At the C: prompt, type 'ipconfig' and hit enter.
Many lines will fly by, but just scroll back up until you find the section for your IP address. Now, if you are connecting to your network wirelessly, look for the IPv4 Address under the Wireless section. But this setup will cause considerable lag for your students in the sim. Better to connect with an ethernet cable, in which case you will find your IP address in that section. Write down that number. You can type exit and hit enter to close the command line. NOTE: Your IP address does not stay the same, but is likely to change whenever you restart this computer. So to keep this setup you can just not turn off this computer, otherwise do a quick check on the command line to see that it hasn't changed. If it has, you'll need to modify the IP address settings you make in the following steps and to the students' viewers when they log in.
Go back to MyWorld.ini and find the line under [GridService] with the IP and change that to the IP you found with ipconfig. Save and close that file. UPDATE: In practice I've found it best to change ALL occurrences of the IP in MyWorld.ini, just do a search and replace.
Now go up one folder and find the Regions folder and open that.
Find the RegionConfig.ini file, right click on it and open it in Notepad.
In this file, find all 4 occurrences of the ExternalHostName IP address of and change them to your IP. Save and close this.
NOW you can double click the Opensim_autostart file. Sit back and watch the pretty text and windows fly by. The last thing to open will be the Imprudence viewer. When that opens you'll see orange planets on a black background. 
At this point you have the option of creating your students' accounts for them or letting them create accounts when they log in. If you choose the former, click "CREATE ACCOUNT" and fill in the relevant information for each of your students. 
To log in to your sim, use the Simona Stick (pswd: 123) account and log in using the fields at the bottom. So now you are logged in and your students have accounts (or will make them).
Now for your students! They will need the Imprudence viewer on their computers for them to log in to your sim, so you will have to get that installed. 
Once they open it they will see a different default screen. They should click the Grid Manager button, click Add new grid, for Grid Name type whatever name you want for your sim, and MOST IMPORTANTLY, for Login URI they need to type http://your.IP.add.ress:9000/wifi (NOTE: in a recent version this has been changed to http://your.IP.add.ress:9100/wifi), and the same under Login page. This will direct their viewer to your computer where your sim will be running.  
They can click OK and select that sim in the grid dropdown. Once they select it they should also be seeing the orange planets.
From here they either create their accounts or simply log in! Then the fun can begin!
Ahh, a couple more things. Your entire operation is running on the USB drive, so don't ever pull it out while you have the world running! And you can't just X out of the various windows to shut down. Here's the shutdown process:
Make sure your students are logged out of the sim and log out yourself (In Imprudence, File > Quit).
Now at the Opensim console, type 'shutdown' and hit enter. Various shutdown processes will commence and that window will close.
Then go to the MoWeS window and click 'Stop server'. Wait until both Apache and MySQL are not running, and click 'End'. Now you can take out the USB drive.

Tuesday, July 19, 2011

Controlling LED from a web page with Arduino and Ethernet Shield

I figured out how to make my Arduino into a web server pretty quickly, especially since the example program does just that. What was hard was to go the other way, controlling it from a web page. I got that working finally by cobbling together bits and pieces of this project and this project. What I wanted was a couple of form input buttons that would turn on and off an LED. That's what this does. One issue I still have is the first time you submit the Arduino responds immediately but from then on you have a passed value in the URL and for some reason you have to click twice to get the Arduino to respond. Actually it does respond the first click but goes back to its previous state, then stays on the new state on the second click. Something more complicated is going on than I can yet understand. Anyway, it's cool and now I think lots of possibilities are opened up.
Well, I tried posting the code here but the WYSIWYG eats a lot of it, so here it is in a txt file, linked here.
UPDATE: Ha, an anonymous reply (thanks!) solved my double-click problem. Add a break; after each digitalWrite which makes sense now:

if(c == '0') {
digitalWrite(9, LOW);
if(c == '1') {
digitalWrite(9, HIGH);


Wednesday, July 13, 2011

We've Come A Long Way

A few clicks and a new Kitely
world is made.
"I've just upgraded to the newest version of OpenSim using Diva's Distribution, which makes all of the following pretty much obsolete. I'm just keeping the old steps below so I can look back some day and appreciate how far it's all come." I'm quoting myself from two years ago, when I started messing with virtual worlds, and it's come time to take that look and appreciate where we are.
Sim-on-a-stick is starting up a new
region after running one batch file!
Two years ago the drama teacher in my school wanted to explore having his students act with avatars. After looking into Second Life and There it was clear to me that a private OpenSimulator sim was the only option for our small experiment. The learning curve was steep for me and the consequences of deploying alpha software (v 0.6.3!) in an environment where we depended on it working with students ready to go was tough. We started our little acting project with few props, inventory we thought was lost that really wasn't because of DB connection timeouts, awkward kludges with FreeSWITCH, and a host of other issues.
The release of the Diva Distribution in the fall of 2009 was a major advance for me, with the helpful readme files and update and configure utilities. Despite this fantastic advance in OpenSimulator's ease of use, you still had to be a brave enough educator to install a MySQL database and mess with .ini files. These basic procedures have been prohibitive enough to keep the educators I've shown to keep their feet out of the virtual water.
A new me in seconds on Kitely
Well, that is all changing because of Kitely and sim-on-a-stick. I'd been hearing about these options over the last month or so, longer for sim-on-a-stick, but only had time to try them out a few days ago. I'm still buzzing from how easy both of these options are. With either one, you are up and running a sim in a few minutes with no back-end messing required. Each option has certain limitations compared to, say, paying for more full service sim hosting or running your own public grid from the ground up rather than on a stick.
In the case of Kitely, you don't have access to the back end at all but you can upload an OAR file at the time you create a new world. Pricing is extremely affordable and the team is very responsive to new feature requests and working hard to give users what they want.
Sim-on-a-stick (you'll find the relevant credits here) is an amazing new development that packages everything you need to run a sim on a USB drive. Having gone through the agony of making countless mistakes setting up this and that service and database and version of .NET and hunting down the meanings of various error messages I watch the pretty windows scroll by and things happening on their own after running ONLY ONE BATCH FILE and I'm just speechless at the magic of it.
Being the innovation enthusiast and teacher support person I am, I always think of how it will look to the first time non-geek teacher. I think the command lines of sim-on-a-stick, pretty as they are, will freak some people out, which may make Kitely, which hides all that scary-looking business, behind a clean and simple web front-end. But one thing that's beautiful about sim-on-a-stick is you can just say don't touch your computer until it's time to log in. And then there will be some adventurous people who will enjoy getting under the hood and, say, looking up their local IP, adding that to the bin\config-include\MyWorld.ini and bin\Regions\RegionConfig.ini files in place of so that students on other computers in their LAN can direct their own Imprudence viewer to that IP and log in to the same sim-on-a-stick on your computer (the sim has to run on a PC for now, by the way, but the clients can be on Macs). I tried this today on a hunch and it rocked! Wired connections are best, of course. Then you have a collaborative environment and not just a single user operation. Before you do this, of course, you have to run the Diva Wifi service on the stick and create the new users for the students. Or even have the students create their own accounts by having their viewers directed to
Anyway, all of this signals good times ahead for learning in virtual worlds!