Archive for category Software

Bandsaw Worklight: USB Gooseneck Mount

The bandsaw now sports a chunky mount for its gooseneck light:

USB Gooseneck Mount - on bandsaw

USB Gooseneck Mount – on bandsaw

The gooseneck ends in a USB Type-A plug, so an ordinary USB extension cable can connect it to the hacked hub supplying 9 VDC:

USB Gooseneck Mount - interior

USB Gooseneck Mount – interior

The plastic came from a slightly earlier version of the solid model, with one foam pad under the gooseneck’s USB plug to soak up the clearance. The four smaller holes, with M3 brass inserts visible in the bottom half (on the right), clamp the gooseneck connector in place against the foam; you could push it out if you were really determined, but you’d have to be really determined.

If I ever build another one, it’ll sandwich the plug between opposing pads:

USB Gooseneck Connector Mount - Slic3r preview

USB Gooseneck Connector Mount – Slic3r preview

The lettering on the block stands out much better in the solid model:

USB Gooseneck Connector Mount - solid model - overview

USB Gooseneck Connector Mount – solid model – overview

Obviously, I need help with the stylin’ thing. This looks better, but with terrible overhangs for printing in the obvious no-support orientation:

USB Gooseneck Connector Mount - solid model - rounded top

USB Gooseneck Connector Mount – solid model – rounded top

Anyhow, the USB extension cable (on the left) has plenty of clearance and pulls straight out of the housing, so I can remove the bandsaw cover without unwiring:

USB Gooseneck Mount - assembled

USB Gooseneck Mount – assembled

The LED ticks along at 40 °C in a 14 °C basement, suggesting a thermal coefficient around 14 °C/W. Even in the summer months, with the basement around 25 °C, there’s no risk of PETG softening at 50 °C.

I’ll epoxy a similar 1.8 W COB LED onto the curve of the bandsaw frame where it can shine on the left and rear part of the table; it doesn’t even need a case.

The OpenSCAD source code as a GitHub Gist:



1 Comment

NESDR Mini 2+ vs. Input Terminator

A tiny handful of known-good-quality SMA terminators arrived from eBay:

KDI T187GS - 50 ohm 1 W SMA attenuators

KDI T187GS – 50 ohm 1 W SMA attenuators

They’re described as KDI Triangle T187GS SMA Female Terminator, 50Ω, 1W, 0-4GHz. A bit of searching suggests MCE (whoever they are) borged KDI quite a while ago (their website, last updated in 2003, has been lightly vandalized) and a datasheet won’t be forthcoming.

In any event, a NooElec NESDR Mini 2+ radio connected to a dual-band VHF-UHF antenna perched near a window shows this for a local FM station:

FM 101.5 NESDR - direct

FM 101.5 NESDR – direct

Zooming to 5 dB/div:

FM 101.5 NESDR - 5 dB steps

FM 101.5 NESDR – 5 dB steps

Installing the terminator at the end of an MCX-to-SMA adapter cable:

FM 101.5 NESDR - 50 ohm terminator

FM 101.5 NESDR – 50 ohm terminator

Haven’t a clue about those tiny little spikes with the terminator in place, but they don’t line up with any of the high-energy inputs and are, most likely, junk brewed up within the radio. That’s with the RF gain set to 49.6 dB and AGC turned off.

The hardware looks like this:

NESDR with SMA attenuators

NESDR with SMA attenuators

The MCX connector on the radio isn’t the most durable-looking thing I’ve ever seen, so strapping the adapter cable to the case seems like a Good Idea. You can get an NESDR radio with an SMA connector for about the same price, which I’d have done if were available a while ago.

The terminated input looks to be about -75 dBFS, about 15 dB below the between-station noise, and the carrier tops out around -25 dBFS, for a “dynamic range” of 50 dB. Oddly, that’s just about dead on the maximum dynamic range you can get from the 8 bit RTL2832U demodulator / ADC stuffed inside the NESDR: 8 bits × 6 dB/bit.

It is not obvious to me the signal from a randomly chosen (albeit powerful) FM station should exactly fill the receiver’s dynamic range, particularly without AGC riding herd on the RF gain. Some hardware tinkering seems in order.

The GNU Radio flow graph:

FM Broadcast - GNU Radio flow

FM Broadcast – GNU Radio flow



Unicode Keyboard Flameout and Workaround

For unknown reasons, probably having to do with the unmitigated disaster of trying to get an SDRPlay radio working with GNU Radio (about which, more later), Unicode keyboard input stopped working. This is not to be tolerated, because engineering notation requires a lot of Greek letters.

Unicode support seems to be baked into the lowest levels of the Linux operating system, although it’s not clear to me whether it’s in X, QT, GTK, or somewhere else. Googling the obvious keywords was unavailing; evidently this feature never ever fails or, more likely, very few people use it to any extent.

Note that I already have the Compose key set up, but Compose sequences don’t include Greek letters.

After considerable flailing, I added the Simple Greek keyboard layout and defined the (otherwised unused) Menu key as the keyboard layout switcher. That’s a pretty big hammer for a rather small problem; I devoutly hope Unicode mysteriously starts working again.

