Skip to content

Display daily gross sales from a Square store on an E-ink display

License

Notifications You must be signed in to change notification settings

maddocker/SalesDashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SalesDashboard

Tired of logging into Square and refreshing every so often to get your updated daily sales? So was I, so it became my excuse to use my e-ink display for something different than a standard weather station.

Reference Example: Front Reference Example: Back

Execution

  1. Create a new application in your Square store. You will need a production access token to retrieve your transaction data.
  2. Connect your Raspberry Pi to your Waveshare 4.2 v2 400x300 e-ink display (will work with their other sizes but will need adjustment in the code for resolution differences).
  3. Clone this repository in your home directory on your Raspberry Pi: git clone https://github.com/maddocker/SalesDashboard.git
  4. Export your access token to a new environment variable titled SQUARE_ACCESS_TOKEN.
  5. Enter new directory: cd SalesDashboard/
  6. Create a virtual environment for this package: python -m venv .venv
  7. Activate the virtual environment: source .venv/bin/activate
  8. Install this package into the virtual environment: pip install --upgrade -e .
  9. Run (when virtual environment activated) with: home-dashboard
  10. Add cron job; example below. A standard installation of Raspberry Pi OS ships with a cron application that can export environment variables directly.

Automation

Example cron job (crontab -e):

SQUARE_ACCESS_TOKEN={{token here}}
# m h  dom mon dow   command
*/10 * * * * /home/maddocker/SalesDashboard/.venv/bin/python /home/maddocker/SalesDashboard/src/home_dashboard/home_dashboard.py

Other Notes

  • The code expects you to be in the Central timezone. Changing this should be fairly minimal if you are elsewhere.
  • The rpi-lgpio library was a last-minute addition because I ended up using my new Raspberry Pi 5 for this instead of the Zero 2W--take it from me and keep those pin headers around even if you don't have a use for them at the moment. This package is a requirement because the 5 apparently uses different hardware for the GPIO. I am not currently sure if this package being installed will conflict with other RP models, but you may have to remove that line if so. I plan on testing this once I have another Pi to test.
  • The display stand printed fine for me with tree supports and 40% infill. The Pi and the display took a small amount of force to clear the guides, but are now in place enough that I didn't feel the need to have any other retention method. Your printer's tolerance may differ.

About

Display daily gross sales from a Square store on an E-ink display

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages