Oct 2011 16

In my last post I wrote Seriality makes use of a Plugin which has to be configured on Browser. As it was only available for Mac OS, now I have made it possible to be available on Browser on Linux. In my case it was Firefox on Fedora 14.

As in last post after untar one get some files these are :

[chetanpatil@chetanpatil ~]$ cd Seriality_Source_20100306
[chetanpatil@chetanpatil Seriality_Source_20100306]$ ls
changelog.txt  nixysa  readme.txt  seriality  third_party  tools
[chetanpatil@chetanpatil Seriality_Source_20100306]$ pwd
/home/chetanpatil/Seriality_Source_20100306
[chetanpatil@chetanpatil Seriality_Source_20100306]$ cd seriality/
[chetanpatil@chetanpatil seriality]$ ls
glue             plugin.cc   serial.c      seriality.h    serial.os
libseriality.so  plugin.os   serial.h      seriality.idl  test.c
parser.out       SConstruct  seriality.cc  seriality.os   test.cc

Above you can see a file named libseriality.so. Copy this file to Firefox plugin folder like this.

[chetanpatil@chetanpatil ~]$ sudo cp libseriality.so /usr/lib/mozilla/plugins 

Enter the root password after it prompts for.

There you go we are ready to test if the Seriality plugin works or not. For that you have to write following Seriality Plugin Detection code and save it as .html file.

<html>
<head>
<script type=”text/javascript”>
         var serial;
         function setup(){
if (hasSeriality()) {
serial = (document.getElementById(“seriality”)).Seriality();
alert(“You have Seriality” + “\n” + serial.ports);
else{

                      alert(“You do not have Seriality”);

          }
}
function hasSeriality()
{
if (navigator.plugins && navigator.plugins.length > 0) {
for (var i = 0; i < navigator.plugins.length; ++i) {
if((navigator.plugins[i].name.indexOf(“Seriality”) >= 0) ||                           
(navigator.plugins[i].description.indexOf(“Seriality”) >= 0)) {

          return true;
}
}
}
return false;
}
</script>
</head>
<body onload=”setup();”>
<object type=”application/Seriality” id=”seriality” width=”0″ height=”0″></object>
</body>
</html>

 As soon as you run above code you will see this screen :

8013514_orig

I will try to make it work with Google Chrome also and will execute few lines of code which will talk to my hardware Arduino from webpages.