Posts

go packages on your own domain

go get has a nice feature where it will fetch the package URL and, based on a meta tag, redirect to the actual location. Here’s the nginx config I use to redirect go get juju.net.nz/x/package to either my private repo (for unreleased stuff) or my cgit instance for everything else. This is similar to how golang.org/x/… and gobot.io/x/… operate. server { … location ~ /x/(.*) { if (-d /home/juju/p/git/$1.git) { return 200 ‘<meta name="go-import" content="$host$uri git ssh://juju@$host/~juju/p/git/$1.

DFRobot FIT0441 pinout

I ordered two FIT0441 brushless motors for use in v2 of my balancing robot. The DFRobot wiki page on the motor is incorrect so I thought I’d blog about it so someone else can find it 🙂 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:

ESP8266 IO bridge

github.com/eriksl/esp8266-universal-io-bridge 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.

A toy PL/0 compiler

I’ve released a toy compiler for the PL/0 educational language at https://juju.net.nz/src/cgit.cgi/pl0.git/ or https://github.com/nzmichaelh/pl0.

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.

Maker Faire Bodensee

We went to Maker Faire Bodensee on the weekend. The kids spent so much time with Paula Pongratz’s Post-apocalyptic jewlery that they missed most of the rest (heh).

Other standouts were the breadboard / pus pin based electronic organ from [

Elektronikmuseum Tettnang]3 and the marshmallow building challenge by Toolbox BODENSEE. I also want to have a look into the Minecraft smart-home, Nodebots, and Freifunk.

Sending music over light

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: https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/04/VID-20160417-162947-3.m4v 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.

Web connected NeoPixel ring

It’s taken a while (as you can tell from the date on the box), but here’s my web connected NeoPixel ring: https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/Vid-20160207-165253-1.m4v Chroma trail: a comet with a trail that cycles through the colours of the rainbow. I had to turn the brightness down so the camera didn’t saturate, as you can see in the next one: https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/02/raindrops.mp4 Raindrops: randomly coloured drops that fade away. This is a WRTnode board running a Python server.

Fading text on an OLED screen

Here’s my hack of the moment: text fading in on a OLIMEX 128×64 OLED display. The interesting bit is that this is a TTF font which is rendered by SDL2 into a buffer, dithered into black and white using Floyd-Steinberg error diffusion, and then written out using the Intel IoT upm display driver. Optimizing the bulk write routine got the frame rate up from ~4 FPS to ~15 FPS.

Adding buttons on the Linkit Smart

Here’s what I found out while trying to add buttons to the OpenWrt based Linkit Smart. The flow is: Keys are defined in target/linux/ramips/dts/LINKIT7688.dts gpio-button-hotplug emulates gpio-keys-polled and generates uevents. The uevent is received onver netlink by procd in plug/hotplug.c The event is dispatched via /etc/hotplug.json The standard dispatch rule calls /etc/rc.buttons/$BUTTON The DTS fragment is: gpio-keys-polled { … btn2 { label = “btn2”; gpios = <&gpio0 2 1; linux,code = <0x102; }; where the <&#038;gpio0 2 1> picks the second pin from the zeroth port i.

Hack of the day: scrolling text

I did a quick hack today and wrote a scrolling text app for an Adafruit 8×8 LED display I had lying about: https://juju.net.nz/michaelh/blog/wp-content/uploads/2016/01/udisplay-with-scrolling-text.mp4 The app is written in C++ using the Intel mraa I/O library (which looks pretty good) and running on a WRTNODE MIPS dev board with OpenWrt. The interesting bit is the text rendering: I started with a 6×8 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.