Just discovered via some google-fu that we have a Sagem C1000 series meter in the house, which includes
* Interface de télé-information client permettant le raccordement à un système de gestion d'énergie
so, with a bit more googling I discovered that it's 1200 baud, 7 bits one stop. and lo - there's even an arduino shield already made for it!
--- update ---
Have discovered that there are many hacks around to parse this teleinfo - some of which need a licence fee (!!!) and do fancy things like export to bdpv.fr
Sample of the data stream is at http://www.planete-domotique.com/blog/2010/03/30/la-teleinformation-edf
Wednesday, 22 June 2011
Thursday, 16 June 2011
Hardware Hackery
I've just purchased a nanode to be the main part of the energy monitoring in the new house. More details about it are at http://wiki.hackspace.org.uk/wiki/Project:Nanode - I plan to use the nanode as the head unit, perhaps with a somple lcd display, talking to slave nodes (jeenodes or emontx boards) which do the data logging.
more info and construction details when it arrives.
more info and construction details when it arrives.
Tuesday, 24 May 2011
Nasa TV on PS3
Since there's no european satellite stream of Nasa TV it means you have to watch a streamed version over here.
Also I'd like to watch it *on the TV* when there's something interesting, rather than a PC. so, with a bit of hackery http://smudge.elwell.org.uk/nasa.html contains just the swf embed object (no extra junk) scaled to 720p size.
Opening the link in the PS3 web browser and clicking the 'fullscreen' bottom RH corner means you get a nice fullscreen flash stream on your TV :-)
share and enjoy.
Also I'd like to watch it *on the TV* when there's something interesting, rather than a PC. so, with a bit of hackery http://smudge.elwell.org.uk/nasa.html contains just the swf embed object (no extra junk) scaled to 720p size.
Opening the link in the PS3 web browser and clicking the 'fullscreen' bottom RH corner means you get a nice fullscreen flash stream on your TV :-)
share and enjoy.
Monday, 9 May 2011
email clients
Came across this posting recently. Oh that the following recommendations were actually implemented somewhere...
But let me suggest a few pop-up windows I would like to see
mail-programs implement whenever people send or reply to email
to the lists they want me to subscribe to:
+------------------------------------------------------------+ | Your email is about to be sent to several hundred thousand | | people, who will have to spend at least 10 seconds reading | | it before they can decide if it is interesting. At least | | two man-weeks will be spent reading your email. Many of | | the recipients will have to pay to download your email. | | | | Are you absolutely sure that your email is of sufficient | | importance to bother all these people ? | | | | [YES] [REVISE] [CANCEL] | +------------------------------------------------------------+ +------------------------------------------------------------+ | Warning: You have not read all emails in this thread yet. | | Somebody else may already have said what you are about to | | say in your reply. Please read the entire thread before | | replying to any email in it. | | | | [CANCEL] | +------------------------------------------------------------+ +------------------------------------------------------------+ | Warning: Your mail program have not even shown you the | | entire message yet. Logically it follows that you cannot | | possibly have read it all and understood it. | | | | It is not polite to reply to an email until you have | | read it all and thought about it. | | | | A cool off timer for this thread will prevent you from | | replying to any email in this thread for the next one hour | | | | [Cancel] | +------------------------------------------------------------+ +------------------------------------------------------------+ | You composed this email at a rate of more than N.NN cps | | It is generally not possible to think and type at a rate | | faster than A.AA cps, and therefore you reply is likely to | | incoherent, badly thought out and/or emotional. | | | | A cool off timer will prevent you from sending any email | | for the next one hour. | | | | [Cancel] | +------------------------------------------------------------+
Friday, 15 April 2011
git import
I had a set of old files with the correct timestamp on, relating to separate versions of a file, ie, foo_16.c, foo_17.c, ... foo_22.c which I wanted to import into a new git repo while preserving the author history
so, this little snippet of code worked - may be useful for others
which you can then branch and commit as normal with current changes
Yes I could probably have done GIT_AUTHOR_DATE=$GIT_COMMITTER_DATE but well, 2 calls to date wasn't that much of an overhead in this case.
anyway, for those that care, the result is up on github
so, this little snippet of code worked - may be useful for others
$ git init
$ git add -N foo.c
$ for i in `seq 16 22` ; do
cp -p hist/foo_$i.c foo.c;
GIT_COMMITTER_DATE="`date -R -r foo.c`" git commit \
--author "Fred Bloggs <fred.bloggs@example.com>" \
--date="`date -R -r foo.c`" -m "Version $i" foo.c
done
which you can then branch and commit as normal with current changes
Yes I could probably have done GIT_AUTHOR_DATE=$GIT_COMMITTER_DATE but well, 2 calls to date wasn't that much of an overhead in this case.
anyway, for those that care, the result is up on github
Monday, 4 April 2011
Bash, PS1, PROMPT_COMMAND and other fun
I've just spent 30 mins trying to understand the flow between the various files that set a bash prompt on fedora to do the following: (assumption is here that you're in a colour xterm)
I want:
* my username to change colour depending if I still have a valid kerberos token
* the hostname of the machine I'm on to be in RED if I'm root
* displayed path to be as simple as possible
* $ if I'm a minion, # if root as mormal
* command line editing to work sensibly, no wierdisms on wrapping long lines
so - I used to have on my machine something like the following:
and something similar for root.
But on my laptop (F14) I wanted it system wide, so went down the approach of customising /etc/bashrc where you find calls to
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
1) /etc/sysconfig/bash-prompt-* aren't included, so you're on your own
2) It must point to an executable script that is run every time before displaying the prompt
3) PS1 is still displayed *AND* if you use tab completion / ctrl-l, its *only* PS1 thats displayed on your screen, not the output from PROMPT_COMMAND
so: DON'T do the following:
because you end up with stuff like
aelwell@pcitgtelwell:~[aelwell@pcitgtelwell ~]$
until you press ctrl-l and end up with just
[aelwell@pcitgtelwell ~]$ (ie, $PS1)
but *DO* make the call to see if you have a valid token and set the xterm titlebar in /etc/sysconfig/bash-prompt-xterm, but if you're altering PS1, then do so in the traditional places of /etc/bashrc and (as suggested in that file) a custom modification shell script in /etc/profile.d/ directory.
Ho Hum. Hope this clears up for anyone else trying to work out what the sysconfig/bash-prompt-* files do.
oh, and does anyone know a lighter call to see if a token is still valid than 'klist -s'?
I want:
* my username to change colour depending if I still have a valid kerberos token
* the hostname of the machine I'm on to be in RED if I'm root
* displayed path to be as simple as possible
* $ if I'm a minion, # if root as mormal
* command line editing to work sensibly, no wierdisms on wrapping long lines
so - I used to have on my machine something like the following:
if [ "$PS1" != "" ] ; then
klist -s
if [ $? -eq 0 ] ; then
PS1='\[\033[32m\]\u@\h\[\033[0m\]:\w\$ '
else
PS1='\[\033[36m\]\u\[\033[32m\]@\h\[\033[0m\]:\w\$ '
fi
fi
and something similar for root.
But on my laptop (F14) I wanted it system wide, so went down the approach of customising /etc/bashrc where you find calls to
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
1) /etc/sysconfig/bash-prompt-* aren't included, so you're on your own
2) It must point to an executable script that is run every time before displaying the prompt
3) PS1 is still displayed *AND* if you use tab completion / ctrl-l, its *only* PS1 thats displayed on your screen, not the output from PROMPT_COMMAND
so: DON'T do the following:
(where ^[ is 'ctrl-v, esc' in vim)
cat /etc/sysconfig/bash-prompt-xterm
#!/usr/bin/env bash
# set green username if we have a valid kerberos token, else cyan
klist -s
if [ $? -eq 0 ] ; then
K='[32m'
else
K='[36m'
fi
# set hostname in red if we're root, green otherwise
if [ ${USER} = 'root' ] ; then
U='[31m'
else
U='[32m'
fi
printf "^[%s%s^[[37m@^[%s%s^[[0m:%s " ${K} ${USER} ${U} ${HOSTNAME%%.*} "${PWD/#$HOME/~}"
#echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"
because you end up with stuff like
aelwell@pcitgtelwell:~[aelwell@pcitgtelwell ~]$
until you press ctrl-l and end up with just
[aelwell@pcitgtelwell ~]$ (ie, $PS1)
but *DO* make the call to see if you have a valid token and set the xterm titlebar in /etc/sysconfig/bash-prompt-xterm, but if you're altering PS1, then do so in the traditional places of /etc/bashrc and (as suggested in that file) a custom modification shell script in /etc/profile.d/ directory.
Ho Hum. Hope this clears up for anyone else trying to work out what the sysconfig/bash-prompt-* files do.
oh, and does anyone know a lighter call to see if a token is still valid than 'klist -s'?
Friday, 1 April 2011
Daily WTF Candiate
(Credit for spotting this one goes over to the fine folks at scotgrid who were bitten by the fallout.
Anyway, Useless Use of Cat^H^H^HMore award goes to http://bit.ly/dI2W3c
Anyway, Useless Use of Cat^H^H^HMore award goes to http://bit.ly/dI2W3c
Subscribe to:
Posts (Atom)
Ressurection of a WirelessThings OpenPi (from kickstarter)
Many years ago, I was handed one of the openpi kickstarter devices (see https://www.kickstarter.com/projects/wirelessthings/openpi-wireless-...
-
During the trials of concerto at CERN, I wanted to make the text fields a bit more dynamic like say following a specific twitter feed. This...
-
Since there's no european satellite stream of Nasa TV it means you have to watch a streamed version over here. Also I'd like to w...
-
We have a small cabin on the site that used to have a 200w panel, 65Ah deep cycle lead acid battery, el-cheapo PWM charger to power some LED...