diff --git a/content/Bash Register.md b/content/Bash Register.md new file mode 100644 index 0000000..32c0acc --- /dev/null +++ b/content/Bash Register.md @@ -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: + + + +The fix for this was simply adjusting the aspect ratio of the canvas on the portal. \ No newline at end of file diff --git a/content/media/bash-register1.jpg b/content/media/bash-register1.jpg new file mode 100644 index 0000000..225a5cc Binary files /dev/null and b/content/media/bash-register1.jpg differ diff --git a/content/media/bash-register2.jpg b/content/media/bash-register2.jpg new file mode 100644 index 0000000..73205aa Binary files /dev/null and b/content/media/bash-register2.jpg differ diff --git a/content/media/bash-register3.png b/content/media/bash-register3.png new file mode 100644 index 0000000..7ad4c09 Binary files /dev/null and b/content/media/bash-register3.png differ diff --git a/themes/lite/templates/base.html b/themes/lite/templates/base.html index bbfe2cc..4b0b7ad 100644 --- a/themes/lite/templates/base.html +++ b/themes/lite/templates/base.html @@ -50,10 +50,6 @@ height: auto; color-scheme: light; } - .floated { - float: left; - margin-right: 1rem; - } @media screen and (min-width:63rem) { .content .aside { display: inline; diff --git a/themes/lite/templates/index.html b/themes/lite/templates/index.html index 8386884..e19372e 100644 --- a/themes/lite/templates/index.html +++ b/themes/lite/templates/index.html @@ -12,13 +12,13 @@ Lead Hardware Engineer - Critical Control, '16-'18 Electrical Engineer - Pivotal Aero, '16-'16 BSc Electrical Engineering - University of Calgary -Blog +Creations -Makerspace Tours -Bypassing ISP Blocked Ports -Japan Photography -Hydroponics -[more] +Bash Register +Protovac Terminal +Fake Dog for Home Security +Garage Door Opener Hack +[more] Projects @@ -28,10 +28,10 @@ Projects Notica [more] -Creations +Blog -Fake Dog for Home Security -Garage Door Opener Hack -Theatre Acoustic Panels -Wine Crate Coffee Table -[more] +Hydroponics +Japan Photography +Bypassing ISP Blocked Ports +Backup Strategy +[more] diff --git a/themes/theme/templates/style.css b/themes/theme/templates/style.css index 11d1943..61ef1c1 100644 --- a/themes/theme/templates/style.css +++ b/themes/theme/templates/style.css @@ -156,9 +156,10 @@ } .content img { - width: 100%; - max-width: 36rem; + max-width: min(100%, 36rem); + max-height: 36rem; height: auto; + width: auto; display: block; margin: 0 auto; }