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
sudo nano /etc/modules
# and append at the end
rtc-ds1307
sudo apt-get install i2c-tools
sudo i2cdetect -y 1
sudo nano /etc/rc.local
# and append before exit 0
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
sudo reboot
sudo hwclock -w
Ref: https://www.raspberrypi-spy.co.uk/2015/05/adding-a-ds3231-real-time-clock-to-the-raspberry-pi/
sudo apt-get install git virtualenv #Install git and virtualenv
git clone https://github.com/mgarg1/TokenPrinter.git
cd TokenPrinter
virtualenv venv -p python3
source venv/bin/activate
pip install -r requirements.txt
# give permission to the user for usb:
sudo groupadd usbusers # create new usergroup
sudo usermod -a -G usbusers pi # add user pi to the usbusers group
sudo touch /etc/udev/rules.d/99-usbusers.rules # create this rules file
SUBSYSTEM=="usb", GROUP="usbusers", MODE="0660"
SUBSYSTEMS=="usb", GROUP="usbusers", MODE="0660"
sudo init 6
# restart the piRef:https://www.odoo.com/documentation/user/9.0/point_of_sale/overview/setup.html
sudo apt-get install python3-virtualenv
sudo apt-get install libjpeg-dev zlib1g-dev
sudo apt-get install python3-rpi.gpio
pip install requirements.txt
Read Only Filesystem : https://learn.adafruit.com/read-only-raspberry-pi
/etc/rc.local
sudo bash -c 'source /home/pi/TokenPrinter/venv_token/bin/activate && python3 /home/pi/TokenPrinter/main.py' &
<!---
* 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