debug
This commit is contained in:
parent
b3ebce60f4
commit
d991a07583
2 changed files with 13 additions and 3 deletions
15
app/main.py
15
app/main.py
|
|
@ -238,9 +238,18 @@ def print_task(request: Request, task_id: str):
|
|||
|
||||
# Print to physical printer if enabled
|
||||
if ENABLE_PHYSICAL_PRINTER:
|
||||
printer = escpos.printer.Serial(devfile="/dev/serial0", baudrate=19200, timeout=1)
|
||||
printer.text(f"Task: {task.content}\nVon: {task.user}\nPriorität: {task.priority}\n")
|
||||
printer.cut()
|
||||
print(f"[DEBUG] Attempting to print to /dev/serial0...")
|
||||
try:
|
||||
printer = escpos.printer.Serial(devfile="/dev/serial0", baudrate=19200, timeout=1)
|
||||
printer.text(f"Task: {task.content}\nVon: {task.user}\nPriorität: {task.priority}\n")
|
||||
printer.cut()
|
||||
print(f"[DEBUG] Print command sent successfully")
|
||||
except Exception as print_err:
|
||||
print(f"[ERROR] Printer failed: {print_err}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
else:
|
||||
print(f"[DEBUG] Physical printer disabled, skipping print")
|
||||
|
||||
task.status = "printed"
|
||||
msg = "success"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue