Older blog entries for elwell (starting at number 88)

Teleinfo update

I''ve been using a teleinfo shield on a nanode to try and datalog our electricity usage, but the logging to the CSV file kept truncating as if the arduino had locked up. There have been discussions elsewhere that this may be related to the code in arduino 1.0 so I decided to rewrite a step at a time to try and debug the problem.


Some observations on the way:
1) having to flip a jumper over on the shield between programming and run is *very* annoying in a cold garage, so I'm going to rewire it slightly to use SoftwareSerial on a spare input (leave JP1 open and wire from one side of it to a spare pin) - I already have a link since the shield tries to use DIG6 by default which is used by the red LED on a nanode.

2) the arduino IDE doesn't like anything other than 8N! on the serial monitor. close it and use kermit. if you can't read serial with kermit, then it's *very* broken :-)

3q) our usage is going UP not down :-( -- lowest figure I managed to get the baseline to was 340VA

With a very simple logger

    Serial.print(char(meter.read()));
I can stream the output to a kermit session log as
^B
ADCO 040222048573 <
OPTARIF BASE 0
ISOUSC 30 9
BASE 040912359 ,
PTEC TH.. $
IINST 002 Y
IMAX 029 J
PAPP 00340 (
MOTDETAT 000000 B^C
next trick is to try and get the processing organised into blocks and validate the checksum, but my code doesn't seem to detect the stx/etx properly
void loop() {
if(meter.available()>0) {
  if((c = meter.read()) == 02) {     // start of block
    Serial.println("DEBUG: Start Loop");
    while((c = meter.read()) != 03) {      // Loop until end of block
      Serial.print(char(c));
    }
    digitalWrite(LED, LOW); // Flash LED
    delay(50);
    digitalWrite(LED, HIGH);
  }
}
}
so mode debugging called for. Once thats done, then I'll send the values to an emon style display over rfm12b

Syndicated 2012-02-21 10:15:00 (Updated 2012-02-21 10:30:48) from Elwell

31 Jan 2012 (updated 31 Jan 2012 at 21:37 UTC) »

plaquewatching

Some scribblings that may be of interest to those folks over at open plaques (@openplaques) about the Scottish Film Council, now merged into 'Scottish Screen'

Googling for plaque info reveals that there was a plaque erected in 1996 in Castle Gardens, Dunoon. Later taken down as Eric Campbell came from Cheshire (Ref)

One in Aberfeldy main square unveiled in 1997? for Donald Crisp -- may also be fake (ref) [1353]

Sean Connery unveiled his own one after it had been down for 4 years (ref, ref) after the demolition of S&N plant and building of 'Springside' development [8553]

Chariots of fire at St Andrews (pic pic) [added as 8822]

Duncan Macrae in Millport (pic) [already there as 8521]

Syndicated 2012-01-31 20:23:00 (Updated 2012-01-31 20:49:25) from Elwell

27 Jan 2012 (updated 27 Jan 2012 at 12:35 UTC) »

Fedora / Netatalk / OS X Lion / TimeMachine

Being the cheapskate that I am, I'm not buying a shiny apple-branded time-capsule for backups when I have a perfectly stylish NAS (since the pic was taken I'm using the via-eden board there's a 1.5TB HDD in the box)

I'd previously used netatalk with leopard under mythbuntu, but following a clean-up and migration to Fedora 16 (Verne) it needed reinstalling (esp as we upgraded to Lion on some of the macs)

So, a HOWTO if anyone is hunting for this and some notes

  • You don't need avahi separately anymore - new netatalk includes it
  • You need to allow tcp/548 in your iptables rules (I added to /etc/sysconfig/iptables)
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 548 -j ACCEPT
  • SELinux. Yeah. probably needs fixing but 'setenforce permissive' worked :-/
  • I'm not convinced you need the 'defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1' anymore. 
Here's what I did

1) Create a separate disk partition for time machine and mount it (I'm using LVM and XFS)

$> grep time /etc/fstab
/dev/mapper/linuxvg-timemachinelv /export/timemachine xfs defaults 1 2
$> df -h /export/timemachine
Filesystem                         Size  Used Avail Use% Mounted on
/dev/mapper/linuxvg-timemachinelv  200G  6.0G  194G   3% /export/timemachine
2) create a separate user for the backups (not strictly needed but I chowned /export/rimemachine to that user to sort out permissions
#> useradd timelord
#> passwd timelord
#> chown timelord: /export/timemachine
3) Install and configure netatalk (although 2.2.0 is in Fedora 16, I decided to use the rawhide version of 2.2.2)
#> yum --enablerepo rawhide install netatalk
The config files are in /etc/netatalk and (see the gude at An Esurient Trollop ) you'll need to edit afpd.conf
(I added -mimicmodel Macmini and uams_guest.so to -uamlist: I have a ro media share)

- -tcp -noddp -mimicmodel Macmini -uamlist uams_guest.so,uams_dhx.so,uams_dhx2.so -nosavepassword
and AppleVolumes.default
# Share out the Videos
/export/media/Video Videos options:ro,noadouble
#Time Machine
/export/timemachine TimeMachine options:tm
Startup netatalk
#> systemctl start netatalk.service
#> systemctl enable netatalk.service
 So far so good -- assuming no failures you should see something like this in your logs
afpd[28742]: AFP/TCP started, advertising 192.168.1.251:548 (2.2.2)
Now, onto the mac -- I wasn't seeing the host automatically appear in the finder, but a simple command-k (connect to server) and typing the hostname worked (it expands to afp://hostname automatically), and was prompted for my (normal) username and password to connect to $HOME on the netatalk server.

In the time machine preferences I could then select the remote TimeMachine volume on the NAS, enter my 'timelord' username/password combo and it started to so a backup.

More news (and a rest restore) to follow...

Syndicated 2012-01-27 08:55:00 (Updated 2012-01-27 11:52:32) from Elwell

15 Jan 2012 (updated 27 Jan 2012 at 11:40 UTC) »

Metering

So I finally got round to wiring in the 'Teleinfo' shield into my EDF meter (see my earlier post for more info) and left it running while we're away. Hacked up an initial couple of graphs using trusty gnuplot: exhibits A and B -

It's rather easy to spot where the fridge-freezer kicks in, but more worrying is the fact that the baseline never dips below 170VA. The only things that should have been running in that time was my via-eden server, with one HDD, the livebox and samknows monitoring box. I suspect I need to investigate more.

Made a minor hack to the shield as digi-6 is used by the LED on a nanode - but digi-7 is free.
Details were tweeted over here. Next up is to get it sending the info out to main box (well, another nanode or my bifferboard) and spitting to pachube and / or a jeelabs display board.

Syndicated 2012-01-15 22:34:00 (Updated 2012-01-27 10:49:08) from Elwell

Happy Birthday

I finally got round to assembling my birthday present. Shiny toys FTW :-)


