Recent blog entries for elwell

Fedora Catchup

The couple of packages I maintain in Fedora have been sitting stable for so long that I've not really had much to do with Fedora recently (that, and getting a mac laptop for $work), but I've just discovered https://badges.fedoraproject.org/ so it's now time to claim a few extras (oh, and push an update to PyEphem while I'm at it...)

Syndicated 2014-07-10 07:10:00 (Updated 2014-07-10 07:10:49) from Andrew Elwell

Happy Cheeks vs SuSE Chameleon

Happy Cheeks imprisoned in a Cray

Kids today. Joyriders in the supercompute cell
Friday Afternoon, and Operations staff are summoned to the Pawsey Centre as the evil SuSE chameleon has been chasing Happy Cheeks (the iVEC Quokka) around the supercomputing cell.

Happy Cheeks and Chameleon explore 'Magnus' 
Happy Cheeks and Chameleon on Galaxy
Inspecting the layout for the Petascale expansion

Being Chased



Syndicated 2014-06-06 06:47:00 (Updated 2014-06-06 06:47:59) from Andrew Elwell

Pretty Colours via MQTT

What does a geek do when they have some spare RGB LED strip (addressable WS2812B) and some cheap nasty LED devices? LED transplant time...

So, first to go was the LED glass prism stand received as a christmas present - out went the potted pcb with three fading LEDs, and in went a single piece of RGB strip fixed in place with a hot glue gun.
wire comes out the bottom and goes to a nanode.

So far so good, but I don't just want fixed or fading colours so time to revisit an IoT idea: Cheerlights

The cheerlights API defines 10 colors that can be set, but I want the possibility of sending any RGB value, so I created @FakeCheerlights as an MQTT series of topics on the test.mosquitto.org broker

fakecheerlights/rgb
fakecheerlights/colour
fakecheerlights/raw

which contain the hex RGB value, the identified colour name and the raw tweet.

A separate script (running on the NAS) uses the twitter API via tweepy to follow the twitter stream search for 'cheerlights' and 'fakecheerlights' mentioned in a tweet. If a colour name (matched from the X11 rgb.txt) is found then it publishes the corresponding hex value to the broker

Since fakecheerlights uses a publish/subscribe model, it's *much* faster to react than the original cheerlights protocol which relies on a client polling the server API. The downside is there's no nice fade time between colours.

The nanode (I have one of the earlier batches) was designed as a low-cost ethernet enabled arduino, so uses the Microchip ENC28J60 ethernet rather than the wiznet of the arduino shield. Thanks to UIPEthernet.h and PubSubClient.h it's just possible to code in a basic subscriber which sets the strip output to match.

Since I plan to use the pub/sub model at work for monitoring the machine status and batch queues, I gutted an old ikea childs lamp and replaced the LED with another WS2812B and hooked that up to a freetronics etherten with a PoE daughterboard attached. Sadly the hardware revision I had didn't include the MCP 24AA025E48 that my old nanode did, so my sketch had to include a hard-coded MAC address.