For reference, the Greek keyboard layout looks like this:

Greek keyboard layout

Greek keyboard layout

I’d have put Ω on the W key, rather than V, but that’s just because so many fonts do exactly that.



60 kHz Preamp: Board Holder

A cleaned up version of my trusty circuit board holder now keeps the 60 kHz preamp off what passes for a floor in the attic:

Preamp in attic

Preamp in attic

The solid model became slightly taller than before, due to a serious tangle of wiring below the board, with a narrower flange that fits just as well in the benchtop gripper:

Proto Board - 80x110

Proto Board – 80×110

Tidy brass inserts epoxied in the corners replace the previous raw screw holes in the plastic:

Proto Board Holder - 4-40 inserts and screws

Proto Board Holder – 4-40 inserts and screws

The screws standing on their heads have washers epoxied in place, although that’s certainly not necessary; the dab of left-over epoxy called out for something. The screws got cut down to 7 mm after curing.

The preamp attaches to a lumpy circle of loop antenna hung from the rafters and returns reasonable results:

WWVB - morning - 2017-01-16

WWVB – morning – 2017-01-16

The OpenSCAD source code as a GitHub Gist:

, ,

1 Comment

Raspberry Pi CPU Temperature Watcher

Having just put a headless Raspberry Pi in the attic, the chip temperature is of some interest. Doing this in an SSH session comes in handy:

watch 'echo "scale=1 ; d = $(cat /sys/class/thermal/thermal_zone0/temp) / 1000 ; print d , \" °C\n\" " | bc'
# blank line to ensure the underscore displays correctly

Raspbian doesn’t have the bc calculator by default, so do that first.

For whatever it’s worth, the Pi starts out at 10 °C and warms over 60 °C under heavy load:

Every 2.0s: echo "scale=1 ; d = $(cat /sys/class/thermal/thermal_zone0/temp) / 1000 ; print d , \" °...  Sat Jan 14 19:58:59 2017

61.7 °C

It ticks along in the mid 30s under light load.

You can run all that in one tab of a terminal window through VNC. If you’ve got that much GUI goin’ on, just add a thermal monitor in the panel and be done with it.



Raspberry Pi vs. Avahi

It turns out that the various Avahi daemons performing the magick between whatever.local names and dotted-quad addresses for Raspberry Pi descend into gibbering madness when confronted with:

  • One name corresponding to multiple IP addresses
  • One IP address used for multiple MAC addresses
  • Multiple names for one IP address
  • Multiple names for one MAC address
  • Multiple IP addresses for one MAC address
  • Multiple MAC addresses for one IP address
  • Any and all combinations of the above at various times

The least of the confusion involved an incorrect IP address linked to a familiar name pulled from deep history by a baffled daemon doing the best it can with what it thinks it knows. Despite what I concluded, rather early in the process, there’s no real error, other than my performing what amounted to a self-inflicted fast-flux nameserver attack.

Anyhow, I devoted the better part of an afternoon to sorting out the mess, which involved labeling all the streaming radio players with their MAC addresses and rebooting them one-by-one to allow all the daemons time to recognize the current situation:

Raspberry Pi 3 - WiFi MAC address

Raspberry Pi 3 – WiFi MAC address

That label corresponds to the Pi 3’s on-board WiFi adapter.

For Pi 2 boxen, the MAC address travels with the WiFi adapter jammed into a USB port:

SunFounder WiFi Adapter - MAC address

SunFounder WiFi Adapter – MAC address

I didn’t label the (unused) Ethernet jacks, figuring I’d solve that problem after it trips me up.



Raspberry Pi Streaming Radio Player: Room Customization

Sometimes you (well, I) want a bit of late-night music, which is now one button press away. However, I initially set things up so the Raspberry Pi’s startup code executed a Python script on a network share from the file server in the basement, which shuts down around midnight after the daily backup.

Keeping a local copy meant having to update that copy whenever I tweak the code, a nuisance not to be tolerated. This Bash (or whatever) code in /etc/rc.local figures out if the server is up and, if so, updates the local copy from the server. If the server isn’t up, then it just runs with what it has:

# was !/bin/sh -e

... snippage ...


ping -c 1 $server
if [ $? -eq 0 ]
  mount -o ro ${server}:/mnt/bulkdata/Project\ Files/Streaming\ Media\ Player/Firmware/ /mnt/part
  rsync -auv /mnt/part/ /home/pi
  umount /mnt/part

sudo -u pi sh -c 'python /home/pi/ any' &

N.B.: you must remove the -e from the shebang, because otherwise the script jams to a stop when the ping fails. Took me a while to figure that out, yup.

Use raspi-config to force the startup sequence to wait until the network is available. Turns out that the DHCP process can stall for half a minute, so fixed timeouts don’t work.

Hardcoding the server IP address eliminates a whole bunch of mysterious failures apparently due to whatever handles the translation from mollusk.local to the dotted quad. Maybe that’s not really a problem, but I’ll run with it.

Now the streamers fetch the Latest and Greatest version whenever they’re on during the day and run their local copy, with the room parameter telling it where it lives.

Life is good!