My pet project!

So I want to produce a remote weather station using off the shelf technology, so after a look around I purchased a WH3081 a number of months ago. The thing that finally decided it for me was that it was solar powered and rechargeable battery life is expected at 2yrs, and it’s wireless, and the base station has a USB port. I know the list is long ;)

So comments on the weather station, think it’s based on the Dallas one wire weather station design. Would be nice to know, from the manufacturer who I’ve emailed. If assembled as per instruction way too much cable, going to have to revived an old skill and lace it all properly. Connection and configuration really easy, and even in my cottage with 2ft think walls the time clock signal worked :)

So off the shelf free software and I ended up with pywws (I really meant off the shelf, no compiling!). A few round the houses and I ended up with livelog.py working, and a connection to Weather Underground -

IOXFORDS47

More later …

Posted in Uncategorized | Leave a comment

Pogoplug :: adding crond

So need to have crond running of my pogoplug, found a couple of useful links but all expected another part to be done! so here’s the list assuming that your usb drive had mounted at mnt_sda1 most likely if it’s the only drive on there

  1. mount -o remount,rw /
  2. mkdir -p /tmp/.cemnt/mnt_sda1/spool/cron/crontab
  3. ln -s /tmp/.cemnt/mnt_sda1/spool /var/spool
  4. crond
  5. nano /etc/init.d/rcS
  6. add ‘ln -s /tmp/.cemnt/mnt_sda1/spool /var/spool’
  7. add’crond’
  8. close and save
  9. restart pogoplug

Your Pogoplug now has crond running :)

 

Posted in Embedded, linux, user tools | Leave a comment

SAPUI5 => SAP HMTL5 CSS3 JavaScript

Ok just downloaded the SAPUI5, installed it on my mac and did a bit of looking around!

jQuery and a number of versions… ? why not sure yet but more on that later.

First looks yeah nice, looks like a lot of work has gone into this, need to find a name to acknowledge for the work I think there. (more later on that).

Like the focus thou :)

links http://www.netweavercentral.com/index.php/2012/sapui5-sdk-documentation-available-now/

http://dailyjs.com/2012/02/14/jquery-roundup/

n.b. you have to register to get this so not sure on the restrictions if you could use this outside of the SAP environment :(

Posted in css, html, javascript, user tools | Leave a comment

Catch up day :)

Well after a long time I’d got some time to go through my blog and actually do some admin. Having written content yet not published it have a huge backlog going back 2yrs, ouch :(

Posted in Uncategorized | Leave a comment

Favourite JavaScript libraries

So it’s been a long time writing JavaScript, from my earliest dabbling in the Netscape browser, at the same time Netscape had a web server product which also had Server side JavaScript, wrote pages with that, then used the classic ASP pages but again only wrote in JavaScript. My logic was that why should I write in different languages server side and client side? Then along came BroadVision and again writing in Server side JavaScript, solved a lot of issues with that product!

Over all these years my love for this language has been strong, what always made me pull my hair out used to be the differences between the browsers. Which basically created the bad reputation of this language.

I find it very strange why people try to put classes into a functional based language, why fight the language and the way it works?

Anyway I digress, my favourite libraries are jQuery and Underscore. To add to these there are a few snippets from myself, and looking at apps/single page web apps undecided between Ember.js and Backbone.js.

Currently to fix the browser issues using Modernizr this is almost like a lot of my snippets to fix problems.

More thoughts…

Posted in javascript | Leave a comment

configuring BusyBox httpd

So PogoPlug now has all the requirements just now need to configure the httpd in BusyBox and we’re away, well almost!

If we set the httpd to run on port 80 the wonderful features of the PogoPlug go so we must use port 8080 as our web server port. The next is that I want to have access to the files so I can upload them via the my.pogoplug.com interface.

  1. So via your my.pogoplug.com interface add a folder on you USB drive wwwroot
  2. enter the  wwwroot folder and create two folders cgi-data and www
  3. enter the www folder and create a cgi-bin folder

All done with that part painless really ;) and you should put an index.htm page in the www folder so you can see something later!

Next log in via SSH and a enter the following ‘/usr/sbin/httpd -p 8080 -h /tmp/.cemnt/mnt_sda1/www ’

