<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Kate&#039;s Comment</title> <atom:link href="http://www.katescomment.com/feed/" rel="self" type="application/rss+xml" /><link>http://www.katescomment.com</link> <description>Thoughts on British ICT, energy &#38; environment, cloud computing and security from Memset&#039;s MD</description> <lastBuildDate>Tue, 01 May 2012 16:20:55 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Green Economy Council &#8211; May 2012 (green skills &amp; adaption)</title><link>http://www.katescomment.com/green-economy-council-may-2012-green-skills-adaption/</link> <comments>http://www.katescomment.com/green-economy-council-may-2012-green-skills-adaption/#comments</comments> <pubDate>Tue, 01 May 2012 16:20:55 +0000</pubDate> <dc:creator>katecw</dc:creator> <category><![CDATA[Environment]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1563</guid> <description><![CDATA[These are my raw, unedited notes from the latest green economy council meeting. I thought some of you might find it interesting to have an insight into the sorts of things that we discuss. Updates from the ministers Rt Hon Vince Cable MP &#8211; BIS New philosophy of cross-sector and cross-specialism collaboration, pioneered/exemplified by the GEC has become increasingly embedded...]]></description> <content:encoded><![CDATA[<p>These are my raw, unedited notes from the latest green economy council meeting. I thought some of you might find it interesting to have an insight into the sorts of things that we discuss.</p><h2>Updates from the ministers</h2><h3>Rt Hon Vince Cable MP &#8211; BIS</h3><p>New philosophy of cross-sector and cross-specialism collaboration, pioneered/exemplified by the GEC has become increasingly embedded in government.</p><p>Talked a bit about catapult centres &#8211; focussed on long term innovation at interface between universities and business.</p><p>Green investment bank is potentially an enormously important institution in the longer term. Frustration: what is actually happening? First £80 million is being dispersed through two specialist fund managers. Waste management and industrial energy conservation. GIB is able to proceed even without EC support &#8211; money is getting out of the door. Budgeted £800m this financial year.</p><p>Energy intensive industries: sub group focussing on how we deal with the support mechanisms for EIIs (eg. steel, disadvantaged by high electricity prices). Going through a consultation to define exactly what the sectors are. Electricity markets review will address which areas to focus on.</p><p>- I welcomed the review on EII&#8217;s and the review of the CRC in the context of data centres, which to date have not really been recognised as an EII. Vince asked if we were contributing to the EII consultation. I said we were but have double-checked with Intellect!</p><h3>Greg Barker MP &#8211; DECC</h3><p>Last week hosted clean energy ministerial &#8211; conference of 20 largest energy economies around the world. Everything from generation to driving forwards CCS. Results: greater cooperation on off-shore, floating wind turbines between UK &#038; US. £25m(poss 250?) for SMEs to demo renewables(?). Additional £60m (on top of existing £1bn investments) to demonstrate CCS in developing countries (opportunity to get UK companies into that space).</p><p>Main programme is green deal: Most important that DECC will deliver this year &#8211; greatest potential as a driver of growth.</p><p>Are creating 1,000+ green deal apprenticeships. Set to launch green deal this Autumn. Mentioned challenges faced by utility companies who are having to augment their IT systems to be ale to cope.</p><p>Also looking at how to deploy the £200m of incentives made available in the budget for the green deal in the first 18 months.</p><p>Is deliberately very broad in order to encourage innovation and bring in new products as well as the existing ones.</p><p>Also talking to supply chain about Renewables Heat Incentive(?) to try and get more applications. 421 applications made, 41 accredited to the scheme. Just under 200MW of heat under scheme. Main focus is on business but intend to expand into domestic space too. Dissapointed that most of the large scale RHI kit is actually coming from Germany &#8211; can count British suppliers on one hand.</p><p>Had to step in last year to bring solar benefits in hand (double-digit, inflation-proofed benefits was a bit too good to be true!). Sounds like it will continue but they are being flexible on the budget with an aim to maximise deployment &#8211; 1m solar deployments by 2015 is the target. Are aware that industry&#8217;s confidence due to this intervention has been knocked and they wish to rebuild that.</p><p>- In response to question on bad press green deal is getting:<br
/> Needs our (industry&#8217;s) help &#8211; is in everyone&#8217;s interest to make work. What can DECC do to drive confidence in the green deal? Feedback from around the table:<br
/> &#8211; The sole trader / SME did not see how they could engage with the green deal: messaging to them that it is for everyone needs to get across.<br
/> - Needs a government-industry joint campaign.<br
/> &#8211; See great opportunity for job creation, especially among youth, as well as green benefits. Don&#8217;t want to see longer-term vision diminished.</p><h3>Richard Benyon MP / DEFRA</h3><p>They would like to see a &#8220;blue&#8221; (water) element to the green deal. Watching the green deal with close interest.</p><p>Natural capital: $2.9tn is the global resource inefficiency (according to McKinsey) (context: minerals/metals). One of their focus areas &#8211; where do such resources come into and leave the country.</p><p>RIO+20: Deputy PM will be heading the British delegation. Good business engagement to date. Really want to send a message at Rio that the green economy is being driven by business.</p><h2>Tim Balcon &#8211; Green skills</h2><p>Briefly ran through the skills paper.</p><p>I said: Danger that the definition of green skills is focussing too much on utility, renewable energy and green deal skills, and vocational-level training &#8211; taking a rather vertical view of skills. Engineering and technology has huge potential to green the economy but would not generally be classed as being in the &#8220;green&#8221; sector &#8211; need more STEM skills!</p><p>Made point that we are already struggling to find enough recruits and that was hampering our innovative capabilities. To be an innovative leader in the low-carbon space the skills we need are STEM-based, which is where the shortage is. VC asked if what level our apprenticeship is &#8211; I replied that our general requirements were quite high (degree level) but we were expanding downwards</p><p>Several members supported my call for more STEM skills (Ford &#038; Aldersgate group to name two).</p><p>Peter Young (Aldersgate) mentioned that there were no numbers in the paper / no evidence. Advocated a more analytic study into where we actually need the core skills, to identify the unarticulated need. Need numbers to show how large opportunities are, and to help avoid issues like that Greg mentioned on RHI (ie. not enough suppliers in the UK!).</p><h2>Adaption to climate change</h2><p>Richard Benyon talked about the climate change adaptation paper.</p><p>Many of his examples were from ICT (Vodafone flooding in Turkey, Dell w Thai disk flood) so I reminded the council that in fact ICT was one of the more resilient areas thanks to the interlinked nature of our facilities, and that we now tended to avoid building data centres on flood plains!</p><p>I made Emma&#8217;s point though about needing case studies, good and bad, in order to galvanise action. Most companies don&#8217;t do a proper ISO27001-style risk assessment so may not have thought of the risks. Case studies would likely help that a lot &#8211; &#8220;It could happen to you&#8221; etc.</p><p>I also articulated ICT&#8217;s key role in modelling and predicting risks.</p><p>Broad support around the table for the case studies idea.</p><p>Richard responded mentioning some impressive systems that can predict flooding risks down to house level.</p><p>Some discussion on insurance &#8211; issues and usefulness as a predictor.</p><p>Supply chain: Richard mentioned how fragile basic things like the food supply is &#8211; we operate a &#8220;just in time&#8221; model and, for example, a massive amount of food has to cross the M25 each day. We take it for granted!</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/green-economy-council-may-2012-green-skills-adaption/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>BOB 3.0 &#8211; construction</title><link>http://www.katescomment.com/bob-3-construction/</link> <comments>http://www.katescomment.com/bob-3-construction/#comments</comments> <pubDate>Sun, 29 Apr 2012 21:58:00 +0000</pubDate> <dc:creator>katecw</dc:creator> <category><![CDATA[Hacking]]></category> <category><![CDATA[hacking]]></category> <category><![CDATA[robotics]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1549</guid> <description><![CDATA[I have recently completed a major upgrade of BOB, mainly adding a plethora of new sensors. The picture below gives an overview: Head BOB&#8217;s head needs to be able to turn for &#8220;pet like&#8221; behaviour and to maximise the usefulness of the &#8220;ears&#8221; and ultrasonic sensor. Having added several sensors to BOB&#8217;s head meant that the cabling was going to...]]></description> <content:encoded><![CDATA[<p>I have recently completed a major upgrade of BOB, mainly adding a plethora of new sensors. The picture below gives an overview:</p><p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB2.jpg"><img
style="float: center; padding: 10px; width: 650px;" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB3.jpg" alt="" /></a></p><h3>Head</h3><p>BOB&#8217;s head needs to be able to turn for &#8220;pet like&#8221; behaviour and to maximise the usefulness of the &#8220;ears&#8221; and ultrasonic sensor. Having added several sensors to BOB&#8217;s head meant that the cabling was going to become a problem, though. I needed to use sensor multiplexers (SMUXs) anyway so I attached one of them to the back of his head so that I could just have one wire coming out of the head unit. The fiddliest part of constuction was building the head so that it was reasonably-well balanced and able to rotate through 180 degrees.</p><p>At present his head is still mounted on a single shaft with a 1:1 gearing ratio to the central horizontally-mounted motor. It is proving a little difficult to precisely rotate it and for the next version I will likely introduce some down-gearing.</p><h3>Wiring</h3><p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB2-wiring2.jpg"><img
style="float: right; padding: 10px; width: 300px;" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB3-wiring2.jpg" alt="" /></a>One of the new challenges faced by this upgrade was a lot of additional wiring. I could not find anywhere that sold suitable cables and the Lego ones were insufficiently flexible or too long for most of my purposes anyway. <a
href="http://www.craig-wood.com/nick">Nick</a> bought me <a
href="http://www.amazon.co.uk/dp/1590598180" target="_blank">Extreme NXT</a> (a book) for my birthday which describes how to make your own. The connectors are simple straight-through 6 wires with variants on standard RJ11&#8242;s.</p><p>I bought some standard telephone cable with six solid cores for most of the wires, especially the short ones. To make the RJ11&#8242;s fit into the sockets you just have to trip off the left hand side of the little plastic clip with some wire cutters. Most of the cables did not need to flex so the the solid-core was fine for that. See the diagram on the right.</p><p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB2-wiring.jpg"><img
style="float: left; padding: 10px; width: 300px;" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB3-wiring.jpg" alt="" /></a>For the powered SMUX &#8211; the touch multiplexer (TMUX) does not need power &#8211; I used multi-cored ethernet cable which has eight wires. I used the spare two wires to deliver power to the SMUX&#8217;s, which I felt was an elegant solution. This was especially important for the head SMUX since the cable needed to be a) flexible and b) tidy so it would not get tangled.</p><p>I also determined that the SMUXs had fairly low power draw and although they each came with a 9v power cell unit it is possible to power several off one 9v battery. Therefore I used a simple bit of vero board to parallel the two SMUXs power wires together and feed them off a single 9v cell.</p><h3>Object detetion: Ultrasonic, optical distance and touch sensors</h3><p>BOB&#8217;s principal range sensor, which is used for avoiding objects, is the ultrasonic integrated into his head. However, it does not work well for fabric-covered obstacles such as sofas so I added a HiTechnic EOPD active light range finder to his left shoulder. Its effective range is under 10cm but it prevents him blundering into soft things!</p><p>The few objects he cannot &#8220;see&#8221; with the ultrasonic and optical sensors, such as low-down objects or vertical table/chair legs that don&#8217;t happen to line up, are caught by his front touch sensors. The rear touch sensors detect when he drives into a wall at a very oblique angle, at which point he looks to the side and adjusts his angle to follow the wall at a constant distance.</p><p>On experimentation the HiTechnic active colour sensor also works surprisingly well as a range finder. Though less accurate than the EOPD sensor it is perfectly adequate for detecting proximity as the signal increases from zero with brightness so you can determine rough distance. Its range for that purpose is also comparable to the EOPD sensor. Thus his secondary proximity detectors are balanced, one on each shoulder.</p><h3>Human interaction: Sound, infra-red and colour sensors</h3><p>A major addition to BOB since version 2 is his ears (left and right sound sensors) and infrared directional sensor, all mounted in his head. I have programmed him so that he can detect noises and swivel his head to attempt to get a bearing which, once determined, he uses in combination with his compass (hidden from view in the picture but in the same position to the accelerometer but on hig right flank) to determine a bearing, which he duly sets off towards navigating around obstacles as necessary*.</p><blockquote><p>*It should be noted that his code is still quite crude and while that is the aspiration he still often gets very confused! Sounds bouncing off walls are a particular problem that I&#8217;ve not quite yet solved, also I&#8217;ve not done anything yet to address him &#8220;getting lost&#8221; when going around big obstacles (he doesn&#8217;t have an internal map of any sort yet). Once I&#8217;ve ironed out a few issues I&#8217;ll post some videos!</p></blockquote><p>This means that I can now in effect &#8220;call&#8221; him to me, even from another room, but when he gets close his directional hearing loses any real accuracy so I added the infra-red (IR) sensor. I intend to wear an IR beacon on my ankle so that once he has used his &#8220;hearing&#8221; to determine my approximate location he can home in using IR. That actually is working out quite well since the IR&#8217;s effective range is only really a couple of meters.</p><blockquote><p><b>Infra-red challenges: One of the lessons I learned is that during daytime, even on cloudy, rainy days, there is an enormous amount of infra-red radiation around! The HiTechnic IR sensor picks up the Sun&#8217;s IR that you can&#8217;t feel as heat as a very bright source which interferes significantly with its detection of a tuned beacon unless it is quite close. I&#8217;m having to do a lot of optimisation of the of the IR detection routines.</p></blockquote><p>As well asa secondary range finder I&#8217;ve programmed BOB to use his colour sensor so I can give him instructions. For example, when he detects the colour of my skin he stops which is useful for debugging (I can just hold out my hand then read his logs which he writes to his screen) and he also &#8220;knows&#8221; he has found me. I&#8217;ve been using other colours to change into different modes (eg. follow wall, go to nearest sound even if quiet, etc).</p><h3>Accelerometer</h3><p>The accelerometer is there for two reasons: 1) so that he can detect when he is picked up and 2) so that he can detect the tilt when he is about to fall down some stairs!</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/bob-3-construction/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Energy-efficient cloud computing: Jevons Paradox vs. Moore&#8217;s Law</title><link>http://www.katescomment.com/energy-efficient-cloud-jevons-paradox-vs-moores-law/</link> <comments>http://www.katescomment.com/energy-efficient-cloud-jevons-paradox-vs-moores-law/#comments</comments> <pubDate>Thu, 26 Apr 2012 13:38:36 +0000</pubDate> <dc:creator>kolver</dc:creator> <category><![CDATA[Environment]]></category> <category><![CDATA[cloud]]></category> <category><![CDATA[virtualisation]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1504</guid> <description><![CDATA[I am in my final year of a part-time PhD attempting to answer whether Moore&#8217;s Law (which has accurately predicted that computational power will roughly double per unit of cost or unit of energy every two years for some time) will mitigate the Jevons Paradox (see inset) in relation to energy efficiency of ICT thus allowing ICT to be an...]]></description> <content:encoded><![CDATA[<p>I am in my final year of a part-time PhD attempting to answer whether Moore&#8217;s Law (which has accurately predicted that computational power will roughly double per unit of cost or unit of energy every two years for some time) will mitigate the Jevons Paradox (see inset) in relation to energy efficiency of ICT thus allowing ICT to be an enabler of the green economy.</p><blockquote><p> <b>The Jevons Paradox</b>, and more specifically the Khazzoom-Brookes postulate (a modern interpretation), states that increased energy efficiency paradoxically tends to lead to increased energy consumption due commoditisation. The Khazzoom-Brookes postulate has been shown to be true under the neo-classical growth theory for a range of scenarios and Jevons Paradox in the wider context has numerous historical precedents, most notably around fossil fuel utilisation. The current explosive growth of cloud computing could well be an example of the paradox in action.</p></blockquote><p>ICT is undoubtedly <a
href="/ict-solution-climate-change/">part of the solution to climate change</a>, but many commentators have pointed out how our sector&#8217;s power consumption is increasing at a dramatic rate. My research is not theoretical &#8211; I have been working with Surrey University to examine the efficiency of our Miniserver Virtual machines, among other approaches.</p><h3>Data gathering</h3><p>This part of the research is an ongoing project examining the load levels and power consumption of our Miniserver VM host server estate which has been running for almost three years now.</p><p>The first element of the project has been lots of measurement! As well as measuring the power the servers draw we monitor a number of load characteristics on each host and each individual virtual machine, including:</p><ul><li>CPU utilisation<li>RAM utilisation<li>Disk storage utilisation<li>Disk input/output transactions per second<li>Disk bandwidth<li>Network bandwidth</ul><p>We take samples every hour, and have been doing so for some time, so we now have a couple of billion data points.</p><p>That data has allowed us to see where the bottlenecks are in the infrastructure. One of the first things we noticed was that CPU is hardly touched on the host machines, but that disk I/O was limiting. We therefore disabled swap (virtual memory) and made RAM cheaper instead. That helped a lot!</p><p>The second generation came when still customers were not really using the CPU, so we put even more RAM into servers and more disks.</p><p>We are now onto our fourth generation of host since Summer 2006, and there are many iterations in between where we have tried different architectures, different types of disks, different ways of distributing the virtual machines (eg. mixing ones of the same size vs. putting ones of the same size on the same host) and so forth.</p><p>This is necessary since the server technology is constantly evolving too! We also refit old host machines where practical and have an analytical approach to what to replace.</p><h3>Beating Moore’s Law</h3><p>By iteratively refining and fine-tuning the host hardware to optimise it for the actual load profile, we’ve been able to reduce the average power consumption of a one Miniserver Compute Unit (MCU &#8211; see inset) from 26 watts in mid-2009 to 4.7 watts by the end of 2011. The chart below shows this progress:</p><p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/MooresLaw1.png"><img
style="float: center; padding: 10px; width: 650px;" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/MooresLaw1.png" alt="" /></a></p><blockquote><p> Our &#8220;MCU&#8221; or &#8220;Memset Compute Unit&#8221; is based on our VM2000 which has 1 x 0.4GHz X34xx series Xeon core or equivalent, 1GB RAM, 80GB RAID1 HDD. Our latest generation of host servers are Dell R310&#8242;s with 2.93GHz X3740 Xeon CPUs, 32GB of RAM and 4 x 2TB hard disks in a dual RAID1 array.</p></blockquote><p>Moore&#8217;s law is a good approximation for the rate at which energy efficiency of computers improves. Even taking the more aggressive figure of a doubling of efficiency every 18 months (see inset) Moore&#8217;s Law predicts those VMs should be using 8.41 Watts &#8211; 79% more than Memset&#8217;s power usage. Even if we apply Moore&#8217;s law to the lower extreme of my error range for the figure in 2009 we are still beating its prediction by 47% (6.92 Watts/MCU).</p><blockquote><p> <b>Moore&#8217;s Law</b> technically refers to a doubling of CPU transistor density every 24 months, however when computers are viewed overall including other advances such as multi-core, higher clock speeds and storage density their performance per £pound or per watt doubles roughly every 18 months.</p></blockquote><p>This is no mean feat because in the above I am not merely showing the efficiency of our latest generation of Miniserver VM host, but the average power cost across our <i>entire estate</i>. We  do have a programme of replacement but that happens after 3-4 years &#8211; even with a lot of older, inefficient hardware we are still beating the odds by a lot!</p><blockquote><p> <b>Embedded &#038; data centre energy</b> Please note that this paper does not examine the embedded energy or the cooling and other data centre overheads. To get those figures add about 20% for the embedded energy (see my <a
href="/embedded-energy-of-servers-pc/">article on the embedded energy of servers</a> and about 50% for cooling and other overheads including the network.</p></blockquote><h3>The Jevons Paradox / Khazzoom-Brookes postulate</h3><p>However, we are also fighting a battle. As you can see from the red line on the chart above as virtual machines have become cheaper &#8211; more of a commodity &#8211; their average size has increased. My operations manager despairs at the profligate wastage of resources by our customers but when the resources are so cheap they don&#8217;t really care, so logs are not rotated, software bloats in terms of CPU and RAM requirements and Web pages become ever-larger yet our customers are still largely doing the same things they were doing ten years ago.</p><p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/MooresLaw2.png"><img
style="float: right; padding: 10px; width: 300px;" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/MooresLaw2.png" alt="" /></a>This is the Jevons Paradox in action: as a resource becomes more efficient the market forces move (mainly via price elasticity) to paradoxically increase overall utilisation. But is that really the case? Well I&#8217;m relieved to report that it is not &#8211; at least at Memset. The chart to the right shows our average power consumption per logical server (dedicated or virtual) and as you can see  we are turning the tide &#8211; just.</p><p>The effect is pretty minimal however and as we move up the food chain with big name customers for whom our fees are miniscule we are again fighting a battle to convince them that they should ditch wasteful dedicated servers and use efficient, scalable cloud solutions.</p><p>Further, we are arguably the undisputed leader in the green hosting space in Britain. If we as exemplars are only just managing to reign in our power consumption per logical server (partly by encouraging customers to go from dedicated to virtual) then what of our less environmentally-inclined peers?</p><h3>Conculsion</h3><p>In short, we&#8217;re doing great stuff by making our Miniservers more efficient, and delivering the following benefits:</p><ul><li>Lower prices (we&#8217;re currently cheaper than Amazon Web Services)<li>Environmental responsibility (UK&#8217;s first accredited Carbon Neutral ISP and still trail blazing!)<li>Better VM performance (by fine-tuning we are eliminating bottlenecks)</ul><p>However, the question of whether we as an industry (rather than just one efficient corner) can employ Moore&#8217;s Law to combat the Jevons Paradox and deliver on our promise of being part of the solution to climate change without becoming part of the problem remains unclear &#8211; but that&#8217;s why I&#8217;m doing my PhD and I hope to have the answer quite soon!</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/energy-efficient-cloud-jevons-paradox-vs-moores-law/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using HiTechnic sensor multiplexer in NXC</title><link>http://www.katescomment.com/hitechnic-sensor-multiplexer-nxc/</link> <comments>http://www.katescomment.com/hitechnic-sensor-multiplexer-nxc/#comments</comments> <pubDate>Sun, 15 Apr 2012 20:15:25 +0000</pubDate> <dc:creator>katecw</dc:creator> <category><![CDATA[Hacking]]></category> <category><![CDATA[hacking]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[robotics]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1489</guid> <description><![CDATA[In order to give BOB all the capabilities I need more than the 4 standard sensor inputs. To that end I ordered two HiTechnic sensor multiplexers, one powered one (the one in front of him in the picture) which can do any sensor and one for just touch sensors (the one connected in the picture, distinguished by a lack of...]]></description> <content:encoded><![CDATA[<p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOBTouchMultiplex.jpg"><img
class="alignright" title="BOB sensor multiplex" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOBTouchMultiplex.jpg" alt="BOB NXT with new sensors awaiting install" width="300" /></a> In order to give BOB all the capabilities I need more than the 4 standard sensor inputs. To that end I ordered two <a
href="http://www.hitechnic.com/products" target="_blank">HiTechnic sensor multiplexers</a>, one powered one (the one in front of him in the picture) which can do any sensor and one for just touch sensors (the one connected in the picture, distinguished by a lack of a battery).</p><h3>Adding touch to the any-sensor multiplexer</h3><p>I found a <a
href="http://botbench.com/blog/2010/04/09/released-nxc-driver-for-hitechnic-sensor-mux/">NXC driver for the multiplexer by Xaander Soldaat</a> which was a Godsend &#8211; I&#8217;d ben dreading having to write one myself after reading some of the <a
href="http://www.robotshop.com/content/PDF/htsmux-tutorial-latest-ntx1060.pdf">documentation</a>.</p><p>I found a couple of minor issues with Xander&#8217;s driver (see comment on his site) but the light sensor one needs more investigation since based on his replies thus far I think it may not actually be supported at all. I did write a touch sensor handler to work with the full multiplexer, which Xander has incorporated into version 0.5 of the driver. <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> That code is below:</p><blockquote
style="font-family: courier; font-size: 12px;"><p> #define TOUCH_SENSOR_THRESHOLD 500<br
/> bool smuxReadSensorLegoTouch(const byte muxport)<br
/> {<br
/> &nbsp; if ( HTSMUXreadAnalogue(muxport) < TOUCH_SENSOR_THRESHOLD )<br
/> &nbsp; &nbsp; return TRUE;<br
/> &nbsp; else<br
/> &nbsp; &nbsp; return FALSE;<br
/> }</p></blockquote><h3>Debugging the touch sensor multiplexer</h3><p>However, after writing that I remember that I had bought two multiplexers and that one was touch-only! *facepalm* With it came a code snippet from HiTechnic, but it did not work at first. I accidentally discovered the first issue; you need to set the port to be a touch sensor, for example:</p><blockquote
style="font-family: courier; font-size: 12px;"><p>SetSensorTouch(S1);</p></blockquote><p>I had assumed that one would set it to be a raw sensor input! The supplied code still didn&#8217;t work so I set about reading the raw values. On investigation using the setup you can see in the picture (the touch sensor multiplexer connected to input 1 and four touch sensors connected into that) and some code to output the values to BOB&#8217;s screen I discovered that the values being returned by the device were not-quite binary multiples:</p><blockquote><p> B1 pressed: 24-29<br
/> B2 pressed: 55-56<br
/> B3 pressed: 106-109<br
/> B4 pressed: 194-195</p></blockquote><p>That looked &#8220;close enough&#8221;, and indeed they appeared to be being added together when multiple buttons were pressed, however when I pressed all four buttons I got 310-313, whereas the minimum sum of the above is about 380! This presents something of a problem, but I have written a function that works in most situations I want:</p><blockquote
style="font-family: courier; font-size: 12px;"><p> // Read the HiTechnic touch sensor multiplexer (different to the any-sensor smux)<br
/> // The code snippet supplied did not work when tested for two reasins:<br
/> //<br
/> //  1) You must use SetSensorTouch() on the appropriate port first<br
/> //  2) The values returned are no-quite binary<br
/> //<br
/> // This function takes the port the touch smux is connected to and a pointer to a 4-long bool array<br
/> // It returns TRUE if any sensor was active and sets each, FALSE if none are set<br
/> //<br
/> // NOTE: The readings are unreliable if switches 3 &#038; 4 are pressed simultaneously &#038; code may require calibration!<br
/> //       For more information please see http://v.gd/OpukAf</p><p>bool readTouchesSmux( const byte port, byte &#038;switches[] )<br
/> {<br
/> &nbsp; ArrayInit( switches, 0, 4 );<br
/> &nbsp; int powers[4] = {1,2,4,8};<br
/> &nbsp; float value = 1023 &#8211; SensorRaw(port);<br
/> &nbsp; bool pressed = FALSE;</p><p>&nbsp; value *= 256;<br
/> &nbsp; value /= 192; // correct for approximate error<br
/> &nbsp; value += 16; // to ensure rounding-up<br
/> &nbsp; value /= 32; // convert to binary value<br
/> &nbsp; int ival = value; // Cast to an int and hopefully will be about right</p><p>&nbsp; for ( int i=0; i<4; i++ )<br
/> &nbsp; &nbsp; {<br
/> &nbsp; &nbsp; &nbsp; if ( ival &#038; powers[i] )<br
/> &nbsp; &nbsp; &nbsp; &nbsp; {<br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pressed = TRUE;<br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switches[i] = TRUE;<br
/> &nbsp; &nbsp; &nbsp; &nbsp; }<br
/> &nbsp; &nbsp; &nbsp; }<br
/> &nbsp; &nbsp; }</p><p>&nbsp; return pressed;<br
/> }</p></blockquote><p>Unfortunately the error from buttons 3 &#038; 4 when combined with other buttons means that some a few multiple-button-pressed states unreliable. Any combination of buttons 1+2+3 is okay, and combinations of buttons 1+2+4, but if 3 &#038; 4 are pressed together the results become unreliable. To counter this I have used 3 &#038; 4 for BOB&#8217;s rear sensors which I do not expect to ever be pressed at the same time.</p><h3>Bugged hardware &#8211; may need to calibrate</h3><p>The unit is clearly defective so I shall ask HiTechnic about that but I suspect that they are all like that so hopefully this will help others with similar units. I played around with the pictured setup to get the best correction value (256/192). One could do a cruder system with a list of value ranges which would work in all cases probably but that was too inelegant for my tastes and it may well be that the ranges vary depending on the individual smux.</p><p>Their suggested code for the conversion is shown below. The fact that they have taken a not-dissimilar approach to mine and it has some &#8220;fine tuning&#8221; in it suggests that there is variance between bricks &#8211; if I plug in the code below using my touch smux then it works for some cases but not for most!</p><blockquote
style="font-family: courier; font-size: 12px;"><p> int ival;<br
/> ival = 339 * value;<br
/> ival /= 1023-value;<br
/> ival += 5;<br
/> ival /= 10;</p></blockquote><p>If you plan to use a similar setup to mine and want to be able to read multiple sensors that may be pressed together I suggest that you calibrate your own setup by adjusting the &#8220;192&#8243; a little to find the value that works best with your particular touch smux.</p><h3>Update: RTFMS!</h3><p>After Xander&#8217;s helpful pointer I found the <a
href="http://bricxcc.sourceforge.net/nbc/nxcdoc/nxcapi/ex___read_sensor_h_t_touch_multiplexer_8nxc-example.html#a2">ReadSensorHTTouchMultiplexer()</a> NXT function, which was online but not in the PDF version I had downloaded for local reference.</p><p>That function works perfectly. Given my struggles I expect it uses an internal lookup table for ranges rather than bitwise operators. My function above can be simply rewritten thus:</p><blockquote
style="font-family: courier; font-size: 12px;"><p> // Read the HiTechnic touch sensor multiplexer into a supplied array<br
/> // Returns TRUE if any button was pressed</p><p>bool readTouchesSmux( const byte port, byte &#038;switches[] )<br
/> {<br
/> &nbsp;  ArrayInit( switches, 0, 4 );<br
/> &nbsp;  int t0,t1,t2,t3;</p><p>&nbsp;  ReadSensorHTTouchMultiplexer(port, t0, t1, t2, t3 );<br
/> &nbsp;  switches[0] = t0; switches[1] = t1; switches[2] = t2; switches[3] = t3;</p><p>&nbsp;  return ( t0 || t1 || t2 || t3 );<br
/> }</p></blockquote><p>It was an interesting reminder of bitwise operations regardless!</p><p>Some of you may note that I should have been able to do without the local instantiation of variables (t*), or failing that done it more elegantly with a local array and a for loop. However, NXC is indeed &#8220;not exactly C&#8221; and you cannot pass pointers to individual array elements between arrays, only pointers to whole data objects (array, integer etc).</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/hitechnic-sensor-multiplexer-nxc/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Nürburg ring / Nordschleife</title><link>http://www.katescomment.com/nurburgring/</link> <comments>http://www.katescomment.com/nurburgring/#comments</comments> <pubDate>Sat, 14 Apr 2012 17:00:47 +0000</pubDate> <dc:creator>katecw</dc:creator> <category><![CDATA[Video]]></category> <category><![CDATA[racing]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1539</guid> <description><![CDATA[I spent Easter weekend in Germany on the fabled Nürburg ring with my Audi R8 and Ducati Desmosedici. It was one of the most amazing experiences of my life to date and I have been thoroughly bitten by the racing bug!! The pic on the right is evidence of me doing it on the Desmo which trust me was a...]]></description> <content:encoded><![CDATA[<p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/D16RR-Nurburg-shrink.jpg"><img
style="float: right; padding: 10px; width: 300px;" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/D16RR-Nurburg-shrink.jpg" alt="Ducati Desmosedici Nürburgring / Nordschleife" /></a> I spent Easter weekend in Germany on the fabled Nürburg ring with my Audi R8 and Ducati Desmosedici. It was one of the most amazing experiences of my life to date and I have been thoroughly bitten by the racing bug!! The pic on the right is evidence of me doing it on the Desmo which trust me was a frightening experience!! The car drivers are all maniacs and don&#8217;t understand the lines bikes take.</p><p>It was made additionally &#8220;interesting&#8221; since I dropped her that morning (sunny day but it had been freezing overnight and I didn&#8217;t have my &#8220;cold tyres&#8221; head on &#8211; lost the back end on the first roundabout out of the hotel :$) and her gear changer got damaged. It completely fell off half way through the second lap! I was luckily stuck in third and thanks to the Duke&#8217;s awesome torque range was able to complete the lap without too much bother.</p><p>I need to write a post on how a salve my conscience for all the fossil fuels I&#8217;m wasting in pursuit of thrills (I do carbon offset) but in the mean time here are some videos of me doing the &#8216;ring in the R8:</p><h3>Following the MV Augusta SPS</h3><p>Me following my ex on his MV August SPS around the &#8216;ring in my R8. He was taking it pretty easy since he has just finished rebuilding the bike and it is not setup 100% right.</p><p>As you can see the traffic was pretty hairy! Shuffle chose an amusingly appropriate tune for this event though I thought. <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p><iframe
width="560" height="315" src="http://www.youtube.com/embed/Trz9sH233bU" frameborder="0" allowfullscreen></iframe></p><h3>Slithering in the wet</h3><p>My third-ever lap on the Nürburg ring, and in the wet! Have clipped out about half to show just the &#8220;interesting&#8221; bits &#8211; ie. me deliberately &#8220;exploring the envelope&#8221; and finding out how she handles slides under power. Got a bit caught out by my nemesis (one of the bends) and had a little off across the grass. :$</p><p><iframe
width="560" height="315" src="http://www.youtube.com/embed/Ryc44YmgbtU" frameborder="0" allowfullscreen></iframe></p><h3>Best lap in R8</h3><p>Me trying to do it properly (as opposed to playing in the wet) in my Audi R8 on the Nürburg ring / Nordschleife. This was my best lap &#8211; about 09:22 I think which I believe is respectable for a beginner.</p><p>I know I keep braking too hard rather than bleeding them into bends (I&#8217;m a biker) but would welcome other constrictive critique!</p><p><iframe
width="560" height="315" src="http://www.youtube.com/embed/frHPmrBvRew" frameborder="0" allowfullscreen></iframe></p><p>PS. Sorry about the soundtrack!</p><p>PPS. Before making unconstructive comments remember that a) the &#8216;ring is 13 miles long and has 172 bends so it takes a while to learn &#8211; this was my eigth, b) German road law applies so you pass on the left and c) when I&#8217;m taking an odd line I probably have someone on my tail so I&#8217;m keeping right to let them through!</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/nurburgring/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Giving BOB sensors to turn him into a robot pet</title><link>http://www.katescomment.com/robot-pet-sensors/</link> <comments>http://www.katescomment.com/robot-pet-sensors/#comments</comments> <pubDate>Tue, 10 Apr 2012 16:04:32 +0000</pubDate> <dc:creator>Kate Craig-Wood</dc:creator> <category><![CDATA[Hacking]]></category> <category><![CDATA[coding]]></category> <category><![CDATA[hacking]]></category> <category><![CDATA[robotics]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1468</guid> <description><![CDATA[Some of BOB&#8216;s new sensors have arrived (see right)! With them I hope to turn him into something resembling a robotic pet. I am still awaiting the HiTechnic sensor multiplexer (I ordered the ones shown ones from Lego UK for simplicity) which will allow me to connect so many sensors to the NXT control brick. At present he just avoids...]]></description> <content:encoded><![CDATA[<p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB-sensors-e1334064960285.jpg"><img
class="alignright" title="BOB sensors" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB-sensors-e1334064960285.jpg" alt="BOB NXT with new sensors awaiting install" width="300" /></a> Some of <a
href="/programming-lego-mindstorms-nxt-nxc-macos-osx/">BOB</a>&#8216;s new sensors have arrived (see right)! With them I hope to turn him into something resembling a robotic pet. <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>I am still awaiting the <a
href="http://www.hitechnic.com/products" target="_blank">HiTechnic sensor multiplexer</a> (I ordered the ones shown ones from Lego UK for simplicity) which will allow me to connect so many sensors to the NXT control brick.</p><p>At present he just avoids objects. I should take some video and post that I suppose! My rough plan is to use the infrared (IR) seeking sensor to get him to follow me around, with me wearing an IR beacon on my ankle.</p><p>With accelerometer he will be able to detect when he has been picked up, and change behaviour appropriately. I should be able to do some simple sound recognition with the sound sensor too, again for other &#8220;pet like&#8221; behaviours.</p><p>This all comes after our cat, C4, ran away for the second time and didn&#8217;t come back. <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> Perhaps if I can look after a robotic pet I can give myself my pet license back again!</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/robot-pet-sensors/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Password security</title><link>http://www.katescomment.com/password-security/</link> <comments>http://www.katescomment.com/password-security/#comments</comments> <pubDate>Thu, 05 Apr 2012 12:36:18 +0000</pubDate> <dc:creator>katecw</dc:creator> <category><![CDATA[Security]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1337</guid> <description><![CDATA[I&#8217;m very proud of my personal and corporate security. At work we use pwgen to create passwords, a sample of our tool is inset. Our policy dictates that staff choose one for themselves and since we know it is cryptographically strong (ie. not based on anything guessable) we don&#8217;t require that they change them unnecessarily often. We encourage the use...]]></description> <content:encoded><![CDATA[<p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/pwgen-passwords.png"><img
class="alignright size-medium wp-image-1462" title="Passwords" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/pwgen-passwords-300x146.png" alt="Passwords" width="300" height="146" /></a> I&#8217;m very proud of my personal and corporate security. At work we use pwgen to create passwords, a sample of our tool is inset. Our policy dictates that staff choose one for themselves and since we know it is cryptographically strong (ie. not based on anything guessable) we don&#8217;t require that they change them unnecessarily often.</p><p>We encourage the use of software like <a
href="http://www.keepassx.org/">KeePassX</a> to store all passwords with one master one accessing it, and likewise allow people to use Firefox&#8217;s password safe as long as it is protected with a master password. Any staff who have sensitive data on their laptops (most of our operational data is in the cloud so this is not that many people) must encrypt their hard drives.</p><p>For master passwords (those that decrypt hard drives and password safes) we require a minimum of 10 character passwords rather than the default 8. Why, because we have performed rigorous statistical analysis on the likelihood of passwords being &#8220;brute forced&#8221; (ie. trying all the possible combinations) in the event that a device is stolen or lost. Most people think that an eight-character password is fairly strong, but let&#8217;s look at some scenarios.</p><p>For a crude password method such as those used in typical .htpasswd file (common for Web sites) with few bits of encryption and little or no hashing (I&#8217;ll explain hashing in a moment) a 2-3GHz CPU core could try one password every microsecond. Therefore to break a crude eight-character password, assuming we have the password file, by brute force it would take:</p><blockquote><p>( ( ( (63^8) combinations * (1/1000000) seconds-per-try ) / (24 hours * 3600 seconds ) ) / (4 cores) ) ) / 2<br
/> = 359 days on average</p></blockquote><p>63 is the number of characters we are choosing from (0-9, a-z and A-Z). Dividing by 2 is to get the average.</p><h3>Cloud computing as a weapon</h3><p>About a year may sound like a good enough amount of time, but increasingly it is possible to deploy a very large number of machines in parallel for a brief period at relatively little expense &#8211; cloud computing as a weapon. Brute-forcing a password is a task that lends itself to parallelisation &#8211; the approach of dividing a computational task up among many separate machines. So, what if our attacker deployed 1,000 virtual machines to the task:</p><blockquote><p>( ( (63^8) combinations * (1/1000000) seconds-per-try ) / 3600 seconds ) / (4 cores * 1000 cloud servers) / 2<br
/> = 8.6 hours on average<br
/> ~= £1,720 based on our quad-core <a
href="http://www.memset.com/cloud/compute/">cloud virtual servers</a> at £0.20/hour</p></blockquote><p>This is not ideal since we might not notice a machine had been compromised or gone missing in 8 hours and that much money would be relatively little to get at some of the data we hold! However, all the root passwords on our servers use 512 bits of encryption thousands of rounds of hashing.</p><h3>Password hashing</h3><p>Hashing is a process which makes it take longer to validate a password, artificially increasing the complexity of the decryption algorythm. Increasing the number of bits used similarly increases the decryption time. The delay is imperceptible to a human but if you are trying to brute force a password then you are having to try every combination and a small increase in the delay to try each one causes the overall time required to go up a lot. The thousands of rounds and 512 bits we use pushes the decode time up to about 4 milliseconds for a typical core, so we get:</p><blockquote><p>( ( (63^8) combinations * (4/1000) seconds-per-try ) / (365 days * 24 hours * 3600 seconds ) / (4 cores * 1,000 cloud servers) ) / 2<br
/> = 3.93 years on average<br
/> ~= £6,890,000</p></blockquote><p>For seven meelion pounds zer are ozer vays ov making you talk! <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p>For personal master passwords, just to be on the safe side, we also require a minimum of 10 characters. Even without the additional hashing that would take a weak password up to:</p><blockquote><p>( ( (63^10) combinations * (1/1000000) seconds-per-try ) / (365 days * 24 hours * 3600 seconds ) / (4 cores * 1,000 cloud servers) ) / 2<br
/> = 3.90 years years on average<br
/> ~= £6,840,000</p></blockquote><p>This shows that just adding a couple of characters to your password makes a lot of difference, especially if you are using a weak password system like Apache&#8217;s htpasswd files.</p><p>Our 10 character passwords are even better though thanks to the hashing. Let&#8217;s up the stakes and assume Google&#8217;s black ops team has stolen my personal assistant&#8217;s laptop and is trying to get her passwords with a deployment of a million servers:</p><blockquote><p>( ( (63^10) combinations * (4/1000) seconds-per-try ) / (365 days * 24 hours * 3600 seconds ) / (4 cores * 1,000,000 servers) ) / 2<br
/> = 15.6 years years on average</p></blockquote><h3>Multi passwords &amp; master passwords</h3><p>The first calculation in particular shows why it is a really bad idea to replicate passwords around a lot. If you&#8217;ve used an 8-character password on a Web service and use the same one elsewhere and I compromise the server and get the passwords file I will be able to decode your and everyone else&#8217;s 8 character passwords in a day with a cost of £2k. Often such data is stored with email addresses, so I (the putative hacker) now have a shopping list of peoples&#8217; login credentials!</p><p>Personally I do use the same password on some different sites but only for groups of sites that I don&#8217;t really mind getting compromised. For important things like banking I have a unique eight character password on each. In all I have about twenty eight-character passwords which are stored in KeePassX and/or my Mac&#8217;s key chain. However, I&#8217;m very security conscious so I also encrypt my hard drive and my master password is 16 characters long.</p><p>Yes, that is long, but I need only ever remember one, pwgen tries to make them easy-ish to remember, and I need never change it if I am careful. As for how secure it is, let&#8217;s assume that the NSA have the power to secretly use every computer shipped in the last year (call it eighty million<sup><a
href="http://www.worldometers.info/computers/">1</a></sup>) and that all of those are quad-core:</p><blockquote><p>( ( (63^16) combinations * (4/1000) seconds-per-try ) / ( (4.54*10^9) years * 365 days * 24 hours * 3600 seconds ) / (4 cores * 80,000,000) computers) ) / 2<br
/> = 2.69 times the age of planet Earth<br
/> (or 1.08 times the age of the universe if you prefer)</p></blockquote><p>This also demonstrates that it is completely possible for an ordinary citizen to have unbreakable personal information security.</p><h3>Problem lies between keyboard and chair</h3><p>Of course, my master password would be much more secure if I stopped accidentally typing it into Twitter when I don&#8217;t notice my secondary screen has focus!! I have now done that <em>three times</em> in the month week thanks to my new multi-screen setup with keyboard and mouse sharing between two computers (they KB is attached to the Mac Mini which normally has Tweetdeck open and I keep forgetting).</p><p>&lt;repeat&gt;*headdesk*&lt;/repeat&gt;</p><p>This just goes to show, when it comes to security, the weak link is always the human!!</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/password-security/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Programming B.O.B (Lego Mindstorms NXT) in not-exactly C on MacOS / OSX</title><link>http://www.katescomment.com/programming-lego-mindstorms-nxt-nxc-macos-osx/</link> <comments>http://www.katescomment.com/programming-lego-mindstorms-nxt-nxc-macos-osx/#comments</comments> <pubDate>Sun, 01 Apr 2012 15:04:38 +0000</pubDate> <dc:creator>Kate Craig-Wood</dc:creator> <category><![CDATA[Hacking]]></category> <category><![CDATA[coding]]></category> <category><![CDATA[hacking]]></category> <category><![CDATA[hardware]]></category> <category><![CDATA[robotics]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1398</guid> <description><![CDATA[My true first beginnings as a hacker were with Lego technics. I was very lucky that my Dad got me one of the very first systems for controlling Lego from a computer back in the late 80&#8242;s. At the time it was only officially available for schools, but he pulled some strings. Lego Mindstorms NXT My childhood love of Lego...]]></description> <content:encoded><![CDATA[<p>My true first beginnings as a hacker were with Lego technics. I was very lucky that my Dad got me one of the very first systems for controlling Lego from a computer back in the late 80&#8242;s. At the time it was only officially available for schools, but he pulled some strings.</p><h3>Lego Mindstorms NXT</h3><p>My childhood love of Lego never really died and last year I was given <a
href="http://mindstorms.lego.com/" target="_blank">Lego Mindstorms</a> set which comes with a programmable &#8220;NXT&#8221; block.</p><p>My latest creation, codenamed BOB 2.0, is pictured below. The name is a homage to to the old sci-fi film Black Hole where &#8220;BOB&#8221; is short for &#8220;BiOsanitation Battallion&#8221; (I <em>am</em> a megalomaniac evil genius intent or world domination, remember, and therefore need a robot army &#8211; baby steps and all that), and an little joke referring to my former life. <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB2.jpg"><img
class="alignright size-medium wp-image-1459" title="BOB NXT robot" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/04/BOB2-300x206.jpg" alt="BOB NXT robot" width="300" height="206" /></a></p><p>He is my own design with the intended purpose of being able to navigate around a room initially. To that end he has a simple catapillar drive arrangement though quite a lot wider than the design the set comes with. To accomodate the width I had to put in quite a bit of additional structural support beams at the back.</p><p>The extra width is so that he can have the third motor mounted sideways in the middle. That one turns his sensor &#8220;head&#8221; in a range of 180<sup>o</sup>. This was surprisingly fiddley since I wanted to get the swivel point exactly in the middle and the axis of the motors is off-centre. Thus I needed to use a little gearing to get it in the right place. I also had to ensure a low-friction mounting.</p><p>The sensor head is the utrasonic range finder with the light sensor stuck on top. Another of the challenges was getting the wires to curl neatly as the head turns, hence some of the apparantly non-structural and superfluous bits around the &#8220;neck&#8221;. I have been reading <a
href="http://www.extremenxt.com/books.htm" target="_blank">Extreme NXT</a> and for the mark 3 I will dispense with the kit-supplied cables which are not very flexible and make my own.</p><p>Finally, the two &#8220;bumpers&#8221; are mounted onto pressure sensors. They are for two reasons:</p><p>1) He often does not detect low-down objects or tall thin things like table legs with the ultrasonic sensor.<br
/> 2) Part of my plan is to have him using the ultrasound sensor to maintain a specific distance from a wall while travelling, thus his &#8220;head&#8221; will be turned to the side and he won&#8217;t be able to use it to sense obstacles.</p><h3>Programming in Python and Not-Quite C (NXC)</h3><p>The Lego Mindstorms graphical software has a number of issues. Under MacOS (OSX) there are bugs with the scrolling which makes large programs difficult. Further, to any actual programmer the graphical language is immensely frustrating to use. Therefore I have been looking for alternatives.</p><p>Being on Mac limits the options a little. Python is my preferred language so I was very excited to find <a
href="http://home.comcast.net/~dplau/nxt_python/" target="_blank">NXT Python</a> (also hosted with <a
href="http://code.google.com/p/nxt-python/" target="_blank">Google code</a>) which is available for OSX. However, after much fiddling around I just could not get it to work. Bluetooth is often a problem and I just could not get the software talking to my NXT brick.</p><p>So I turned to the <a
href="http://bricxcc.sourceforge.net/utilities.html" target="_blank">NeXT Tools</a> (written by John Hansen for OSX as an alternative to the Windows BrixCC Windows IDE) which allows you to programm the NXT in <a
href="http://bricxcc.sourceforge.net/nbc/ " target="_blank">Not-eXactly C (NXC)</a>.</p><p>The NeXT Tools / nxtcc apps are really great. You can use them to remote control the NXT which is good when in the build phase and that bit works fine via bluetooth.</p><h3>Bluetooth woes</h3><p>Unfortunately you don&#8217;t appear to be able to upload software via the bluetooth interface. The final post on <a
href="http://thenxtstep.blogspot.co.uk/2009/09/nxc-tools-for-mac-osx.html" target="_blank">this blog</a> suggests that this is a known issue. In theory one should be able to use the NeXTTool command line program (OSX download <a
href="http://bricxcc.sourceforge.net/nexttool_osx.zip">here</a>) but I&#8217;ve not managed to get that work.</p><p>Instead I have just been plugging in a USB cable which is not ideal since the concept is of a free-ranging bot, but will do while in the development phase. If someone has found a way to upload software via bluetooth to the NXT from OSX please let me know how in a comment!</p><h3>Actual coding</h3><p>So, I can&#8217;t use my preferred language (Python) but I used to write a lot of C and NXC is pretty easy to get your head around so that has not really held me back. The NeXT Tools code editor is pretty useless to be honest so I am just editing the code in <a
href="http://aquamacs.org/">Aquamacs</a> (Emacs for Mac OS X &#8211; a must-have for any self-respecing coder!) and using the NeXT Tools for compiling and uploading.</p><p>Thus far BOB is still pretty basic but now that I&#8217;ve cracked the issue of being able to write real code for him I have high hopes! People have telling me I should get another pet since C4 (the cat) did a runner and I think BOB will count. <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><h3>Update 2012/4/3</h3><p>Thus far NXC is proving usable but quite frustrating. For example, I wanted to make a function that makes BOB&#8217;s head scan, look at the immediate surroundings, then return a data structure with the distances to various obstacles at each scan angle. I spent a long time trying to figure out how to return a struct (or even an array) from a function (sub). Since pointers are not supported this was non-trivial but even when I got the code to compile (needing to declare the structs in the root scope was part of the issue) it throws an error at runtime.</p><p>As things stand I have given up on returning anything more complex than strings, floats and integers from functions.</p><p>Such quirks of the language, the lack of much in terms of debugging reports at compile time (the compiler often give you a totally bum steer) and essentially zero debugging at runtime on the brick makes it rather challenging!</p><p>Further, it sometimes just freezes. The block completely stiffs and I can&#8217;t kill the program.</p><blockquote><p>On actually reading the information I&#8217;ve realised I need to update the NXT&#8217;s firmware to be able to use some array structures. *facepalm*</p></blockquote><h3>Additions</h3><p>I&#8217;ve just discovered a <a
href="http://www.hitechnic.com/products" target="_blank">range of add-on sensors from HiTechnic</a>. I&#8217;m espeically excited by their sensor multiplexers (four sensors just is not enough) and the infra-red seeker. I plan to use the latter to make BOB follow me around (I will attach an IR beacon to my ankle).</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/programming-lego-mindstorms-nxt-nxc-macos-osx/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>2012 Budget Response &#8211; what the tech sector needs to help UK PLC</title><link>http://www.katescomment.com/2012-budget-response/</link> <comments>http://www.katescomment.com/2012-budget-response/#comments</comments> <pubDate>Thu, 22 Mar 2012 21:34:27 +0000</pubDate> <dc:creator>katecw</dc:creator> <category><![CDATA[Business]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1350</guid> <description><![CDATA[First, I am delighted that the chancellor has stated an intent to make the UK Europe&#8217;s technology centre. Now that the old &#8220;big three&#8221; of finance, retail and construction are floundering, technology really has the potential to become a major engine of growth for UK PLC. Cloud computing is a prime example; we already have something like a 10% global...]]></description> <content:encoded><![CDATA[<p>First, I am delighted that the chancellor has stated an intent to make the UK Europe&#8217;s technology centre. Now that the old &#8220;big three&#8221; of finance, retail and construction are floundering, technology really has the potential to become a major engine of growth for UK PLC. Cloud computing is a prime example; we already have something like a 10% global share of the market which is growing at over 20% per year and will be worth £25bn by 2015<sup><a
href="/it-brain-drain/">1</a></sup>. I see a future where Britain has a triumvirate of export strengths; legal services, financial services and technological services &#8211; three areas with great synergies and ones in which we already excel.</p><h3>Infrastructure for the future, not the past</h3><p>The promise of investment in faster broadband is very welcome &#8211; and necessary to achieve the above goal &#8211; but it needs to be more than words. There was mention of £150 million for connected cities but that is insufficient to be of any real use by <i>at least</i> one order of magnitude &#8211; we need £billions invested in the infrastructure of the future if we are to become a hub of technological excellence. Not only that but we have the madness of dark fibre tax &#8211; business rates being charged on fibre optic ducting as though it were business premisis, which has killed many innovative network startups since they can&#8217;t afford to pay for 1 foot by x-hundreds of miles.</p><p>By contrast it enrages me that we are spending £40bn on white elephants like the high speed 2 rail link. Using the same metrics as were used to justify that project (mostly time savings), money spent on broadband would deliver £30 of benefit for every £1 spent &#8211; 10 times better than the train links return on investment!<sup><a
href="http://www.broadbanduk.org/blog/?p=115">2</a></sup> Further, 20-30% of Britons remain without access to broadband and they are generally among the most socio-economically deprived.</p><p>In summary, investment in network infrastructure would help the needy, rather than a minority of suits, save us all time (and therefore money) and  stimulate innovation by providing British Internet / cloud services companies with a hot-bed of users to hone their products that can then be exported to the world!</p><h3>Less business tax means more growth &amp; jobs</h3><p>I of course welcome the reduction in business tax as well, and it too will help high-growth technology companies like mine fulfil their promise of driving economic prosperity. My brother and I (the owner-managers of Memset) leave most of the profits in our business in order to fund our growth &#8211; especially necessary given the banks&#8217; continuing reluctance to lend. By taxing those profits we leave in rather than what we take out government was stifling our growth, which in turn reduces the rate at which we take on new staff and so forth.</p><h3>Fewer startups, more skills please!</h3><p>As for loans to start new businesses and support for school leavers with apprenticeships, they are targeting the wrong areas! It is the established, proven technology businesses in the 10-250 employee range &#8211; the &#8220;gazelles&#8221; &#8211; that have the greatest potential for growth and exports. Due to scarcity of bank finance such firms are turning to venture capitalists who in turn almost always end up selling them to the US, depriving Britain of their goodness (more <a
href="http://www.katescomment.com/it-brain-drain/">here</a>). We need more pressure on banks to share at least some of the risk with the owners.</p><p>As for apprenticeships, such firms are also in dire need of highly-skilled workers, not school leavers. We have to fight tooth-and-nail to get top-quality programmers and systems administrators which is hampering our ability to grow as fast as we would like (ie. we&#8217;d recruit more if we could find them!). It is true that we and our peer-group companies won&#8217;t be employing school leavers but encouraging universities to churn out more science and technology graduates will encourage our growth and in turn economic prosperity for all.</p><blockquote><p>I really struggled writing the above so I think I&#8217;ll just say it clearly and shoot me down in flames if it is politically incorrect (I&#8217;m bad at judging): If government helps my company grow fast it will help everyone, though indirectly in many cases.</p><p>No, I won&#8217;t employ the low-skilled, less-bright school leavers (our minimum requirement is a fluid intelligence ranking in the top quartile), but my devops superstars command impressive wages, which they in turn spend on luxuries like restaurants, cleaners, taxis and so forth. It all filters down, especially since (in my experience) the geek community, unlike their intellectual-peers who turned to banking, are humble altruistic folk likely to spread the wealth as demonstrated by amazing acts of public good like the open source movement.</p><p>Further, you don&#8217;t need many entrepreneurs to make a vibrant economy (1% of the population, or 600,000 people would be more than adequate)! I think there is too much focus on entrepreneurship resulting in a nation of all chiefs and no indians. I&#8217;m saying we should take a top-down approach: support the new-breed of wealth creators and let the economy do the rest.</p></blockquote><h3>Avoiding the brain drain</h3><p>Finally, on a more personal note, as one of the much vilified &#8220;1%&#8221; I welcome the cut in top-rate income tax, but not purely for selfish reasons. At 50% it was at a level where my brother and I were genuinely starting to consider the merits of emigrating and taking the company with us. Britain cannot afford to alienate its golden geese for the sake of what is petty change in the grander scheme. 45% brings it just about under the pain threshold.</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/2012-budget-response/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Home TV broadcasting (HDMI/streaming over IP)</title><link>http://www.katescomment.com/home-tv-broadcasting-hdmi-streaming-over-ip/</link> <comments>http://www.katescomment.com/home-tv-broadcasting-hdmi-streaming-over-ip/#comments</comments> <pubDate>Mon, 12 Mar 2012 23:10:06 +0000</pubDate> <dc:creator>katecw</dc:creator> <category><![CDATA[Hacking]]></category> <guid
isPermaLink="false">http://www.katescomment.com/?p=1324</guid> <description><![CDATA[At home we have one central media PC (a Mac Mini) in the lounge. We only ever watch stuff either off BluRay or streamed from BBC iPlayer of Netflix. As an aside, we have recently cancelled our television licsnse; you no longer need one if you do not watch live TV. The HDMI outputs from the Mac Mini and the...]]></description> <content:encoded><![CDATA[<p>At home we have one central media PC (a Mac Mini) in the lounge. We only ever watch stuff either off BluRay or streamed from BBC iPlayer of Netflix. As an aside, we have recently cancelled our television licsnse; you <a
href="http://www.tvlicensing.co.uk/check-if-you-need-one/topics/how-to-tell-us-you-dont-watch-tv-top12/">no longer need one if you do not watch live TV</a>.</p><p>The HDMI outputs from the Mac Mini and the BluRay player are mixed/switched by my Onkyo amplifier. At present it just drives the projector screen, but that does not work during the day (bright light) and is a pain to bring down for short viewings.</p><p>Therefore we are getting another screen to go above the fireplace, which is about 10m away. However, the route an HDMI cable would have to take to be tidy, and having just moved in and spent a lot on decorating I want it tidy, would make it too long for the signal. However, I did get a CAT6 ethernet socket installed near where I want the fixed wall mount TV.</p><p>Further, we want a TV in our bedroom, ideally on the ceiling mounted above the bed so we can watch it from the bed. Again, there is easy access to my home network since most of the distribution happens in the loft.</p><p>We don&#8217;t actually watch much TV thus having one centralised source will be fine. The other source would be CCTV probably (for example seeing who is at the door when we are in the lounge) but again that is over Internet Protocol (IP) via the home network.</p><p>What I therefore want is the ability to broadcast an HDMI signal over IP. I&#8217;m currently considering two solutions:</p><p>1) Getting a Rasberry Pi and using <a
href="http://xbmc.org/">XBMC</a> to stream the video.</p><p>2) Buying a device to do it, like the <a
href="http://intrl.startech.com/AV/Extenders/HDMI/HDMI-over-IP-Extender-with-Audio~IPUSB2HD2">StarTech HDMI over IP Extender</a>.</p><p>3) Buy screens that have the capability to stream media built in, such as a <a
href="http://www.samsung.com/uk/consumer/tv-audio-video/television/led-tv/UE46D7000LUXXU">Samsung D7000</a></p><p>Option 1 would be good since I&#8217;d like to do something similar in the office. We are taking another floor and I&#8217;d like to have a virtual window between the floors &#8211; live streaming to connect the rooms in effect. First things first I need to get my mits on a Raspberry Pi though!</p><p>In the mean time for home though option 3 looks like the most practical since I&#8217;ve not actually got the screens. Therefore I&#8217;ve placed the order for one of those big Samsungs (which also look very purdy!) and will report on how easy they are to use for streaing from Netflix and such!</p><h3>Update: 55&#8243; Samsung D7000 (UE55D7000)</h3><p><a
href="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/03/samsung_d7000.jpg"><img
style="float: right; padding: 10px; width: 250px;" src="http://cdn.katescomment.com/wordpress/wp-content/uploads/2012/03/samsung_d7000.jpg" alt="" /></a><br
/> I went with the IP-enabled TV option, pictured right. It is a beautiful piece of kit &#8211; I especially like the thin, translucent bezel. However, it was a bit of a pain to use at first. I spent while fighting with its Web browser getting increasingly enraged by the very poor &#8220;touchpad&#8221; on the remote control (which sprayed so much infrared around it caused my projector screen to randomly go up and down, and was almost useless as a mouse control) and the fact that there was no sensible way to use the keyboard.</p><p>In fact, on Googleing it transpires that you cannot connect a keyboard by bluetooth or any other means which seems daft for a Web-enabled device! I had (foolishly) assumed that one could do so. I tried the smartphone app and that is just a very basic volume / channel control so no use there.</p><p>However, on returning to the home screen it told me it had finished downloading various apps, including ones for Netflix and LoveFilm! *facepalm* The apps were very straight forwards to use, apart from an annoying buy in Netflix where it does not recognise email addresses with hyphens &#8211; a problem for those of us with hyphenated names! I got around that by changing the email address I use for Netflix.</p><p>Once into the apps everything has gone smoothly and the quality is superb. I still wish to be able to stream content from local sources so the next step is to investigate <a
href="http://www.dlna.org/">DNLA</a>/</p><h3>Update: StarTech</h3><p>I bought a <a
href="http://uk.startech.com/AV/Extenders/HDMI/HDMI-over-IP-Extender-with-Audio~IPUSB2HD2">StarTech HDMI over IP extender</a> thinking it would do what I wanted, but it turns out that this is purely a <i>Windows</i> device that allows you to drive a screen from your Windows PC via the network. <img
src='http://cdn.katescomment.com/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p><p>I thought it would function as a &#8220;bridge&#8221; between two HDMI ports (one in from my lounge AV stack, one out to the TV at the far end of the lounge or to the TV in the bedroom) but looking at the manual there is no such functionality. Back to the drawing board&#8230;</p> ]]></content:encoded> <wfw:commentRss>http://www.katescomment.com/home-tv-broadcasting-hdmi-streaming-over-ip/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching using apc
Object Caching 558/689 objects using apc
Content Delivery Network via cdn.katescomment.com

Served from: www.katescomment.com @ 2012-05-18 03:38:05 -->
