Archive for category Software

Red Oaks Mill APRS iGate: KE4ZNU-10

APRS coverage of this part of the Mighty Wappinger Creek Valley isn’t very good, particularly for our bicycle radios (low power, crappy antennas, lousy positions), so I finally got around to setting up a receive-only APRS iGate in the attic.

The whole setup had that lashed-together look:

KE4ZNU-10 APRS iGate - hardware

KE4ZNU-10 APRS iGate – hardware

It’s sitting on the bottom attic stair, at the lower end of a 10 °F/ft gradient, where the Pi 3’s onboard WiFi connects to the router in the basement without any trouble at all.

After about a week of having it work just fine, I printed a case from Thingiverse:

KE4ZNU-10 APRS iGate - RPi TNC-Pi case

KE4ZNU-10 APRS iGate – RPi TNC-Pi case

Minus the case, however, you can see a TNC-Pi2 kit atop a Raspberry Pi 3, running APRX on a full-up Raspbian Jessie installation:

RPi TNC-Pi2 stack - heatshrink spacers

RPi TNC-Pi2 stack – heatshrink spacers

You must solder the TNC-Pi2 a millimeter or two above the feedthrough header to keep the component leads off the USB jacks. The kit includes a single, slightly too short, aluminum standoff that would be perfectly adequate, but I’m that guy: those are four 18 mm lengths of heatshrink tubing to stabilize the TNC, with the obligatory decorative Kapton tape.

The only misadventure during kit assembly came from a somewhat misshapen 100 nF ceramic cap:

Monolithic cap - 100 nF - QC failure

Monolithic cap – 100 nF – QC failure

Oddly, it measured pretty close to the others in the kit package. I swapped in a 100 nF ceramic cap from my heap and continued the mission.

The threaded brass inserts stand in for tiny 4-40 nuts that I don’t have. The case has standoffs with small holes; I drilled-and-tapped 4-40 threads and it’ll be all good.

The radio, a craptastic Baofeng UV-5R, has a SMA-RP to UHF adapter screwed to the cable from a mobile 2 meter antenna on a random slab of sheet metal on the attic floor. It has Kenwood jack spacing, but, rather than conjure a custom plug, I got a clue and bought a pair of craptastic Baofeng speaker-mics for seven bucks delivered:

Baofeng speaker-mic wiring

Baofeng speaker-mic wiring

For reference, the connections:

Baofeng speaker-mic cable - pins and colors

Baofeng speaker-mic cable – pins and colors

Unsoldering the speaker-mic head and replacing it with a DE-9 connector didn’t take long.

The radio sits in the charging cradle, which probably isn’t a good idea for the long term. The available Baofeng “battery eliminators” appear to be even more dangerously craptastic than the radios and speaker-mics; I should just gut the cheapest one and use the shell with a better power supply.

I initially installed Xastir on the Pi, but it’s really too heavyweight for a simple receive-only iGate. APRX omits the fancy map displays and runs perfectly well in a headless installation with a trivial setup configuration.

There are many descriptions of the fiddling required to convert the Pi 3’s serial port device names back to the Pi / Pi 2 “standard”. I did some of that, but in point of fact none’d required for the TNC-Pi2; use the device name /dev/serial0 and it’s all good:

<interface>
serial-device /dev/serial0 19200 8n1 KISS
callsign $mycall # callsign defaults to $mycall
tx-ok false # transmitter enable defaults to false
telem-to-is false # set to 'false' to disable
</interface>

Because the radio looks out over an RF desert, digipeating won’t be productive and I’ve disabled the PTT. All the received packets go to the Great APRS Database in the Cloud:

server   noam.aprs2.net

An APRS reception heat map for the last few days in August:

KE4ZNU-10 Reception Map - 2016-08

KE4ZNU-10 Reception Map – 2016-08

The hot red square to the upper left reveals a peephole through the valley walls toward Mary’s Vassar Farms garden plot, where her bike spends a few hours every day. The other hotspots show where roads overlap the creek valley; the skinny purple region between the red endcaps covers the vacant land around the Dutchess County Airport. The scattered purple blocks come from those weird propagation effects that Just Happen; one of the local APRS gurus suggests reflections from airplane traffic far overhead.