A short youtube video demonstrates the reaction time, and all the source code is on github. (with the exception of the nanode sketch as I didn't save it before closing the arduino ide)

Syndicated 2014-05-19 17:08:00 (Updated 2014-05-19 17:08:23) from Andrew Elwell

The Internet of Meh

Yes, I know there are some very talented, hardworking people busy making "The Internet of Things" (IoT) a reality, and yes, there's even some govt money available just now. However there's still a huge hurdle to overcome before it will ever progress beyond a geek hobby.


Example 1: We have a solar PV system installed (Peak output 2500W) and happen to live in a Damn Sunny place. Great. So far it's chucked out ~2400kWh. Our daytime loads are the evaporative aircon (variable speed 1500w motor) and the pool pump (1600W, fixed speed, needs to run for ~8h day in summer). Together with 'normal' modern household appliances of Washing machine and dishwasher we *should* be able to balance our house load so we're roughly running "grid neutral" -- ie hardly importing or exporting during day. With the current tarrifs (feed in 8c/unit, consumption, 28c unit) it's just not cost effective to put a huge array up (ignoring the fact that we're restricted to 5kW max feed in anyway, and don't have unlimited roof space).

What I want is some smart magic load shedding intelligence - if we have sun, make sure pool pump has run for minimum amount of time. Look at weather forecast - no clouds predicted, take a chance on there being sun up till sunset (so we can predict insolation and expected output) and run for 4h morning, 4h afternoon. Spare capacity? sure - lets ramp up aircon and cool the house a little more comfortably. Oh wait - unexpected load? (dishwasher / WM on a daytime cycle) - back off the aircon, if its the dishwasher, we know that heating cycle will be over in X mins, so suspend the pump.

Sounds lovely right? sure it can be manually done watching the display on the PV inverter and the main electricity meter, but there's gotta be a better way. Well Tough. In Australia a standard domestic fusebox lurks outside, and has max 30 ways. Unless you're a licenced electrician, any poking in here is illegal, and so will cost you contractor rates. How many hours of sparky work (excluding any materials) will it take to make any cost savings negligible. Not Many. Boo.

So, what about appliance control at the "heavy users" directly? RJ12 connector on the bottom of pool controller -- lets ask the manufacturer - do they make an interface? No. Can I get the spec?
"All of our equipment uses an dedicated communication system designed purely for our own use.  Our comms system is not compatible with any other equipment and here is no protocol that we can release for external use."
Maybe not then. Perhaps try Breezair? Similar story.

So, everything has to be reverse engineered (needing skills and tooling) or you pay an integrator (no there aren't any) who will charge $$$$ to do this based on previous work. Current state: Ongoing as a spare time project. Mutter.


Example 2: Air Quality Egg.
Launched with a great flourish and fanfare 2 years ago. OK there were issues with producing the prototypes, but judging from the map, there's now quite a few of us with shields, eggs and more up and running.

Now what? where's the "one year on... report with a few pretty graphs. Even if its a case of "hmm variation is too high to make out anything reasonable" at least let your users know what's going on. Otherwise they'll get bored.

How can I compare my results with others around Perth? Not easily -- takes some hacking of the site to get the raw pachube^Wcosm^Wxively feed ID and then poll it and feed into gnuplot. End-User friendly? I think not.


I *like* the idea of IoT -- it does have the potential to help do clever things - but unless the glue and costs to end user are reasonable it's just not going to take off. Yet.


Syndicated 2014-03-10 09:36:00 (Updated 2014-03-10 09:36:48) from Andrew Elwell

Low-Level hardware hacking

In our 3 shiny new computer rooms (supercompute, IO, Tape - Each with slightly different environmental and cooling requirements), the architects have fitted a single temperature sensor on the back wall. Out of the airflow. This isn't giving us a terribly accurate picture of the supply air going into each rack, and so an alternative DIY method is underway.

A Raspberry Pi in each room (small, low enough power that it can be fed from PoE via a splitter) acts as the local 'head' and grabs the data to send it to a central message broker. From there, we can choose what to do and how to display it.

The sensor hardware consists of: A single DHT22 attached near to the Pi - As useful as these are on an arduino, on a R-Pi they are a bit harder due to the need for timing. The Adafruit interface for these grabs directly from memory address and seems well, a bit hacky. As suggested on IRC, a proper kernel module may be helpful. hint for someone else to complete :-)

The main sensor array is a set of DS18B20 sensors from fleabay (cheap if you're ordering 50 at a time) attached to the sheepwalk i2c interface 'RPI2'. These are then strung around to suit depending on location (ie, for our watercooled racks I'm going to affix the sensors directly to the flow/return lines on the watercooled racks to give us the delta-T across each set of door radiators (The BMS only gives flow/ret temp overall) which when tied to the internal temp sensors in the back of the racks should give us an idea of how well we're shifting the heat away from the machines. All this hardware comes in at less than 100 AUD per room - and some soldering time to make up the sensor chains to suit. To get an idea of the stratification (and therefore how do we position floor tiles relative to the overhead extraction vents) I'm going to put 15-20 sensors on a piece of plastic waste pipe to get a nice vertical profile - cue trip to bunnings (local DIY store) later this weekend.

Software

Hat-tip to the excellent MQTT people - nice n simple to use a python publisher script to send to a mosquitto broker on the lan. From there we can republish to Xively (useless as it doesn't respect timezones in the plotting so I can only see data I sent 8h ago...), Google spreadsheet (in a refactor of the original adafruit idea, and currently to a simple python curses console
Once we go into production and kit is running properly I plan to use the broker for all the machine status info and we'll dispatch accordingly for alarming.

More info and code will appear at https://github.com/ivecops/EnvMon

Syndicated 2013-05-25 07:06:00 (Updated 2013-05-25 07:06:57) from Andrew Elwell

Internal Gravatar type service

Since arriving at my new job (excellent ta, thanks for asking) I've once again come across some internal pages that it'd be nice to associate mugshots with (thumbnail is fine) in a service just like gravatar offer. In fact, exactly like gravatar offer... then it could be used with some minimal URL re-writing and minor code changes in applications


IMHO when you have a corporate photo-id upon your person, then this should be available on the intranet - it shouldn't be *that* hard to use the same algorithm on a small webserver vhost to select a suitably sized photo (since its corporate, these can be mapped automatically to LDAP or some other identity management service) entries.

Perhaps I'll have a code, but not next week as we have new toys arriving from our vendor (rhymes with  'play') finally :-)

Syndicated 2013-05-16 15:05:00 (Updated 2013-05-16 15:05:56) from Andrew Elwell

qlock something clone

Much as I like the design of the qlock two, I really can't ever justify the price of buying one. Although there are designs for clones on instructables.com, I'm going to rework the design using addressable RGB strips rather than individual white LEDs - it means there's more work in the woodwork of the casing (to prevent bleeding to adjacent cells) but should provide for nicer coloring - being able to fade in the current time from the background colour (which will be hooked to the house MQTT feed for things like power / temperature etc) Oh, and it'll be NTP synced.

Not sure what I'll use as the main controller yet - possibly a R-Pi as its a bit more flexible than the standard arduino. Anyway, once I've worked out the pitch, it's time to learn vcarve down at the local hackerspace.

Syndicated 2013-02-09 07:46:00 (Updated 2013-02-09 07:46:33) from Andrew Elwell

Virtual hostnames with Debian and dhcp

At $dayjob we have a large number of Linux Virtual Machines runnining on Hyper-V.

Most of these run Scientific Linux / Scientific Linux CERN, but we have a requirement to run debian hosts too.

Some observations that may help others:

Linux Integration Components
Even the latest MS ones (3.4 at last count) don't support debian / ubuntu. Hoever if you're running squeeze (6.0.x) then there's a 3.2 backport kernel available in debian backports that seems to work fine

Templates / DHCP hostnames
I noticed that our debian template host wasn't setting the hostname (assigned via dhcp) so using the example at http://nullcore.wordpress.com/2011/12/09/setting-the-system-hostname-from-dhcp-in-ubuntu-11-10/ I worked on a similar script that doesn't end up with a trailing period in the FQDN and appends to /etc/hosts if needed

lo:<pre>

#!/bin/sh
# Filename:     /etc/dhcp/dhclient-exit-hooks.d/hostname
# Purpose:      Used by dhclient-script to set the hostname of the system
#               to match the DNS information for the host as provided by
#               DHCP.

# Based on http://nullcore.wordpress.com/2011/12/09/setting-the-system-hostname-from-dhcp-in-ubuntu-11-10/

# Do not update hostname for virtual machine IP assignments
if [ "$interface" != "eth0" ]
then
    return
fi

if [ "$reason" != BOUND ] && [ "$reason" != RENEW ] \
   && [ "$reason" != REBIND ] && [ "$reason" != REBOOT ]
then
        return
fi
hostname=${new_host_name}.${new_domain_name}

#echo dhclient-exit-hooks.d/hostname: Dynamic Hostname = $hostname
#echo dhclient-exit-hooks.d/hostname: Dynamic IP address = $new_ip_address

echo $hostname > /etc/hostname
/etc/init.d/hostname.sh

# and append to hosts
grep -q $hostname /etc/hosts
if [ $? -eq 1 ] ; then
     echo "$new_ip_address $hostname $new_host_name" >> /etc/hosts
fi

</pre>

Syndicated 2012-12-05 13:44:00 (Updated 2012-12-05 13:44:54) from Andrew Elwell

Rant


[aelwell@pcitgtelwell ~]$ man dvbnet
No manual entry for dvbnet
[aelwell@pcitgtelwell ~]$ dvbnet --help

DVB Network Interface Manager
Copyright (C) 2003, TV Files S.p.A

dvbnet: invalid option -- '-'
Segmentation fault (core dumped)
[aelwell@pcitgtelwell ~]$ dvbnet -h

DVB Network Interface Manager
Copyright (C) 2003, TV Files S.p.A

Segmentation fault (core dumped)




that is all.

Syndicated 2012-11-26 13:42:00 (Updated 2012-11-26 13:42:24) from Andrew Elwell

k-net / ipv6 / toastman / tomato USB

I have a reflashed router using the toastman mod - which works really well *but* the ipv6 configuration pages miss out one crucial setting when configuring the native ipv6 stack from k-net here, notably the WAN ipv6 address...

ssh root@router and
# ip addr add 2A03:4980::XXXX/96 dev vlan2 (IP D'interco)
# ip -6 route add default via  2A03:4980::11:0:1 (Gateway)

and lo, it should now work from clients on lan.

Blogging so I know where to find the info next time...

Syndicated 2012-11-14 22:34:00 (Updated 2012-11-14 22:34:49) from Andrew Elwell

100 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!