Compare commits

..

15 Commits
main ... main

Author SHA1 Message Date
Thatkev 8fe1268e36 Update config.example.py 2024-07-11 10:44:08 +00:00
Thatkev a0bb8ed37a Add BornHack2024 and VC-500W related text to README 2024-07-11 10:42:48 +00:00
Thatkev e54187e08d Delete README.md 2024-07-11 10:41:45 +00:00
Thatkev 278dffbac0 Update README_vc500w_support.md 2024-07-11 10:40:49 +00:00
Thatkev 7b1ff77c7c Update README_vc500w_support.md 2024-07-11 10:38:34 +00:00
Thatkev 03af881d66 Add README.md
edited to include VC-500w items
2024-07-11 10:33:05 +00:00
Thatkev ad38614ad2 Delete README.md 2024-07-11 10:24:11 +00:00
Thatkev 1fda0b35a3 Add README.md
correction of md file
2024-07-11 10:24:00 +00:00
Thatkev 697639da86 Delete README.md 2024-07-11 10:23:34 +00:00
Thatkev a3c19e1d0e Add README_vc500w_support.md 2024-07-11 10:16:42 +00:00
Thatkev 81adb9747b updated text 2024-07-11 10:16:04 +00:00
Thatkev 9810b28168 Update config.example.py
added VC-500W related comments
2024-02-07 22:46:57 +00:00
Thatkev 1ef773dd47 Update bot.py 2024-02-07 22:40:06 +00:00
Thatkev 35b49a1637 Update config.example.py 2024-02-07 22:38:02 +00:00
Thatkev 013e25d66e Update README.md 2024-02-07 22:35:09 +00:00
4 changed files with 35 additions and 9 deletions

View File

@ -11,12 +11,14 @@ Currently, you can set any command to print your sticker (by default brother_ql
* [BornHack (2023)](https://bornhack.dk/bornhack-2023)
* [Chaos Communication Camp (2023)](https://events.ccc.de/camp/2023/infos/index.html)
* [37th Chaos Communication Congress (2023)](https://events.ccc.de/congress/2023/infos/startpage.html)
* [BornHack (2024)](https://bornhack.dk/bornhack-2024) [Now in Color!]
**Running it at your con? Add it with a pull request! :D**
## Tested printers
* Brother QL-700 / QL-800 / QL-500 (brother_ql)
* Brother VC-500w [Using this repo to send files to the printer and do the neccesary conversion to the correct format](https://gitlab.com/lenchan139/labelprinter-vc500w) see README_vc500w_support.md for more info
## Recommended label rolls
@ -27,7 +29,7 @@ There are a variety of label rolls you can buy:
* DK-44605: paper, black on yellow
* DK-22606: plastic film, black on yellow
* DK-22113: plastic film, black on transparent
* CZ-1005: plasic/laminated ZINK labels
Be careful of models that don't feature glue! Make sure whatever you buy is a label and not just a roll :)
## Requirements
@ -36,7 +38,6 @@ Be careful of models that don't feature glue! Make sure whatever you buy is a la
* telethon
* PIL (Python Imaging Library) library (Pillow)
* brother_ql
You can install the requirements by running this command:
`python3 -m pip install -r requirements.txt`

26
README_vc500w_support.md Normal file
View File

@ -0,0 +1,26 @@
# Printer Bot VC-500W support
This project aims to provide functionality for using the Brother VC-500W printer. Follow the setup instructions below to get started.
## Brother VC-500W Setup Instructions
To use the Brother VC-500W with this project, follow the steps below:
1. **Navigate to the `printer_bot` Folder**:
cd /path/to/your/printer_bot
2. **Download the required files** \
`git clone https://gitlab.com/lenchan139/labelprinter-vc500w.git labelprinter-vc500w` \
`mv labelprinter-vc500w/* .` \
`rm -rf labelprinter-vc500w`
3. **Check if all files are in the folder**
4. **Edit your config file to the correct settings**
5. **profit** \
For the correct command to send to the printer and how it all works please see the gitlab repo.

2
bot.py
View File

@ -88,7 +88,7 @@ async def handler(ev):
# Resize the image
img.thumbnail([WIDTH_PX, HEIGHT_PX], resample=Image.LANCZOS, reducing_gap=None)
# Convert to grayscale and apply a gamma of 1.8
# Convert to grayscale and apply a gamma of 1.8 comment these out when using a VC-500W
img = img.convert('L')
if GAMMA_CORRECTION != 1:

View File

@ -1,4 +1,3 @@
# To get an API_ID and API_HASH, you need to sign up to be a Telegram Dev.
# Do it here: https://core.telegram.org/api/obtaining_api_id
API_ID = 11111
@ -18,7 +17,7 @@ UNLOCKED_MSG = 'Printer has been unlocked. Have fun!'
# Limits to prevent abuse
PASSWORD = '12345' # Set to None if no password required
BASE_COOLDOWN = 10 # Seconds between stickers printing
BASE_COOLDOWN = 10 # Seconds between stickers printing set to 45 if using VC-500W
MAX_ASPECT_RATIO = 1.5 # Maximum ratio between height/width of sticker
ADMIN_ID = 111111 # Find your own id with the /id command
@ -27,11 +26,11 @@ IMAGE_PATH = '/tmp/image.png'
CACHE_DIR = '/tmp/printercache'
# Remember to add your user to the "lp" group or this won't work!
PRINT_COMMAND = f"brother_ql -m QL-700 -b linux_kernel -p file:///dev/usb/lp0 print -l 62 {IMAGE_PATH} -d"
PRINT_SUCCESS_COMMAND = None # "mpv --no-video success.wav" - this was used to play audio
PRINT_COMMAND = f"brother_ql -m QL-700 -b linux_kernel -p file:///dev/usb/lp0 print -l 62 {IMAGE_PATH} -d" #Comment this out when using a VC-500W and see vc500.md
#PRINT_COMMAND = f"sh labelprinter.sh --host 192.168.5.5 --print-mode vivid --print-cut full --print-jpeg '{IMAGE_PATH}' #change IP to your printer's IP and uncomment
# Resize and process settings
WIDTH_PX = 696
HEIGHT_PX = 9999 # This means "do not care about height"
GAMMA_CORRECTION = 1.8
GAMMA_CORRECTION = 1.8 #This isn't used when using a VC-500W
BACKGROUND_COLOR = 'white'