So now if you have a fixed IP Address like me just enter it and add :8080 at the end and away you go!

Not got a fixed IP address? :( right you need to look at your router admin pages to see if it has the ability to run a ‘Dynamic DNS’ service.

Then same thing ‘http://myunique.mydns.com:8080

 

Posted in Embedded, linux, user tools | Leave a comment

Answer to some questions!

  1. get yourself connected to the Pogoplug via SSH, if you don’t know what SSH is stop now!!!
  2. ‘cd /’
  3. run ‘flash_eraseall -j /dev/mtd3′ this erases and formats the block to jffs2 structure
  4. ‘mkdir /opt’
  5. ‘mount /dev/mtdblock3 /opt’
  6. ‘wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ipkg-opt_0.99.163-10_arm.ipk‘ current version as of 2012/01/20
  7. ‘tar xvzf ipkg-opt_0.99.163-10_arm.ipk’
  8. ‘tar xvzf data.tar.gz’ this should place all the items in the /opt directory
  9. now you need to clean up ‘rm *.ipk’ and ‘rm *.gz’
  10. ‘echo ‘src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable’ >> ipkg.conf’
  11. ‘PATH=$PATH:/opt/bin:opt/sbin’
  12. ‘ipkg install Haserl’
  13. so now you need to find out where the PogoPlug has mounted your external harddrive, try /tmp/.ceadmin/sda ?

More later :)

Posted in Embedded, linux, user tools | Leave a comment

A little bundle of possibilities….

Ok so I might be a bit slow but after wandering around and looking at various ‘lite’ web servers, I had settled with Nginx, or Lighttpd.

But! after accidentally typing ‘httpd’ at the command line of my PogoPlug, I found out that BusyBox had a minimum HTTP daemon. Nice with a little more searching I came across ‘Haserl’ which allows you to write CGI scripts using the command shell. Now for me this solves my issues of putting a web server on my PogoPlug and not trashing the facilities of the PogoPlug.

So my additions to the PogoPlug have been the following;

  • making mtdblock3 jsff2 formated and mounted as /opt
  • installing optware package management tool
  • installing ‘Haserl’

By creating a directory on one of the external drives then mapping that as the httpd root directory I can seen the web server via http and also make changes to the files via the PogoPlug web interface.

Posted in Embedded, linux, user tools | Leave a comment

jQuery connections to YQL data

The team I’m mentoring/training at the FT are going to be transferring from Flash/ActionScript to HTML5 JavaScript CSS3. So here are some of the code examples I’ve given them for usage when connecting to remote data.

Fro XML only and no CORS.

$(document).ready(function(){
$.get(‘FT500dataset2.xml’, function(data){
$(data)
.find(‘dataset > dataUnit’)
.each(
function(i){
alert(‘position=’ + i);
}
);
});
});

For JSONP-X

$(document).ready(function(){

var yql = ‘http://query.yahooapis.com/v1/public/yql?q=’;
yql += encodeURIComponent(“select * from xml where url=’” + rData + “‘”);
yql += ‘&format=xml&diagnostics=true&callback=?’;

$.getJSON(yql,function(ds){
})

.success( function(data){

alert($(data.query.results));
});
});

For straight JSON

$(document).ready(function(){

var yql = ‘http://query.yahooapis.com/v1/public/yql?q=’;
yql += encodeURIComponent(“select * from xml where url=’” + rData + “‘”);
yql += ‘&format=json&diagnostics=true&callback=?’;

$.getJSON(yql,function(ds){
})

.success( function(data){

$(data.query.results.dataset.dataUnit)
.each(
function(i){
alert(‘position=’ + i);
}
);
});
});

Posted in html, javascript, user tools, YQL | Leave a comment

JavaScript: code snippet

note for self: a piece of code to enable me to write ‘console.log’ and not have IE get unhappy :/

// this creates the console object if it’s not present – most useful for IE7,8,9
if (! (“console” in window) || !(“firebug” in console)) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group" , "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i <names.length; ++i) window.console[names[i]] = function() {};
}

Posted in html, javascript, user tools | Leave a comment