A Python script for Linux that handles wireless printing through Gmail.
The script receives files from Gmail. The incoming emails will be filtered by the subject, this will be the password to access your printer. Be aware of this password, and be careful on the API credentials (Client ID and Client Key), as it can control your Gmail account.
To run the script, you need all of the following,
- Any Raspberry Pi board (with WiFi card or WiFi adapter)
- A USB-attached printer
- An internet connection on the Raspberry Pi board
- Install CUPS, a printing protocol for Linux.
- Setup your printer using CUPS, see instructions.
- Setup a Google API Application using the Google Developer Console and follow the instructions.
- Download the
credentials.jsonfile and place it in the same directory asscript.py. - Define all the optional variables (PASSWORD, SCOPE, etc.) in
script.py(see commented codes in the script). - Set the
script.pyto run on startup, see instructions.
Script ini menerima file melalui Gmail. Email yang masuk akan disaring berdasarkan subjek. Subjek ini akan berperan sebagai password, yang membuat email diteruskan ke printer. Berhati-hatilah akan password printer yang anda tentukan (di script.py), dan berhati-hatilah dalam menggunakan izin dari Gmail API, karena API ini dapat membuat script yang anda jalankan mengakses akun Gmail anda.
Untuk menjalankan script, anda memerlukan :
- Board Raspberry Pi apapun (dengan WiFi card atau WiFi adapter)
- Printer yang disambungkan melalui kabel USB
- Koneksi internet pada Raspberry Pi
- Install CUPS, sebuah protokol printing pada Linux
- Atur printer ada menggunakan CUPS, lihat instruksi pengaturan.
- Atur API Application using the Google Developer Console Google dan ikuti instruksi pada web tersebut.
- Unduh file
credentials.jsondan letakan file di folder yang sama dengan filescript.py. - Tentukan variabel opsional (PASSWORD, SCOPE, dll) pada
script.py(lihat kode yang terkomen). - Atur
script.pyuntuk dijalankan saat startup, lihat instruksi pengaturan.
If there is any question please contact me on GitHub, or email me at ariqathallah38@gmail.com. If you find this useful, please leave a star. Thank you.