POS Printer for printing Receipt of POS.
Printer base on ESCPOS, and write by python.
Scaner base on Python-evdev.
Install python-escpos
$ git clone https://github.com/guanbo/pos_printer
$ cd pos_printer
$ sudo ./pos-printer.py &
$ curl -X POST -d "Hello Printer" http://youIPAddress:8000
$ sudo cp extensivepromini.service /etc/avahi/services/
$ sudo /etc/init.d/avahi-daemon restart
$ sudo apt-get install python-dev
# sudo apt-get install linux-headers-$(uname -r)
$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python
$ git clone https://github.com/gvalkov/python-evdev.git
$ cd python-evdev
$ sudo python setup.py install
- How to access server by hostname
.local
$ sudo apt-get update
$ sudo apt-get install avahi-daemon
$ sudo vi /etc/hostname
# change your hostname and save
- Can't apt-get install
pyserial
$ sudo apt-get install python-serial
update firmware and reboot
call update script on schedule
export VISUAL=vi
crontab -e
enter following code into cron file
@daily /home/pi/deploy/pos-printer/update-auto.sh 2>&1 >> /home/pi/deploy/pos-update.log
@yearly rm /home/pi/deploy/pos-update.log
$ cd path/to/pos-printer
$ sh update.sh
$ curl -v -X POST http://exprominisrv.local:8000/update
dump all img to disk for backup
$ diskutil umount /dev/disk1s1
$ sudo dd if=/dev/rdisk1 of=/tmp/rpi20140301.img bs=1m
$ diskutil umount /dev/disk1s1
$ diskutil umount /dev/disk1s1
$ sudo dd of=/dev/rdisk1 if=/tmp/rpi20140301.img bs=1m
$ diskutil umount /dev/disk1s1