Add Bash Register article

This commit is contained in:
2026-01-25 12:44:03 -07:00
parent 1f85f22e7a
commit c6ee4beb11
7 changed files with 46 additions and 18 deletions

31
content/Bash Register.md Normal file
View File

@@ -0,0 +1,31 @@
Title: Bash Register
Date: 2026-01-25
Category: Creations
Summary: An old cash register with a thermal receipt printer.
Image: bash-register1.jpg
The Bash Register is an old cash register that my friend and I stuck a Raspberry Pi Linux computer into. It's connected to a thermal receipt printer that prints images sent from the member portal [[Spaceport]] running at my local makerspace, [[Protospace]].
![[bash-register1.jpg]]
Protospace members are able to draw images on the portal:
![[bash-register2.jpg]]
Draw controls include colour, eraser, size, shade, undo history, and reset. The current drawing is stored in local storage so it doesn't get lost if the user accidentally navigates away.
Once a drawing is submitted, its filename is sent to the Raspberry Pi via MQTT. A simple [Python script](https://git.tannercollin.com/tanner/bashregister/src/branch/master/main.py) listens for the message and then immediately downloads and prints it.
All drawings are added to a gallery that can be publicly viewed [here](https://my.protospace.ca/gallery):
![[bash-register3.png]]
## Printing Garbage Bug
While developing the code, I was having an issue where every second print would output several inches of garbage characters instead of the image. After hours of debugging it seemed related to the height of the image being printed. I used `git bisect` to narrow it down to a commit where the canvas's height was changed.
It turned out to be a bug with the printer that happens when printing images with a height that's a multiple of 96 pixels tall:
<https://github.com/python-escpos/python-escpos/issues/367>
The fix for this was simply adjusting the aspect ratio of the canvas on the portal.

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

View File

@@ -50,10 +50,6 @@
height: auto; height: auto;
color-scheme: light; color-scheme: light;
} }
.floated {
float: left;
margin-right: 1rem;
}
@media screen and (min-width:63rem) { @media screen and (min-width:63rem) {
.content .aside { .content .aside {
display: inline; display: inline;

View File

@@ -12,13 +12,13 @@ Lead Hardware Engineer - Critical Control, '16-'18
Electrical Engineer - Pivotal Aero, '16-'16 Electrical Engineer - Pivotal Aero, '16-'16
BSc Electrical Engineering - University of Calgary BSc Electrical Engineering - University of Calgary
Blog Creations
<a href=6>Makerspace Tours <a href=3>Bash Register
<a href=p>Bypassing ISP Blocked Ports <a href=0>Protovac Terminal
<a href=j>Japan Photography <a href=7>Fake Dog for Home Security
<a href=h>Hydroponics <a href=5>Garage Door Opener Hack
<a href=x>[more]</a> <a href=z>[more]</a>
Projects Projects
@@ -28,10 +28,10 @@ Projects
<a href=n>Notica <a href=n>Notica
<a href=y>[more]</a> <a href=y>[more]</a>
Creations Blog
<a href=7>Fake Dog for Home Security <a href=h>Hydroponics
<a href=5>Garage Door Opener Hack <a href=j>Japan Photography
<a href=3>Theatre Acoustic Panels <a href=p>Bypassing ISP Blocked Ports
<a href=0>Wine Crate Coffee Table <a href=6>Backup Strategy
<a href=z>[more] <a href=x>[more]

View File

@@ -156,9 +156,10 @@
} }
.content img { .content img {
width: 100%; max-width: min(100%, 36rem);
max-width: 36rem; max-height: 36rem;
height: auto; height: auto;
width: auto;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }