a few fixes

This commit is contained in:
trav
2026-07-30 19:28:01 -07:00
parent f39be6b24b
commit cbedde6f6b
10 changed files with 171 additions and 101 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File
+13
View File
@@ -62,6 +62,19 @@ journalctl --user -u ssb-server.service -f
journalctl --user -u org.gnome.Kiosk.Script.service -f
```
### View kiosk.py Output
Since kiosk.py runs under `org.gnome.Kiosk.Script.service`, its stdout/stderr goes to the systemd journal:
```bash
# Follow kiosk.py output in real-time
journalctl --user -u org.gnome.Kiosk.Script.service -f
# See last 100 lines of kiosk.py output
journalctl --user -u org.gnome.Kiosk.Script.service -n 100
# See all output since last boot (no pager)
journalctl --user -u org.gnome.Kiosk.Script.service -b --no-pager
```
## How Boot Works
1. System boots, starts `gdm.service`
+2 -2
View File
@@ -32,10 +32,10 @@ class Kiosk(tk.Tk):
self.switch_frame(Screen0)
def switch_frame(self, frame_class, keep_history=True):
def switch_frame(self, frame_class, keep_history=True, **kwargs):
if keep_history and self.frame:
self.frames_history.append(type(self.frame))
new_frame = frame_class(self)
new_frame = frame_class(self, **kwargs)
if self.frame is not None:
self.frame.destroy()
self.frame = new_frame
+1 -1
View File
@@ -106,7 +106,7 @@ class Screen0(tk.Frame):
def go_to_about():
from kiosk.screens.intro import InfoPage1
master.switch_frame(InfoPage1)
master.switch_frame(InfoPage1, entry='about')
tk.Button(right_frame, text="About", command=go_to_about, height=4, width=75, bg='peach puff', font=GlobalVars.BUTTON_FONT).pack(side='top', pady=30)
+40 -40
View File
@@ -29,7 +29,7 @@ class HaveYouGeneratedTagScreen(tk.Frame):
master.switch_frame(ParticipationScreen)
def go_to_info1():
master.switch_frame(InfoPage1)
master.switch_frame(InfoPage1, entry='generate_tag')
# Buttons
tk.Button(container, text="yea", command=go_to_participation,
@@ -40,8 +40,9 @@ class HaveYouGeneratedTagScreen(tk.Frame):
class InfoPage1(tk.Frame):
"""Info Page 1 - Custo introduction with tags.jpg"""
def __init__(self, master):
def __init__(self, master, entry='about'):
tk.Frame.__init__(self, master, bg=BG_COLOR)
self.entry = entry
# Split the screen into two frames
left_frame = tk.Frame(self, bg=BG_COLOR)
@@ -87,29 +88,28 @@ It can print stickers and ribbons to affix to an item you care about."""
self.countdown_label.pack(side='left', expand=True)
self.countdown = 8
self.forward_btn = tk.Button(nav_frame, text="Forward →",
command=lambda: master.switch_frame(InfoPage2, entry=self.entry),
height=2, width=15, bg='light gray', font=GlobalVars.BUTTON_FONT, state='disabled')
self.forward_btn.pack(side='right', padx=40)
def update_countdown():
self.countdown -= 1
if self.countdown > 0:
self.countdown_label.config(text=str(self.countdown))
self.after(1000, update_countdown)
else:
self.countdown_label.pack_forget()
self.forward_btn.config(state='normal', bg='peach puff')
self.after(1000, update_countdown)
self.forward_btn = tk.Button(nav_frame, text="Forward →", command=lambda: master.switch_frame(InfoPage2),
height=2, width=15, bg='peach puff', font=GlobalVars.BUTTON_FONT)
def show_forward():
self.countdown_label.pack_forget()
self.forward_btn.pack(side='right', padx=40)
# Show forward button after 8 second delay
self.after(8000, show_forward)
class InfoPage2(tk.Frame):
"""Info Page 2 - Take care of each other with hard.jpg"""
def __init__(self, master):
def __init__(self, master, entry='about'):
tk.Frame.__init__(self, master, bg=BG_COLOR)
self.entry = entry
# Split the screen into two frames
left_frame = tk.Frame(self, bg=BG_COLOR)
@@ -148,7 +148,7 @@ by tagging an item you are saying to it, 'you matter, I will take care of you'""
nav_frame = tk.Frame(self, bg=BG_COLOR)
nav_frame.grid(row=1, column=0, columnspan=2, sticky='ew', pady=20)
tk.Button(nav_frame, text="← Back", command=lambda: master.switch_frame(InfoPage1),
tk.Button(nav_frame, text="← Back", command=lambda: master.switch_frame(InfoPage1, entry=self.entry),
height=2, width=15, bg='peach puff', font=GlobalVars.BUTTON_FONT).pack(side='left', padx=40)
# Countdown number indicator
@@ -156,29 +156,28 @@ by tagging an item you are saying to it, 'you matter, I will take care of you'""
self.countdown_label.pack(side='left', expand=True)
self.countdown = 8
self.forward_btn = tk.Button(nav_frame, text="Forward →",
command=lambda: master.switch_frame(InfoPage3, entry=self.entry),
height=2, width=15, bg='light gray', font=GlobalVars.BUTTON_FONT, state='disabled')
self.forward_btn.pack(side='right', padx=40)
def update_countdown():
self.countdown -= 1
if self.countdown > 0:
self.countdown_label.config(text=str(self.countdown))
self.after(1000, update_countdown)
else:
self.countdown_label.pack_forget()
self.forward_btn.config(state='normal', bg='peach puff')
self.after(1000, update_countdown)
self.forward_btn = tk.Button(nav_frame, text="Forward →", command=lambda: master.switch_frame(InfoPage3),
height=2, width=15, bg='peach puff', font=GlobalVars.BUTTON_FONT)
def show_forward():
self.countdown_label.pack_forget()
self.forward_btn.pack(side='right', padx=40)
# Show forward button after 8 second delay
self.after(8000, show_forward)
class InfoPage3(tk.Frame):
"""Info Page 3 - Mindful use, permanent storage, no shitposting"""
def __init__(self, master):
def __init__(self, master, entry='about'):
tk.Frame.__init__(self, master, bg=BG_COLOR)
self.entry = entry
# Center container for text
container = tk.Frame(self, bg=BG_COLOR)
@@ -199,16 +198,20 @@ The QR code contains a Scuttlebutt messageID, scanning it works best at www.cust
wraplength=900, justify='center', padx=30, pady=30)
text_label.pack()
# Deferred import
def go_to_participation():
from kiosk.screens.participation import ParticipationScreen
master.switch_frame(ParticipationScreen)
# Deferred imports
def go_forward():
if self.entry == 'about':
from kiosk.screens.home import Screen0
master.switch_frame(Screen0)
else:
from kiosk.screens.participation import ParticipationScreen
master.switch_frame(ParticipationScreen)
# Bottom: Back and Forward buttons (forward delayed)
nav_frame = tk.Frame(self, bg=BG_COLOR)
nav_frame.place(relx=0.5, rely=0.9, anchor='center')
tk.Button(nav_frame, text="← Back", command=lambda: master.switch_frame(InfoPage2),
tk.Button(nav_frame, text="← Back", command=lambda: master.switch_frame(InfoPage2, entry=self.entry),
height=2, width=15, bg='peach puff', font=GlobalVars.BUTTON_FONT).pack(side='left', padx=40)
# Countdown number indicator
@@ -216,20 +219,17 @@ The QR code contains a Scuttlebutt messageID, scanning it works best at www.cust
self.countdown_label.pack(side='left', expand=True)
self.countdown = 8
self.forward_btn = tk.Button(nav_frame, text="Forward →", command=go_forward,
height=2, width=15, bg='light gray', font=GlobalVars.BUTTON_FONT, state='disabled')
self.forward_btn.pack(side='right', padx=40)
def update_countdown():
self.countdown -= 1
if self.countdown > 0:
self.countdown_label.config(text=str(self.countdown))
self.after(1000, update_countdown)
else:
self.countdown_label.pack_forget()
self.forward_btn.config(state='normal', bg='peach puff')
self.after(1000, update_countdown)
self.forward_btn = tk.Button(nav_frame, text="Forward →", command=go_to_participation,
height=2, width=15, bg='peach puff', font=GlobalVars.BUTTON_FONT)
def show_forward():
self.countdown_label.pack_forget()
self.forward_btn.pack(side='right', padx=40)
# Show forward button after 8 second delay
self.after(8000, show_forward)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

+105 -56
View File
@@ -1,6 +1,8 @@
# Nylon Printer Setup Guide
## Zebra GX430t - Thermal Transfer - 1.5" Continuous Nylon with Cutter
> **Correction (2026-07-30):** This guide originally claimed `^MNN,Y` sets thermal transfer mode. It doesn't — `^MN` only controls *media tracking* (continuous vs. gap/mark sensing). The actual print-method command is `^MT` (`T` = thermal transfer, `D` = direct thermal), and this guide's setup script never called it. That, combined with using the *relative* `^MD` darkness command (which stacks across repeated runs instead of setting an absolute value), is what caused the printer to start printing completely blank labels after working fine for months — the print method silently reverted/was never explicitly set, and accumulated `^MD` offsets pushed effective darkness near zero. Fixed below by adding an explicit `^MT` step and switching all darkness commands to the absolute `~SD` form. The original (incorrect) version of this guide is preserved at the bottom for reference.
### Hardware Requirements
- Zebra GX430t printer with cutter module (300dpi)
- 1.5" continuous nylon ribbon roll
@@ -60,90 +62,83 @@ sudo systemctl restart cups
lpstat -p
```
### Step 3: Configure Thermal Transfer Mode
### Step 3: Configure Print Method (Thermal Transfer)
**CRITICAL:** Enable ribbon uptake, otherwise used ribbon will pool inside printer.
**This is the step that actually enables ribbon/thermal transfer printing.** Use `^MT` — `T` for thermal transfer, `D` for direct thermal:
```bash
# Set thermal transfer mode with uptake enabled
echo "^XA^MNN,Y^JUS^XZ" | lp -d nylon
echo "^XA^MTT^JUS^XZ" | lp -d nylon -o raw
```
If a label ever comes out completely blank despite good darkness and correctly-loaded ribbon, re-run this command — the print method may have reverted to direct thermal (e.g. after a factory reset).
### Step 4: Configure Media Tracking + Ribbon Uptake
```bash
# Set continuous media tracking with uptake enabled
echo "^XA^MNN,Y^JUS^XZ" | lp -d nylon -o raw
# Verify settings saved
echo "^XA^JUA^XZ" | lp -d nylon
echo "^XA^JUA^XZ" | lp -d nylon -o raw
```
The `^MNN,Y` command:
- First `N` = Thermal transfer (not direct thermal)
- Second `N` = Continuous media handling (no gap detection needed)
- First `N` = Continuous media tracking (no gap/mark sensing needed) — **not** thermal transfer, see Step 3 for that
- `Y` = Enable ribbon uptake motor
### Step 4: Set Media Width
### Step 5: Set Media Width
For 1.5" wide continuous nylon at 300dpi:
```bash
# Width: 1.5" × 300dpi = 450 dots
echo "^XA^PW450^JUS^XZ" | lp -d nylon
echo "^XA^PW450^JUS^XZ" | lp -d nylon -o raw
```
**Note:** Label length (`^LL`) will be set per-print based on content height.
### Step 5: Configure Cutter
### Step 6: Configure Cutter
Enable cutter to cut after each print:
```bash
# MMC = Cutter mode
# ^MMC,Y = Enable cutter at end of print
echo "^XA^MMC,Y^JUS^XZ" | lp -d nylon
echo "^XA^MMC,Y^JUS^XZ" | lp -d nylon -o raw
```
Alternative cutter commands if needed:
- `^MMC,N` - Disable cutter
- `^CN##` - Cut immediately, advance N dots after cut
### Step 6: Configure Darkness
### Step 7: Configure Darkness
Full resin on nylon typically needs similar darkness to labels. Start with MD18:
**Use `~SD` (absolute, 0-30) instead of `^MD` (relative, -30 to +30).** `^MD` adds/subtracts from whatever offset is already saved — running a setup script more than once silently stacks it and can walk darkness down to near-zero (this is exactly what caused the 2026-07 blank-label incident). `~SD` always sets an absolute value, so it's safe to re-run.
```bash
echo "^XA^MD18^JUS^XZ" | lp -d nylon
echo "^XA~SD20^JUS^XZ" | lp -d nylon -o raw
```
Test and adjust:
- Too light/gray? Increase to MD20 or MD22
- Resin sticking to nylon? Decrease to MD15
- Too light/faint? Increase (`~SD24`, `~SD28`, etc.)
- Resin sticking to nylon? Decrease
**Note:** Nylon may require different darkness than paper labels. Test thoroughly.
**For full resin ribbon on this printer, `~SD28` (near the max of 30) was needed to get solid, legible text — `~SD20` printed extremely faint.** Your combination of ribbon/media may need a different value; start around 20 and work up.
### Step 7: Set Continuous Media Mode
Since there are no gaps in continuous nylon:
```bash
# Web sensing off, continuous media
echo "^XA^MNN,Y^JUS^XZ" | lp -d nylon
```
No calibration needed for continuous media - the printer just cuts at the length you specify.
**Note:** Nylon may require different darkness than paper labels. Test thoroughly. See `darkness-troubleshooting.md` for more detail.
### Step 8: Test Print
Simple text test (creates ~1" tall tag):
Simple text test (creates ~0.5" tall tag, small to avoid wasting ribbon while dialing in darkness):
```bash
echo "^XA^PW450^LL300^MD18^FO50,50^ADN,36,20^FDNylon Test^FS^XZ" | lp -d nylon
echo "^XA^MTT~SD20^PW450^LL150^MNN^FO40,40^ADN,36,20^FDTest^FS^XZ" | lp -d nylon -o raw
```
This will:
- Print "Nylon Test" text
- Create a 1.5" wide x 1" tall tag (300 dots / 300dpi)
- Cut after printing
Longer test with border:
```bash
echo "^XA^PW450^LL600^MD18^FO10,10^GB430,580,5^FS^FO50,50^ADN,36,20^FDLonger Tag^FS^XZ" | lp -d nylon
echo "^XA^MTT~SD20^PW450^LL600^MNN^FO10,10^GB430,580,5^FS^FO50,50^ADN,36,20^FDLonger Tag^FS^XZ" | lp -d nylon -o raw
```
This creates a 1.5" wide x 2" tall tag with border.
@@ -159,33 +154,41 @@ lp -d nylon your_file.zpl
Example ZPL structure:
```zpl
^XA
^MTT # Print method: thermal transfer
^PW450 # Width: 1.5"
^LL450 # Length: 1.5" (creates square tag)
^MD18 # Darkness
~SD28 # Darkness (absolute)
^MNN # Continuous media tracking
^FO50,50^ADN,36,20^FDContent Here^FS
^XZ
```
### Troubleshooting
**Problem: Labels print completely blank**
- Cause 1: Print method reverted to direct thermal — re-run Step 3 (`^MTT`)
- Cause 2: Darkness offset corrupted by repeated `^MD` commands — set an absolute value with `~SD` (Step 7), starting around 20 and increasing
- Cause 3: Ribbon loaded backwards (dull/matte side should face the media, shiny/coated side should face the print head)
- See `darkness-troubleshooting.md` for the full diagnostic writeup
**Problem: Ribbon pools/doesn't wind onto uptake spool**
- Solution: Make sure you ran `^MNN,Y` (uptake enabled)
- Check DIY uptake spool is properly engaged with drive gear
- Factory reset and reconfigure if needed
**Problem: Cutter doesn't activate**
- Solution: Verify cutter is enabled: `echo "^XA^MMC,Y^JUS^XZ" | lp -d nylon`
- Solution: Verify cutter is enabled: `echo "^XA^MMC,Y^JUS^XZ" | lp -d nylon -o raw`
- Check if cutter module is physically installed
- Try immediate cut command: `echo "^XA^CN5^XZ" | lp -d nylon`
- Try immediate cut command: `echo "^XA^CN5^XZ" | lp -d nylon -o raw`
**Problem: Prints are fuzzy or gray**
- Solution: Increase darkness (`^MD20` or higher)
- Solution: Increase darkness with `~SD` (not `^MD`)
- Nylon may require different heat than paper
- Check print head cleanliness (wipe with isopropyl alcohol)
**Problem: Resin sticks to nylon when handling**
- Solution: Decrease darkness (`^MD15` or lower)
- Slow down print speed: `echo "^XA^PR3^JUS^XZ" | lp -d nylon`
- Solution: Decrease darkness (`~SD`)
- Slow down print speed: `echo "^XA^PR3^JUS^XZ" | lp -d nylon -o raw`
**Problem: Tags are wrong length**
- Solution: Check your ZPL includes correct `^LL` value
@@ -198,34 +201,38 @@ Example ZPL structure:
### Complete Configuration Script
Save this as a shell script for easy re-setup:
Save this as a shell script for easy re-setup. Every command here uses idempotent/absolute forms (`^MT`, `~SD`) so it's safe to re-run without corrupting saved state:
```bash
#!/bin/bash
PRINTER_NAME="nylon"
echo "Factory resetting printer..."
echo "^XA^JUF^XZ" | lp -d $PRINTER_NAME
echo "^XA^JUF^XZ" | lp -d $PRINTER_NAME -o raw
sleep 5
echo "Configuring thermal transfer with uptake..."
echo "^XA^MNN,Y^JUS^XZ" | lp -d $PRINTER_NAME
echo "Setting thermal transfer print method..."
echo "^XA^MTT^JUS^XZ" | lp -d $PRINTER_NAME -o raw
sleep 2
echo "Configuring continuous media tracking with uptake..."
echo "^XA^MNN,Y^JUS^XZ" | lp -d $PRINTER_NAME -o raw
sleep 2
echo "Setting media width (1.5\")..."
echo "^XA^PW450^JUS^XZ" | lp -d $PRINTER_NAME
echo "^XA^PW450^JUS^XZ" | lp -d $PRINTER_NAME -o raw
sleep 2
echo "Enabling cutter..."
echo "^XA^MMC,Y^JUS^XZ" | lp -d $PRINTER_NAME
echo "^XA^MMC,Y^JUS^XZ" | lp -d $PRINTER_NAME -o raw
sleep 2
echo "Setting darkness to 18..."
echo "^XA^MD18^JUS^XZ" | lp -d $PRINTER_NAME
echo "Setting darkness to 28 (adjust as needed)..."
echo "^XA~SD28^JUS^XZ" | lp -d $PRINTER_NAME -o raw
sleep 2
echo "Configuration complete."
echo "Test with: echo \"^XA^PW450^LL300^MD18^FO50,50^ADN,36,20^FDTest^FS^XZ\" | lp -d $PRINTER_NAME"
echo "Test with: echo \"^XA^MTT~SD28^PW450^LL150^MNN^FO40,40^ADN,36,20^FDTest^FS^XZ\" | lp -d $PRINTER_NAME -o raw"
```
### Quick Reference: Continuous Media vs Gap Media
@@ -252,15 +259,18 @@ Formula: `dots = inches × 300`
Example for 2.5" tall tag:
```bash
echo "^XA^PW450^LL750^MD18^FO50,50^ADN,36,20^FDContent^FS^XZ" | lp -d nylon
echo "^XA^MTT~SD28^PW450^LL750^MNN^FO50,50^ADN,36,20^FDContent^FS^XZ" | lp -d nylon -o raw
```
### Common ZPL Commands for Continuous Media
- `^XA` / `^XZ` - Start/end ZPL command block
- `^MT` - **Print method**: `T` = thermal transfer, `D` = direct thermal
- `^MN` - **Media tracking**: `N` = continuous, `Y` = non-continuous (gap/web sensing), `M` = non-continuous (mark sensing) — not the same as print method
- `^PW###` - Print width in dots (450 for 1.5")
- `^LL###` - Label length in dots (REQUIRED for each print)
- `^MD##` - Darkness (0-30)
- `~SD##` - Darkness, absolute (0-30) — USE THIS
- `^MD##` - Darkness, relative (-30 to +30) — AVOID, stacks across repeated commands
- `^MMC,Y` - Enable cutter
- `^CN##` - Cut now, advance ## dots
- `^FO###,###` - Field origin (X,Y position in dots)
@@ -275,11 +285,50 @@ echo "^XA^PW450^LL750^MD18^FO50,50^ADN,36,20^FDContent^FS^XZ" | lp -d nylon
```bash
# 1" tall tag
echo "^XA^PW450^LL300^MD18^FO50,50^ADN,36,20^FD1 inch^FS^XZ" | lp -d nylon
echo "^XA^MTT~SD28^PW450^LL300^MNN^FO50,50^ADN,36,20^FD1 inch^FS^XZ" | lp -d nylon -o raw
# 2" tall tag
echo "^XA^PW450^LL600^MD18^FO50,50^ADN,36,20^FD2 inches^FS^XZ" | lp -d nylon
# 2" tall tag
echo "^XA^MTT~SD28^PW450^LL600^MNN^FO50,50^ADN,36,20^FD2 inches^FS^XZ" | lp -d nylon -o raw
# 3" tall tag
echo "^XA^PW450^LL900^MD18^FO50,50^ADN,36,20^FD3 inches^FS^XZ" | lp -d nylon
echo "^XA^MTT~SD28^PW450^LL900^MNN^FO50,50^ADN,36,20^FD3 inches^FS^XZ" | lp -d nylon -o raw
```
---
## Appendix: Original guide (pre-2026-07-30 correction, kept for reference)
This is what Steps 3 and 6 (renumbered above) used to say, before we discovered `^MN` doesn't control print method and that `^MD` was stacking. Kept here in case anything above is confusing and you want to see what changed.
> ### Step 3 (old): Configure Thermal Transfer Mode
>
> **CRITICAL:** Enable ribbon uptake, otherwise used ribbon will pool inside printer.
>
> ```bash
> # Set thermal transfer mode with uptake enabled
> echo "^XA^MNN,Y^JUS^XZ" | lp -d nylon
>
> # Verify settings saved
> echo "^XA^JUA^XZ" | lp -d nylon
> ```
>
> The `^MNN,Y` command:
> - First `N` = Thermal transfer (not direct thermal) *(WRONG — this is media tracking, not print method; see corrected Step 3/4 above)*
> - Second `N` = Continuous media handling (no gap detection needed)
> - `Y` = Enable ribbon uptake motor
>
> ### Step 6 (old): Configure Darkness
>
> Full resin on nylon typically needs similar darkness to labels. Start with MD18:
>
> ```bash
> echo "^XA^MD18^JUS^XZ" | lp -d nylon
> ```
>
> Test and adjust:
> - Too light/gray? Increase to MD20 or MD22
> - Resin sticking to nylon? Decrease to MD15
>
> **Note:** Nylon may require different darkness than paper labels. Test thoroughly.
>
> *(WRONG-ish — `^MD` is a relative offset, not absolute. Running this more than once stacks the offset and silently drifts darkness, eventually producing blank labels. Use `~SD` instead, see corrected Step 7 above.)*
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+10 -2
View File
@@ -47,6 +47,9 @@ $itemDescription
name: "photo.jpg",
type: "image/jpeg",
link: $blobID
},
{
link: "#custodisco"
}
]
}' | ssb-server publish .
@@ -65,12 +68,17 @@ then
--arg messageID "$messageID" \
'{
type: "post",
text: ("This item is stewarded by " + $account),
text: ("This item is stewarded by " + $account + "\n\n a #custodisco item "),
custodisco: "true",
nft: "give",
target: $account,
root: $messageID,
branch: $messageID
branch: $messageID,
mentions: [
{
link: "#custodisco"
}
]
}' | ssb-server publish .
fi