Build

Learn how to get your raspberry pi booted into an operating system

xmpp-raspi Many years ago, around 2001/2 to be precise ralphm made something called the Jabber World Map, and the Jabber fish bowl and the Jabber Christmas Tree and the ..., [see http://ralphm.net/worldhttp://ralphm.net/ ] Whose Raspberry Pi is online (or any other XMPP enabled device) , and at least two Jabber IM clients, BuddySpace & Tkabber had functions where your contact list could be displayed as a map or graphic.  Whose Raspberry Pi is online (or any other XMPP enabled device) Whose Raspberry Pi is online (or any other XMPP enabled device)

Unfortunately BuddySpace & ralphm's web maps haven't been updated in several years & Tkabber hasn't had a stable release in about 3 years although the svn version does run very well on the Raspberry Pi. We do have something very similar to ralphm's Jabber World Map with @Ryanteck's RasTrack, which is very good.Screen Shot 2013-01-23 at 1.07.21 PM But it isn't quite what I want as I want to have something can be private to me, or my group and can be used  at a variety of levels, house, building, club, village, town,... or with non-traditional maps and is easy to setup, deploy & take down (if it's only to be used for a short time).

The Prosody XMPP server that I talked about it an earlier post is perfect to do something like this as not only does it run very well on the raspberry Pi, is easy to setup, it comes with a 3rd party webpresence module that only requires installing into your modules directory, editing a config file and restarting the Prosody server and it's ready to use.

The mod_webpresence module is not part of the Prosody core so you'll need to  download it from http://code.google.com/p/prosody-modules/wiki/mod_webpresence (If you are using the stable Prosody, version 8.2, from the raspbian repos due to API changes between the stable and unstable branch you'll need to use the 8.x compatible version from  http://0-8.prosody-modules.googlecode.com/hg/ . which unfortunately isn't quite as good as the version for use with unstable prosody but it'll do the job although some of the nicer things such as user supplied icons don't work). If you are using the 0.9 branch of prosody copy the icons/ directory & the mod_webpresence.lua file to your prosody modules directory, if you are using the 8.x branch then just copy the mod_webpresence.lua file. The modules directory will be in one of several locations depending on on you installed Prosody. If you installed it from the raspbian repos then it'll be in /usr/lib/prosody/modules, if you installed from source then it'll probably be in /usr/local/lib/prosody/modules or if you changed the prefix when building and installing then it'll be in [prefix]/lib/prosody/modules e.g. /home/ukscone/prosody-0.9/lib/prosody/modules

Once you have copied the module you'll need to edit the config file for the prosody VirtualHost, in my case I added the line

"webpresence"; to the modules_enabled section in birstall.leicestershire.lan.cfg.lua

 

modules_enabled = {
"roster"; -- Allow users to have a roster. Recommended 
;) "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in. "tls"; -- Add support for secure TLS on c2s/s2s connections "dialback"; -- s2s dialback support "disco"; -- Service discovery "private"; -- Private XML storage (for room bookmarks, etc.) "vcard"; -- Allow users to set vCards "version"; -- Replies to server version requests "uptime"; -- Report how long server has been running "time"; -- Let others know the time here on this server "ping"; -- Replies to XMPP pings with pongs "register"; -- Allow users to register on this server using a client and change passwords "adhoc"; -- Support for "ad-hoc commands" that can be executed with an XMPP client "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands "posix"; -- POSIX functionality, sends server to background, enables syslog, etc. "announce"; -- Send announcement to all online users "welcome"; -- Welcome users who register accounts "motd"; -- Send a message to users when they log in "legacyauth"; -- Legacy authentication. Only used by some old clients and bots. "webpresence"; };

Once you've added the line to *.cfg.lua for your server, restart Prosody and test it using the webpresence url.

Screen Shot 2013-01-23 at 2.09.07 PM Screen Shot 2013-01-23 at 2.09.23 PM Screen Shot 2013-01-23 at 2.09.38 PM Now you know that it is working for one user you can now create a webpage to display the presence status for several users. In theory Prosody has a module to act as a webserver for static html files however i've never been able to get it to work correctly so I installed apache2 on my my raspberry pi but any method of serving webpages will do as long as it can "see" the url that the webpresence module produces. My html skills are very bad, non-existant, consist of being able to cut & paste and add text so I knocked up a simple webpage that uses a graphic of the floorplan of my apartment and uses absolute positioning to position the icons. [note: i know it's rubbish html & probably the wrong way to do it so you don't need to tell me :) ]

 

<html>
<head>
<style>
html {
 background: url(floorplan.png) no-repeat center center fixed;
 -webkit-background-size: 400px 600px;
 -moz-background-size: 400px 600px
 -o-background-size: 400px 600px;
 background-size: 400px 600px;
 background-color: #0c47ef;
}
.tooltip {
 border-bottom: 1px dotted #000000; color: #000000; outline: none;
 cursor: help; text-decoration: none;
 position: relative;
 }
 .tooltip span {
 margin-left: -999em;
 position: absolute;
 }
 .tooltip:hover span {
 border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; 
 box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
 font-family: Calibri, Tahoma, Geneva, sans-serif;
 position: absolute; left: 1em; top: 2em; z-index: 99;
 margin-left: 0; width: 250px;
 }
 .tooltip:hover em {
 font-family: Candara, Tahoma, Geneva, sans-serif; font-size: 1.2em; font-weight: bold;
 display: block; padding: 0.2em 0 0.6em 0;
 }
 .classic { padding: 0.8em 1em; }
 * html a:hover { background: transparent; }
 .classic {background: #FFFFAA; border: 1px solid #FFAD33; }
</style>
</head>
<body>
<center><h1>Who is home & online?</h1></center>
<div style="position:absolute; top:540; left:500;">
<a class="tooltip" href="#">
<img src="http://birstall.leicestershire.lan:5280/status/linda/" />
Linda
<span class="classic">Linda</span>
</a>
</div>
<div style="position:absolute; top:100; left:500;">
<a class="tooltip" href="#">
<img src="http://birstall.leicestershire.lan:5280/status/john/" />
John
<span class="classic">John</span>
</a>
</div>
<div style="position:absolute; top:400; left:500;">
<a class="tooltip" href="#">
<img src="http://birstall.leicestershire.lan:5280/status/admin/" />
Russell
<span class="classic">Russell</span>
</a>
</div>
</body>
</html>

which gives me a webpage that looks vaguely like this.
Screen Shot 2013-01-23 at 2.15.39 PM
If you have better css/html skills then you can do all sorts of fun & fancy things and you can use any background graphic you like, say the map of your school, town, a Christmas tree, ... Of course for anyone on your map/graphic to appear as online they'll need to be signed in to your prosody server using an IM client that supports XMPP or have an XMPP bot running on their Raspberry Pi. Most modern multiprotocol IM clients support XMPP, including, but not limited to pidgin, adium, centerim, IM+ and there are serveral XMPP clients that run very well on the Raspberry Pi including Tkabber. You could also write an XMPPBot for people to run on their Raspberry Pi, there are several XMPP libraries available for languages like Python, lua, php,... that make it very easy to write your own bot or client. A quick google will lead you to them. This doesn't scale that well, probably no more than a couple of hundred users max but it is very flexible and will do for smaller (semi-)private groups and there is lots of room for improvement and hacking and doing fun things with.

[note: if you are using the 0.9+ branch of prosody & the mod_webpresence module you can change the icons in the icons directory that the webpresence module uses, if you are using 8.x branch then the icons are "hardcoded" into the lua source of the module so changing them isn't just a case of dropping them into the icons directory and you can read more about the Prosody, the  webpresence module, and the other modules available at http://prosody.im/ &  http://code.google.com/p/prosody-modules/wiki/mod_webpresencehttp://code.google.com/p/prosody-modules/]

Share

Read more http://russelldavis.org/2013/01/23/whose-raspberry-pi-is-online-or-any-other-xmpp-enabled-device-2/

The $25 ARM GNU/Linux computer that could change the world

There isn’t much any small group of people can do to address problems like an inadequate school curriculum or the end of a financial bubble. But we felt that we could try to do something about the situation where computers had become so expensive and arcane that programming experimentation on them had to be forbidden by parents; and to find a platform that, like those old home computers, could boot into a programming environment.

 

Over the next few years, Eben, having left the university for industry, worked on building prototypes of what has now become the Raspberry Pi in his spare time.

 

Read more...

Feed Me...

Website Search