Syndicated 2012-01-06 12:28:00 (Updated 2012-01-06 12:28:32) from Elwell

The Perils of CDNs

So CERN have just held a popular webcast event to announce the latest results in the search for the Higgs. Many of the webcast viewers (no I don't have usage stats) were complaining that the stream was choppy. What I did notice on my laptop (couldn't get near the auditorium) was that the main libflashplayer traffic was inbound from 93.174.99.0/24 VELOCIX-EU - could this be the CDN used by Groovy Gecko?

Not having an onsite mirror though then meant that each member of staff watching was then pulling data *in* to site as the traffic graph shows:



I'm sure this can't be efficient... Ho Hum.


Syndicated 2011-12-13 15:19:00 (Updated 2011-12-13 15:19:06) from Elwell

Another year of LHC Secrecy

So, another year of LHC running comes to a successful close, Once again we've managed to keep the real facts hidden from everyone - Not the Higgs (as thats's being discussed next week) but more importantlt that the whole of the LHC is actually a spinoff from one of the major Data Centre companies who had outgrown their shed. The Proof? why - of course...

however, best to keep it a secret - its easier to get runding for a mythical 27km tunnel than a shed :-) Oh, and a lot less sexy in the books too...

Syndicated 2011-12-08 14:44:00 (Updated 2011-12-08 14:57:51) from Elwell

25 Nov 2011 (updated 27 Jan 2012 at 11:40 UTC) »

Sniff...


Updated to include the plots from monitoring box:

Syndicated 2011-11-25 13:12:00 (Updated 2012-01-27 10:48:46) from Elwell

24 Nov 2011 (updated 24 Nov 2011 at 14:05 UTC) »

FTTH update

So, I'm still (till I move flat) with k-net at the flat, and have a monitoring whitebox hanging off my router.

So Far, speed has been consistenly high - downloads in the 90Mb/s range. They are only (heh, 'only') seeing uploads of ~30Mb/s, but I know I can get higher than that using a box closer to the reso-lian network or to work.

Sniff, anyway thats only till the end of the month and then I'm back to orange.fr till May. Somehow I don't think I'll be getting this off my ADSL line...

Syndicated 2011-11-24 10:55:00 (Updated 2011-11-24 13:47:25) from Elwell

PoE Network controlled signage

I may have a requirement for several 'remote controlled' illuminated signs. (where remote could be network driven) - These aren't Scrolling LED 'calls in queue' type ones, but more the warning 'Laser on', 'Mic Live', 'Conveyor Running' type ones.

Normally these things seem to be driven directly from some local switchgear or output, but what if you want to gather status centrally , or illuminate the sign depending on some remote sensor (be it a web tsunami alert or the boss' car being picked up on the ANPR at the gate)

Cue a quick hacky prototype: Take one nanode and use the digital outputs to drive a mosfet to switch some cheap LED strips from IKEA. So far so good, but that requires a 12v (since thats what the strips use) supply. The nanode can take that on the screw inputs if you add a heatsink to the reguator, but I'd rather get rid of the PSU alltogether: cue a cheapo 802.3af PoE splitter from TP-Link, and I have the whole lot driveable off one RJ45 cable.

Onwards to software, and it looks like bitlash / restuino look useful (esp if I get the whole lot working with DHCP too).

Anyway, with a range of lighting areas possible (thanks to addressable outputs on the nanode) per display, the option to have a nice facia with multiple 'zones' illuminated is possible. Now to find a nice case...


Syndicated 2011-09-28 21:00:00 (Updated 2011-09-28 21:00:26) from Elwell

79 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!