A Python driver for the Verifone 250 serial receipt printer. Supports extended font goodies!
from Verifone250 import Verifone250
v = Verifone250(port="/dev/cu.wchusbserial110")
v.printLine("My first line!")
v.printLine("Red and big",color="red",doubleWide=True,doubleTall=True)
v.printLine("Black and small",color="black",doubleWide=False,doubleTall=False)
v.printChars("Red part of a line",color="red")
v.printLine(" and black part",color="black")
- Port location/probing
- Reading anything from the printer... there's code for it in the library, but it does not function on my printer.
- Non-English charset
- Custom character downloads
- Graphical printing (the holy grail, but a pain, the printer requires a weird 6-bit format)
- Right margin
- Text centering via
textwrap
module
Pull requests are welcomed!
You'll need to hook up your Verifone 250 to some sort of serial interface. It has a Mini-DIN8 (round) serial connector. I have mine hooked up through a Mini-DIN8 to DB9F adapter cable, a DB9M-DB9M gender changer, a DB9F to TTL serial adapter (make sure to get one that includes jumper wires if you don't have any), and finally a USB to TTL serial adapter.
Note that there are about a gazillion different internal wirings for Mini-DIN8 to DB9 cables. I just lucked on the right one by buying a few.
When you're first trying out an unproven Mini-DIN8 to DB9 cable, keep an eye out for extra heat coming from any of your equipment, LEDs suddenly dimming when you plug the last part in, computer complaining about USB power consumption... any of that stuff happens, yank out the plug and try another.
Many of the cheapest USB to TTL serial adapters require a driver on Mac OS X. CP2102, CH340, etc.
It uses ink ribbons and boring, non-thermal paper in 3" rolls. There are both black and black/red ribbons available, so be sure to avoid the black-only ribbons if you want to print in red too.
There are four DIP switches hidden under the right side of the ink ribbon. They control its serial connectivity settings. See reference guide.
There is a silly "paper level" sensor that just uses IR light reflectivity. If you leave off the paper cover, the sensor will get tricked by any ambient light.
The AC adapter is huge and funky, don't buy a printer without it. It feeds the printer 22V AC @ 1.5A (yes really)
I haven't had much luck finding TTL serial signals on the printer's board, but surely it's possible, right? Let me know if you do!!
You can pop the cover off with a big flathead screwdriver. Remove 4 Phillips head screws from underside. (there are none under the label.) There are four tabs on each corner of the printer. Use your screwdriver to gently pop the tabs. Start with the back. Sneak a peek towards the front of the printer with a flashlight to find the front tabs.
The library itself describes the individual functions in more detail.
Or check out the printer's reference guide.