An RPi 3 is way too much computer for an iGate: all four cores run at 0.00 load all day long. On the other paw, it’s $35 and It Just Works.

2 Comments

Miniblind Cord Caps

After smashing one of the cord pulls between the sash and the frame:

Miniblind cord caps - installed

Miniblind cord caps – installed

The glittery PETG looks surprisingly good in the sunlight that will eventually change it into dullness. The black flecks come from optical effects in the plastic, not the usual burned PETG snot.

The solid model is basically a hull around two “spheres”, truncated on top & bottom:

Miniblind cord cap - solid model

Miniblind cord cap – solid model

The interior has a taper to accommodate the knot, but they’re chunky little gadgets:

Miniblind cord cap - solid model - bottom

Miniblind cord cap – solid model – bottom

I thought the facets came out nicely, even if they’re mostly invisible in the picture.

Each pull should build separately to improve the surface finish, so I arranged five copies in sequence from front to back:

Miniblind cord cap - 5 sequential - Slic3r preview

Miniblind cord cap – 5 sequential – Slic3r preview

If you’re using an M2, the fans hanging off the front of the filament drive housing might come a bit too close for comfort, so rotate ’em upward and out of the way.

If you remove the interior features and flip ’em upside down, they’d work well in Spiral Vase mode. You’d have to manually drill the top hole, though, because a hole through the model produces two shells.

The OpenSCAD source code as a GitHub Gist:

,

2 Comments

Counterfeit FTDI USB-Serial Adapter Roundup

As part of the vacuum tube lighting project, I picked up a bunch of USB-Serial adapters, with the intent of simply building them into the lamp base along with a knockoff Arduino Pro Mini, then plugging in a cheap USB wall wart for power. An Arduino Nano might make more sense, but this lets me use the Pro Minis for other projects where power comes from elsewhere.

Anyhow, I deliberately paid a few bucks extra for “genuine” FTDI chips, knowing full well what was about to happen:

Assorted FT232 Converters

Assorted FT232 Converters

The two boards on the bottom have been in my collection forever and seem to be genuine FTDI; the one on the left came from Sparkfun:

FT232RL - genuine

FT232RL – genuine

The top six have counterfeit chips, although you’d be hard-pressed to tell from the laser etching:

FT232RL - fake

FT232RL – fake

In addition to the boards, I picked up the blue square-ish cable adapters for the HP 7475A plotter project and, again, paid extra for “genuine” FTDI chips. The other adapters, based on Prolific PL2303 chips, I’ve had basically forever:

Assorted FT232 Converters - Cabled

Assorted FT232 Converters – Cabled

Those two have chips with different serial numbers: genuine FTDI chips get different serial numbers programmed during production. The counterfeits, well, they’re all pretty much the same.

Display the serial numbers thusly:

lsusb
Bus 002 Device 024: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
... snippage ...
udevadm info --query=all --attribute-walk  --name=/dev/bus/usb/002/024 | grep ser
    ATTR{serial}=="A6005qSB"

All the counterfeit FTDI chips report the same serial number: A50285BI. The PL2303 chips don’t report serial numbers.

For my simple needs, they all work fine, but apparently fancier new microcontrollers expect more from their adapters and the counterfeits just can’t live up to their promises.

For a while, FTDI released Windows drivers that bricked counterfeit chips; the Linux drivers were unaffected.

6 Comments

ITead Studio Quasi-Colorduino RGB LED Matrix Shield: Redesign Doodles

Some notes on a recent acquisition that ought to allow random dots with individual brightness control (unlike my simple resistor-limited hack job):

Color Shield - DM163 M54565 - demo

Color Shield – DM163 M54565 – demo

A Colorduino is a dedicated board that combines an Arduino-class microcontroller with hardware drivers for an 8×8 RGB LED matrix, with daisy-chaining I/O to build bigger displays. The Colors Shield you see above omits the Arduino circuitry and daisy-chaining hardware: it plugs atop an ordinary Arduino UNO-class board as a dedicated 8×8 tile driver.

I do not profess to understand the ancestry & family tree of those designs and their various incarnations. This schematic doesn’t match the knockoff hardware in hand, which isn’t surprising after half a dozen years of relentless product cheapnification:

ITeadStudio - RGB LED shield - DM163 M54564 - SPI notes

ITeadStudio – RGB LED shield – DM163 M54564 – SPI notes

It comes close enough for a big-picture overview…

The DM163 has 8×3 constant current sink PWM pins that connect to the column cathodes of the RGB matrix. It provides either 8 or 6 bits of PWM control for each output, with either 6 or 8 bits of gamma correction to make the grayscale shades work out properly (those are separate shift registers and the PWM generators use both, so the chip doesn’t care how you divvy up the 14 bits).

The three 1 kΩ resistors set the current to 60 mA per output pin. The LED matrix might support anywhere from  70 to 120 mA peak current per LED, but I doubt the supplied matrix matches any of the available datasheets. The total current depends on the number of LEDs lit on each row, so large dark areas are a Good Thing.

The serial protocol looks enough like SPI to get by, with controls for Reset, Latch, and Bank Select.

The board has no power supply other than the single Arduino VCC pin, so you’re looking at a peak of 24 x 60 mA = 1.44 A through that pin. The Arduino regulator must supply that load pretty much full-time, which is obviously a Bad Thing; plan on plenty of dark areas.

The DM163 SPI connections don’t use the Arduino’s hardware SPI, so it’s full-frontal bit-banging all the way. Three DM163 control bits use a trio of analog inputs as digital outputs. No harm in that, works fine with the knockoff Neopixels.

The M54564 is a PNP high-side driver converting logic-level inputs to the current required for the row anodes of the matrix. The eight input bits are non-contiguous across the Arduino’s digital outputs. You could turn on all the M54564 outputs at once, which would be a Bad Thing.

You shift 24 bytes of RGB data into the DM163 and latch the data, then raise one of the M54564 inputs to enable a given row of LEDs, which light up with the corresponding colors.

The bit-banged SPI runs at 1.9 µs/bit and sending all 24 bits to the DM163 requires 450 µs. With a 100 Hz refresh, that’s a mere 5% overhead, but the fact that the board soaks up essentially all the I/O pins means the Arduino isn’t not doing much else in the way of real-world interaction.

The Arduino driver, of dubious provenance, sets Timer 0 for 100-ish Hz interrupts. Each interrupt shifts another batch of bytes into the DM163 and selects the appropriate row. The driver uses a double-buffered array that soaks up 2x8x8x3 = 384 bytes of precious RAM, in addition to a bunch of working storage.

If I were (re)designing this board…

A separate power input jack for the DM163 that might optionally feed the Arduino’s VIN raw power pin.

Use the Arduino SPI hardware, dammit.

Put an HC595 shift register behind the M54564, so you’d shift 24 + 8 = 32 bits into the board, then strobe the latches. That eliminates eight digital pins used as a parallel port.

You’d surely want to disable the row driver while switching the column drivers to avoid ghosting, so figure on a separate output enable for the HC595. That tri-states the 595’s outputs; although the M54564 has internal pulldowns, it might need more.

It’s entirely usable as-is, but sheesh it’d be so easy to do a better job. That wouldn’t be software compatible with all the Arduino Love for the existing boards out there; there’s no point.

 

,

Leave a comment

Epson R380 Printer: Resetting the Waste Ink Counter Again

The Epson R380 printer never gets turned off, so it rarely has a chance to complain. After a powerdown due to refreshing the UPS batteries, it lit up with the dreaded “Service required. Visit your friendly Epson repair center” message that indicates you should just throw the printer out, because replacing the internal ink absorber mats / draining the internal tank is, mmm, economically infeasible when you pay somebody else to do it.

Having done this before, though, it’s almost easy…

  • Pop a PC with a Windows partition off the to-be-recycled stack
  • Boot System Rescue CD
  • Back up the partition to a junk hard drive, just for practice
  • Copy the subdirectory of sketchy utilities to the Windows drive
  • Boot Windows (with no network connection)
  • Run sketchy utility to reset the ink counter
  • Boot SRC, restore partition
  • Return hard drive & PC to their respective piles
  • Declare victory and move on

This time, a sketchy utility that resembled the Official Epson Reset Program actually reset something and the printer started up normally. As before, however, the saved MBR didn’t match the on-disk MBR, suggesting that either I don’t understand how to save / restore the MBR or that something once again meddled with the MBR in between the backup and the restore.

I’ve emptied the waste ink tank maybe three times since the last reset: plenty of ink down the drain. Fortunately, I loves me some good continuous-flow ink supply action…

Sheesh & similar remarks.

Leave a comment

Random LED Dots: Entropy Library for Moah Speed with Less Gimcrackery

A discussion over the Squidwrench Operating Table about injecting entropy into VMs before / during their boot sequence reminded me that I wanted to try the Entropy library with my 8×8 RGB LED matrix:

8x8 RGB LED Matrix - board overview

8×8 RGB LED Matrix – board overview

The original version trundled along with random numbers produced by timing Geiger counter ticks. The second version, digitizing the amplified noise from a reverse-biased PN junction, ran much faster.

What’s new & different: the Entropy library measures the jitter between the ATmega328 watchdog timer’s RC oscillator and the ceramic resonator (on Pro Mini boards) driving the CPU. It cranks out four bytes of uncorrelated bits every half-second, which isn’t quite fast enough for a sparkly display, but re-seeding the Arduino PRNG whenever enough entropy arrives works well enough.

One could, of course, re-seed the PRNG with Geiger bits or junction noise to the same effect. The key advantage of the Entropy library: no external hardware required. The downside: no external hardware required, so, minus those techie transistors / resistors / op amps, it will look like Just Another Arduino Project.

Reverse-bias noise amplifier - detail

Reverse-bias noise amplifier – detail

Le sigh.

In any event, the Entropy library has excellent documentation and works perfectly.

The Arduino PRNG can produce results fast enough for wonderfully twinkly output that’s visually indistinguishable from the “true” random numbers from the Geiger counter or PN junction. I dialed it back to one update every 5 ms, because letting it free-run turned the display into an unattractive blur.

The top trace shows the update actually happens every 6 ms:

Entropy TRNG - LED update vs refresh

Entropy TRNG – LED update vs refresh

The lower trace shows that each matrix row refresh takes about a millisecond. Refreshes occur on every main loop iteration and interfere with the update, not that that makes any difference. Should it matter, subtract one from the update period and it’ll be all good.

The Arduino source code as a GitHub Gist:

,

3 Comments

Kenmore Progressive Vacuum Tool Adapters: First Failure

I picked up a horsehair dust brush from eBay as a lightweight substitute for the Electrolux aluminum ball, discovered that an adapter I’d already made fit perfectly, did the happy dance, and printed one for the brush. That worked perfectly for half a year, whereupon:

Dust Brush Adapter - broken parts

Dust Brush Adapter – broken parts

It broke about where I expected, along the layer lines at the cross section where the snout joins the fitting. You can see the three perimeter shells I hoped would strengthen the part:

Dust Brush Adapter - layer separation

Dust Brush Adapter – layer separation

That has the usual 15% 3D Honeycomb infill, although there’s not a lot area for infill.

There’s obviously a stress concentration there and making the wall somewhat thicker (to get more plastic-to-plastic area) might suffice. I’m not convinced the layer bonding would be good enough, even with more wall area, to resist the stress; that’s pretty much a textbook example of how & where 3D printed parts fail.

That cross section should look like this:

Dust Brush Adapter - Snout infill - Slic3r preview

Dust Brush Adapter – Snout infill – Slic3r preview

Anyhow, I buttered the snout’s broken end with JB Kwik epoxy, aligned the parts, and clamped them overnight:

Dust Brush Adapter - clamping

Dust Brush Adapter – clamping

The source code now has a separate solid model for the dust brush featuring a slightly shorter snout; if when the epoxy fails, we’ll see how that changes the results. I could add ribs and suchlike along the outside, none of which seem worth the effort right now. Fairing the joint between those two straight sections would achieve the same end, with even more effort, because OpenSCAD.

The OpenSCAD source code as a GitHub Gist:

 

, , ,

8 Comments