Jeff Epler's blog2015-09-01T14:39:18ZPhotos, electronics, cnc, and moreJeff Eplerjepler@unpythonic.netDragonBoard™ 410c with rt-preempt failure2015-09-01T14:39:18Z2015-09-01T14:39:18Zhttps://emergent.unpythonic.net/01441118358
<div style="float:right;clear:right"><!-- linaro-01Sep2015-49.png--><div class=albumouter style=width:306px id=><div class=albumimage style="width:292px;margin-left:7.0px;"><a href="https://media.unpythonic.net/emergent-files/01441118358/linaro-01Sep2015-49.png" class="thickbox" rel="album" title="LinuxCNC latency test results on
DragonBoard"><img src="https://media.unpythonic.net/emergent-files/01441118358/linaro-01Sep2015-49-small.jpg" width=286 height=300></a><div ><div style="float: right" ><a href="https://media.unpythonic.net/emergent-files/01441118358/linaro-01Sep2015-49.png"><img class=zoom src="https://media.unpythonic.net/emergent-files/default/zoom.png"></a></div><a href="https://media.unpythonic.net/emergent-files/01441118358/linaro-01Sep2015-49.png">LinuxCNC latency test results on
DragonBoard</a></div></div></div>
</div>
I was excited to obtain a <a href="https://www.96boards.org/products/ce/dragonboard410c/">DragonBoard</a>, an
affordable 64-bit ARM single-board computer, but unfortunately it hasn't lived
up to my hopes.
<p>First of all, it shipped with one terrible problem, making it useless for
headless development: <a href="https://bugs.96boards.org/show_bug.cgi?id=66">The onboard wireless doesn't receive multicast traffic, including ARP
requests</a>! And their kernel doesn't provide many modular drivers, so adding
any old USB wireless dongle doesn't work until you rebuild the kernel. As
of this writing, there is no useful workaround.
<p>And that's when I hit the second show-stopper problem. I planned to build
kernels for this thing anyway, because the goal is to run LinuxCNC on it
with rt-preempt realtime. So I stuck in a large capacity micro-sd card,
obtained the kernel source, built it, and rebooted with my new kernel.
<p>(incidentally, testing kernels is a PITA. You have two choices: one,
flash the one and only boot area with your new and untested kernel and
hope for the best; two, tether to a PC (losing USB keyboard and mouse on the
dragonboard!) and use fastboot every time you boot. ugh)
<p>.. but the new kernel just didn't work. It scrolled kernel messages,
but got stuck partway through booting. dmesg implicated the wireless card.
This one at least has a workaround: <a href="https://bugs.96boards.org/show_bug.cgi?id=80">cherry-pick a certain commit from
their kernel git</a>. As I understand it, this bug is triggered by using the
compiler on the dragonboard, and not encountered with the linaro cross-compiler
running on a traditional x86 desktop.
<p>Anyway, having found out about this I was briefly celebratory. I booted with
my own kernel and had a working USB dongle. Unfortunately, that celebration
was short-lived. The USB dongle hasn't been terribly reliable either,
particularly under high CPU load.
<p>I soldiered on and patched the linaro 4.0 kernel with the 4.0-rt5 patchset.
There were a few minor conflicts which I believe I resolved correctly.
Unfortunately, the LinuxCNC latency-test readily encounters latencies above
15ms (15000us). LinuxCNC really would like sub-100us max latencies.
<p>I briefly enabled tracers, and have traces that seem to implicate a variety
of subsystems: networking, usb, and video *all* figure. More experienced
developers than I will have to be the ones to sort out RT on 64-bit ARM.
<p>Proven Delights (and what are proofs anyway)2015-08-05T13:13:49Z2015-08-05T13:13:49Zhttps://emergent.unpythonic.net/01438780429
I won a copy of the book <a href="http://hackersdelight.org/">Hacker's
Delight</a> from <a href="http://blog.regehr.org/">John Regehr</a> for my entry in
his <a href="http://blog.regehr.org/archives/1213">nibble sort contest</a>
earlier this year.
<p>In that thread I had heard about the <a href="http://www.cprover.org/cbmc/">CBMC Bounded Model Checking software</a>, and it gave me the idea to combine
the two: a project to take implementations of the algorithms from Hacker's
Delight and prove the algorithms' properties with CBMC.
<p>I have a modest start on github, which I am calling "Proven Delights":Better pasting for irssi in X2014-06-24T12:35:40Z2014-06-24T12:35:40Zhttps://emergent.unpythonic.net/01403613340
While it's otherwise an excellent irc client, I've been frustrated by pasting
in <a href="http://www.irssi.org">irssi</a>. There are two main problems:mailpie moves to github2013-12-02T19:30:20Z2013-12-02T19:30:20Zhttps://emergent.unpythonic.net/01386012620
My e-mail full text search software <a href="https://emergent.unpythonic.net/software/mailpie">mailpie</a> is
now hosted at github: <a href="https://github.com/jepler/mailpie">https://github.com/jepler/mailpie</a>
<p>SNTP from Python: getting server's esimate of time quality2013-11-23T18:19:15Z2013-11-23T18:19:15Zhttps://emergent.unpythonic.net/01385230755
<p>Anders Wallin <a href="http://www.anderswallin.net/2013/11/ntp-failure-detection/">recently discussed</a>
generating graphs of server time error using a timestamp from the Date:
header of an http request.
<p>NTP servers themselves have estimates of time error, and it's possible to
get the local server's idea of the error by sending SNTP packets to the
local machine. You can also see the last time this NTP server successfully
communicated with a peer or upstream, and see whether the server considers
itself desynchronized by checking the stratum and leap second fields.
<p>Based on my tinkering, the root_dispersion field or the derived LAMBDA value is
the easiest to look at for estimating how bad the NTP time is. Between
communications with a peer, root_dispersion and LAMBA increase at a rate of
15µs/s, ntp's arbitrary estimate of the accuracy of the local undisciplined
clock. (YMMV and you can appaerntly tweak CLOCK_PHI in your NTP configuration
file)
<p>The attached program is a basic Python SNTP client which by default polls the local server every 5 seconds and prints some information. License: GPLv2+
<p>Typical output:
<pre >
12:25:58 0.06233 228.95875 ST-SYNCH LI-SYNCH
12:26:03 0.06241 233.96404 ST-SYNCH LI-SYNCH
12:26:08 0.06247 238.96745 ST-SYNCH LI-SYNCH
12:26:13 0.06255 243.97141 ST-SYNCH LI-SYNCH
12:26:18 0.06262 248.97673 ST-SYNCH LI-SYNCH
12:26:23 0.06270 253.98213 ST-SYNCH LI-SYNCH
12:26:28 0.06277 258.98746 ST-SYNCH LI-SYNCH
</pre>
<p><b>Files currently attached to this page:</b>
<table cellpadding=5 style="width:auto!important; clear:none!important"><col><col style="text-align: right"><tr bgcolor=#eeeeee><td><a href="https://media.unpythonic.net/emergent-files/01385230755/ntpsynch.py">ntpsynch.py</a></td><td>4.9kB</td></tr></table><p>
GNU 30th—Celebrating 30 years2013-09-30T14:19:03Z2013-09-30T14:19:03Zhttps://emergent.unpythonic.net/01380550743
<a href="https://gnu.org/gnu30/">The GNU project</a> and the Free
Software movement are two of the most important computer-related
things in my life. At $DAY_JOB we depend critically on many pieces
of GNU software (such as gcc). This blog is hosted on a system with
a GPL kernel and a GNU userspace, and the blog software itself is
covered by the GPL license. My everyday computer is a GNU/Linux
system, and my cellphone and tablet have GPL-licensed major
components, such as the operating system kernel.
<p>I personally have contributed thousands of unpaid hours developing
GPL-licensed software, which is my way of repaying everyone else who
has developed Free software.
<p>On the other hand, we haven't come as far as one might wish. My
everyday computer doesn't function as well without proprietary
drivers, and many devices that should be general purpose computers
don't ship in a mode that allows their owners to install the
software of their choice. Careful choices are still necessary when
buying hardware, particularly if you insist on an operating system
that consists only of Free software.
<p>Here's hoping that the next 30 years bring more gains for Free
software and the GNU system. Either way, we'll still be here.
Debugging realtime components in UBC32013-09-19T01:34:41Z2013-09-19T01:34:41Zhttps://emergent.unpythonic.net/01379554481Here's how to run the debugger on realtime code in the "unified-build-candidate3" branch from linuxcnc.org. This assumes you are using a run-in-place tree with a userspace realtime model, and that you understand the basics of gdb.Rotary Delta Kinematics2013-07-16T16:32:45Z2013-07-16T16:32:45Zhttps://emergent.unpythonic.net/01373992365
<div style="float:right;clear:right"><!-- rotarydeltakins.png--><div class=albumouter style=width:306px id=><div class=albumimage style="width:289px;margin-left:8.5px;"><a href="https://media.unpythonic.net/emergent-files/01373992365/rotarydeltakins-medium.png" class="thickbox" rel="album" title="Rotary Delta Kinematics
Visualization"><img src="https://media.unpythonic.net/emergent-files/01373992365/rotarydeltakins-small.png" width=283 height=300></a><div ><div style="float: right" ><a href="https://media.unpythonic.net/emergent-files/01373992365/rotarydeltakins-medium.png">(M)</a><a href="https://media.unpythonic.net/emergent-files/01373992365/rotarydeltakins.png">(L)</a></div><a href="https://media.unpythonic.net/emergent-files/01373992365/rotarydeltakins.png">Rotary Delta Kinematics
Visualization</a></div></div></div>
</div>
Together with <a href="http://timeguy.com">Chris Radek</a>, I've been
working on a visualization for his Rotary Delta Kinematics. Here's
a picture of the work, which he hopes to push to git.linuxcnc.org
soon. Of course the plot is of the AXIS splash screen.