README
¶
SeedHammer controller program
This repository contains the source code to run the controller program for the SeedHammer engraving machine. It runs on the same hardware as the SeedSigner: Raspberry Pi Zero or Zero W, a WaveShare 1.3 inch 240x240 LCD hat and a Pi Zero compatible camera with a OV5647 sensor.
Installation
Write seedhammer-vX.Y.X.img
to an SD-card and insert that into the SD-card
slot on the Raspberry Pi.
Linux
The dd
command writes the image to the block device /dev/sdX
:
$ dd if=result/seedhammer-vX.Y.Z.img of=/dev/sdX bs=1M
macOS
Use a similar command as for Linux or a GUI tool such as balenaEtcher.
Building from source
To build a complete seedhammer.img
image, Nix with flakes enabled is required.
The default Nix package in flake.nix
builds the image:
$ nix build github:seedhammer/seedhammer
$ ls result/seedhammer.img
The seedhammer.img
image contains the Pi Zero firmware, the Linux kernel and drivers, and the
controller
program that drives the Pi hardware and engraver.
To build a versioned image, use the mkrelease
script and specify a tag:
$ nix run github:seedhammer/seedhammer#mkrelease vx.y.z
the resulting image will embed the version. The command also accepts git branches or commits.
Reproducible builds
The build process is designed to be deterministic; that is, images produced with the above steps should match the released images bit-for-bit. If not, please open an issue.
Use a tool such as shasum
or sha256sum
to verify that the release binary matches.
Development
Update through USB
There is a crude facility to replace and restart the controller binary on a running device. First, build and prepare a debug build of the image
$ nix build .#image-debug
from a local clone of this repository. Then write result/seedhammer-debug.img
to an SD-card.
Connect the device to your machine with a USB cable to the USB port closest to the mini-HDMI
port of the device; that is, the port usually used to communicate with the engraver.
Then, to upload and run a new version of the controller binary, run
$ export USBDEV=/dev/cu.usbmodem101 # Or (usually) /dev/ttyUSB0 on Linux.
$ nix run .#reload $USBDEV
In debug mode, logging output from the controller is routed through the USB serial device. Use
$ cat $USBDEV
to show the log on your terminal. The nix .#reload
command automatically does this after reloading.
Remote control
There are few commands available to remote control, or script, the device in debug mode.
$ echo "input up" > $USBDEV
sends one or more button events to the device. Available buttons are: up
, down
, left
, right
, center
,
b1
, b2
, b3
.
$ echo "runes ACCIDENT" > $USBDEV
sends text to the device, where every space and the newline sends an implicit input b2
. Useful for scripting the input of seeds.
$ echo "screenshot" > $USBDEV
instructs the controller to dump a screenshot to the SD card.
Dry-run engraving
Testing the engraving process without actually spending a plate can be done in dry-run mode. It's activated by long-pressing the middle button on the engraving screen. When dry-run is enabled, a small notice is shown in the lower right corner of the screen.
License
The files is this repository are in the public domain as described in the LICENSE file, except files in directories with their own LICENSE files.
Directories
¶
Path | Synopsis |
---|---|
package address derives recieve and change addresses from output descriptors.
|
package address derives recieve and change addresses from output descriptors. |
package backup implements the SeedHammer backup scheme.
|
package backup implements the SeedHammer backup scheme. |
bc
|
|
bytewords
Package bytewords implements the the bytewords standard as described in [BCR-2020-012].
|
Package bytewords implements the the bytewords standard as described in [BCR-2020-012]. |
fountain
Package fountain implements the fountain encoding used by the Uniform Resources (UR) format described in [BCR-2020-005].
|
Package fountain implements the fountain encoding used by the Uniform Resources (UR) format described in [BCR-2020-005]. |
ur
Package ur implements the Uniform Resources (UR) encoding specified in [BCR-2020-005].
|
Package ur implements the Uniform Resources (UR) encoding specified in [BCR-2020-005]. |
urtypes
Package urtypes implements decoders for UR types specified in [BCR-2020-006].
|
Package urtypes implements decoders for UR types specified in [BCR-2020-006]. |
xoshiro256
Package xoshiro256 implements the xoshiro256** pseudo-random number generator.
|
Package xoshiro256 implements the xoshiro256** pseudo-random number generator. |
package bip32 contains helper functions for operating on bitcoin bip32 extended keys.
|
package bip32 contains helper functions for operating on bitcoin bip32 extended keys. |
package bip39 represents and converts bitcoin bip39 mnemonic phrases.
|
package bip39 represents and converts bitcoin bip39 mnemonic phrases. |
cmd
|
|
cli
command cli is the internal tool for testing the SeedHammer engraver.
|
command cli is the internal tool for testing the SeedHammer engraver. |
controller
command controller is the user interface for engraving SeedHammer plates.
|
command controller is the user interface for engraving SeedHammer plates. |
markers
package markers is the tools for marking the top plate of the SeedHammer machine.
|
package markers is the tools for marking the top plate of the SeedHammer machine. |
driver
|
|
drm
package drm implements a display on top of dumb DRM devices.
|
package drm implements a display on top of dumb DRM devices. |
libcamera
package libcamera implements an interface to the libcamera2 camera driver.
|
package libcamera implements an interface to the libcamera2 camera driver. |
mjolnir
package mjolnir implements a driver for the MarkingWay engraving machine.
|
package mjolnir implements a driver for the MarkingWay engraving machine. |
wshat
package input implements an input driver for the joystick and buttons on the Waveshare 1.3" 240x240 HAT.
|
package input implements an input driver for the joystick and buttons on the Waveshare 1.3" 240x240 HAT. |
package engrave transforms shapes such as text and QR codes into line and move commands for use with an engraver.
|
package engrave transforms shapes such as text and QR codes into line and move commands for use with an engraver. |
font
|
|
constant
Code generated by font/vector/convert.go; DO NOT EDIT.
|
Code generated by font/vector/convert.go; DO NOT EDIT. |
vector
package font converts an OpenType font into a form usable for engraving.
|
package font converts an OpenType font into a form usable for engraving. |
package gui implements the SeedHammer controller user interface.
|
package gui implements the SeedHammer controller user interface. |
assets
Code generated by gui/assets/gen.go; DO NOT EDIT.
|
Code generated by gui/assets/gen.go; DO NOT EDIT. |
alpha4
Package alpha4 implements an image.Alpha replacement with compact 4-bit alpha values.
|
Package alpha4 implements an image.Alpha replacement with compact 4-bit alpha values. |
ninepatch
package ninepatch contains an image.Image implementation of stretchable images in 9-patch format.
|
package ninepatch contains an image.Image implementation of stretchable images in 9-patch format. |
paletted
Package paletted implements a image.Paletted replacement with a more compact encoding.
|
Package paletted implements a image.Paletted replacement with a more compact encoding. |
rgb565
Package rgb565 contains an image.RGBA64Image implementation of a 16-bit RGB565 image.
|
Package rgb565 contains an image.RGBA64Image implementation of a 16-bit RGB565 image. |
package nonstandard implements parsing of non-standard bitcoin output descriptors.
|
package nonstandard implements parsing of non-standard bitcoin output descriptors. |
Package seedqr encodes and decodes [SeedQR] and CompactSeedQR formats.
|
Package seedqr encodes and decodes [SeedQR] and CompactSeedQR formats. |