Skip to main content

Print daemon for botcall/printgif - receive print jobs from the cloud

Project description

botcall-print

Local print daemon for botcall. Receives print jobs from the cloud and sends them to your USB thermal printer.

Prerequisites

Linux (Raspberry Pi, etc.)

Install USB libraries before installing botcall-print:

sudo apt install libusb-1.0-0-dev python3-libusb1
pip install pyusb

macOS

brew install libusb
pip install pyusb

Installation

pip install botcall-print

Or install from source:

cd clients/print-daemon
pip install -e .

Setup

  1. Get your botcall API key from https://botcall.io
  2. Configure the daemon:
botcall-print setup
# Enter your API key when prompted
  1. Test your printer:
botcall-print test "Hello from botcall!"
  1. Start the daemon:
botcall-print daemon

Running as a Service

macOS (launchd)

# Create launch agent
cat > ~/Library/LaunchAgents/io.botcall.print.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>io.botcall.print</string>
    <key>ProgramArguments</key>
    <array>
        <string>$(which botcall-print)</string>
        <string>daemon</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>
EOF

# Load it
launchctl load ~/Library/LaunchAgents/io.botcall.print.plist

Linux (systemd)

# Create service file
sudo cat > /etc/systemd/system/botcall-print.service << EOF
[Unit]
Description=botcall print daemon
After=network.target

[Service]
Type=simple
User=$USER
ExecStart=$(which botcall-print) daemon
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

# Enable and start
sudo systemctl enable botcall-print
sudo systemctl start botcall-print

Commands

Command Description
botcall-print setup Configure API key
botcall-print daemon Start listening for print jobs
botcall-print test "text" Test print some text
botcall-print status Show configuration and printer status

Supported Printers

Any ESC/POS compatible USB thermal printer. Common models:

  • Epson TM-T20/T88
  • Star TSP100/TSP650
  • Generic 58mm/80mm receipt printers (ZJ-58, XP-58, etc.)

Troubleshooting

"Printing with USB connection requires a usb library"

Install USB dependencies:

# Linux
sudo apt install libusb-1.0-0-dev python3-libusb1
pip install pyusb

# macOS
brew install libusb
pip install pyusb

Printer not found

Check USB connection:

# macOS
system_profiler SPUSBDataType | grep -A5 -i printer

# Linux
lsusb | grep -i printer

Permission denied (Linux)

Add udev rule:

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0416", MODE="0666"' | sudo tee /etc/udev/rules.d/99-thermal-printer.rules
sudo udevadm control --reload-rules

Slow/corrupted prints on Mac

Known macOS USB driver issue. The daemon includes chunking to work around this, but very image-heavy prints may still have issues. Consider using a Raspberry Pi for best results.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

botcall_print-0.3.2.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

botcall_print-0.3.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file botcall_print-0.3.2.tar.gz.

File metadata

  • Download URL: botcall_print-0.3.2.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for botcall_print-0.3.2.tar.gz
Algorithm Hash digest
SHA256 874b4df83f2846c0edd118b40ffbca956f5e4c1cf1e133c2e1adef2f7f42f059
MD5 3209e689f74acd2b4ba76787520b997d
BLAKE2b-256 6f6da1a34dd12caf18e4749a1da673fdfa81aeb5e8dc28fbe76a4295e1c53976

See more details on using hashes here.

File details

Details for the file botcall_print-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: botcall_print-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for botcall_print-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5cfc38cd07d7f41e5d2b1c3a86c15745a597d35ece89bde1ab60140e30c245be
MD5 2b74a8f65e9d4fef348b3ffc90aa6a85
BLAKE2b-256 7c5266d751bd7f202f0731f1a9bc4411d7cec2afa3a7202443ce925c94ab900d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page