mgarg1 / TokenPrinter

0 stars 0 forks source link

TokenPrinter

build status

Getting the sd card ready

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=IN

network={
 ssid="<Name of your WiFi>"
 psk="<Password for your WiFi>"
}

Ref: https://www.raspberrypi.org/documentation/configuration/wireless/headless.md

Connecting to raspi

Setup Real Time Clock - DS3231

Ref: https://www.raspberrypi-spy.co.uk/2015/05/adding-a-ds3231-real-time-clock-to-the-raspberry-pi/

Code Setup

Ref:https://www.odoo.com/documentation/user/9.0/point_of_sale/overview/setup.html

  1. Connect the printer to another USB port of rPi zero i. $ lsusb Bus 001 Device 002: ID 0456:0808 Analog Devices, Inc. ii.
  2. python3 main.py

sudo apt-get install python3-rpi.gpio

Install virtualenv

sudo apt-get install python3-virtualenv

Installation on Raspi

sudo apt-get install libjpeg-dev zlib1g-dev
sudo apt-get install python3-rpi.gpio

pip install requirements.txt

Read Only Raspi

Read Only Filesystem : https://learn.adafruit.com/read-only-raspberry-pi

Scheduling restart


<!---
* In `crontab -e` type:
@reboot source /home/pi/TokenPrinter/venv_token/bin/activate && python3 /home/pi/TokenPrinter/main.py
-->
## Circuit Diagram
![Circuit Diagram](static/Circuit_Diagram.png)

## Deployment Photos
![Deployment Photos](static/Deployment_Photos.jpg)

## References
* Stable version(2.20) which I am using - https://github.com/python-escpos/python-escpos/tree/cbe38648f50dd42e25563bd8603953eaa13cb7f6
* Docs for this version - https://python-escpos.readthedocs.io/en/v2.2.0/
* GPIO Docs - https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/
* https://www.programiz.com/python-programming/datetime/strftime
* https://github.com/PyramidTechnologies/Phoenix-ESC-POS
* Backup using Win32 Disk Imager https://www.howtogeek.com/341944/how-to-clone-your-raspberry-pi-sd-card-for-foolproof-backup/

### Espson references
* https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=118#dle_eot
* https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=124#gs_lr
* https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=205
* https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=185#dle_enq