Public
Like
paperang_printer
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ all from the browser, and deployed in miliseconds.
A web-based interface for printing to Paperang P1 thermal printers using the Web Bluetooth API.
- ๐ Bluetooth Scanner - Find nearby Paperang printers
- ๐ Easy Connection - Connect via MAC address or device search
- ๐ Text Printing - Print text with adjustable font sizes
- ๐ Timestamped Notes - Automatically add timestamp to notes
- ๐พ MAC Storage - Save printer address for quick reconnection
- ๐งช Self Test - Built-in printer diagnostics
- ๐ Debug Logs - Comprehensive logging for troubleshooting
-
Connect to Printer
- Click "Scan for Printers" to find nearby Paperang devices
- Or enter MAC address manually
- Click "Connect" to establish Bluetooth connection
- Save MAC address for future use
-
Print Text
- Enter text in the text area
- Adjust font size with slider (12-48px)
- Click "Print Text" or "Print Note w/ Timestamp"
-
System Functions
- Use "Self Test" to verify printer functionality
- "Feed Paper" advances paper for tearing
- "Test Connection" verifies Bluetooth link
- Chrome, Edge, or Opera (Web Bluetooth API support required)
- HTTPS connection (required for Bluetooth access)
- Desktop or Android (iOS doesn't support Web Bluetooth)
- Check debug logs for detailed error information
- Ensure printer is on and in pairing mode
- Keep printer within 3 feet of computer
- Don't pair printer in OS Bluetooth settings (use app only)
โโโ backend/
โ โโโ index.ts # Hono server with MAC storage API
โโโ frontend/
โ โโโ index.html # Main UI
โ โโโ protocol.js # Paperang protocol implementation
โ โโโ connection.js # Bluetooth connection management
โ โโโ printing.js # Text printing and bitmap conversion
โ โโโ utils.js # Storage and utility functions
โโโ README.md
- Uses Web Bluetooth API for printer communication
- Implements Paperang P1 protocol with CRC32 validation
- Converts text to 384px wide 1-bit bitmaps
- Stores MAC addresses server-side using Val Town blob storage
- Modular JavaScript architecture for maintainability