{"id":16521521,"url":"https://github.com/cyphunk/shrine","last_synced_at":"2026-06-07T03:32:53.837Z","repository":{"id":136152364,"uuid":"218392097","full_name":"cyphunk/shrine","owner":"cyphunk","description":"project for frankenrobbert.com","archived":false,"fork":false,"pushed_at":"2021-05-03T00:10:39.000Z","size":23898,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T11:50:49.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyphunk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-29T22:05:10.000Z","updated_at":"2021-05-03T00:10:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ab64dac-d9b0-4d4b-83ff-cc52ec18be5c","html_url":"https://github.com/cyphunk/shrine","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"bb038326a65530af91e72f15cfaed92fd653b76e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphunk%2Fshrine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphunk%2Fshrine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphunk%2Fshrine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphunk%2Fshrine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyphunk","download_url":"https://codeload.github.com/cyphunk/shrine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241592149,"owners_count":19987311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T16:56:43.455Z","updated_at":"2025-03-03T01:18:02.586Z","avatar_url":"https://github.com/cyphunk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![printing](.readme_images/printing.gif \"printing animation\")\n\n# Shrine\nA object for use by the artist duo http://www.frankenrobbert.com to be\nintegrated into other works\n\n## Physical components\nTested with:\n* Raspberry Pi 4 \u0026 3 with Raspbian buster version from [2021-03-04](https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2021-03-25/2021-03-04-raspios-buster-armhf.zip), previously tested with [2019-09-30](https://downloads.raspberrypi.org/raspbian/images/raspbian-2019-09-30/)\n* Also tested with local PC (for USB printers)\n* Adafruit ZJ-80 Serial thermal printers\n* Cheaper USB thermal printers (e.g. [here](https://www.ebay.de/itm/Excelvan-USB-58mm-Thermal-Dot-Receipt-Printer-Kassendrucker-schwarz-5890K-EU/123901821203?ssPageName=STRK%3AMEBIDX%3AIT\u0026_trksid=p2057872.m2749.l2649))\n\n## Setup\n\nPhysically connect printer. For Adafruit or ZJ-80 printer:\n- Printer `Black` wire = `GND` to Raspberry Pi pin `6`\n- Printer `Yellow` wire = `TX` to Raspberry Pi pin `10`\n- Printer `Green` wire = `RX` to Raspberry Pi pin `8`\n- Printer `Vcc` Power pin to Raspberry Pi `3.3v` pin `1`\n- (more detail at [pinout.xyz](https://pinout.xyz))\n\nEnable serial uart with config menu (_or enable_uart=1 in /boot/config.txt_): \n\n    raspi-config\n\nInstall the ZJ-80 drivers from [Adafruit](https://github.com/adafruit/zj-58) (_or alternative [klirichek](https://github.com/klirichek/zj-58)_):\n\n    sudo apt-get update\n    sudo apt-get install -y git cups wiringpi build-essential libcups2-dev libcupsimage2-dev\n    git clone https://github.com/adafruit/zj-58\n    cd zj-58/ \u0026\u0026 make \u0026\u0026 sudo ./install\n\nTest print on Raspberry Pi v4 with serial printer (on v3 change serial0 to ttyAMA0):\n\n    sudo /usr/sbin/lpadmin -p ZJ-58 -E -v serial:/dev/serial0?baud=19200 -P /usr/share/cups/model/zjiang/ZJ-58.ppd\n\n## Start\n\nCopy the config file and change the admin password therein:\n    \n    cp server.ini.example server.ini\n\nInstall required python libraries `web.py` `pycups` `WSGIserver` `instaloader`:\n\n    sudo apt-get install -y python3-\n    sudo python3 -m pip install -r requirements.txt\n\nRun start script:\n\n    sudo ./start.sh\n\nStarting as normal user will start server on port 8080, when starting with root the web UI starts on port 80\n\nAccess UI:\n\n* ``https://localhost:80/admin`` configure\n* ``https://localhost:80/upload`` manually upoad image to print, if enabled\n* ``https://localhost:80/`` see downloaded images\n\n![adminui](.readme_images/admin_ui.png \"Admin UI\")\n\nTo start individual elements instead of using ``start.sh``:\n\n* ``start_printer.sh`` will setup the printer. Setup persists so not required if already setup and configration has not changed. You can just test with: ``echo test | lp -d PRINTER``\n* ``start_wifi.sh`` will setup wifi network. Setup persists. Check with ``./status.sh``\n* ``sudo python3 server.py``\n\n\n## Additional setup tips\n\n* ZJ-80 driver options: [Adafruit](https://github.com/adafruit/zj-58) or alternative [klirichek](https://github.com/klirichek/zj-58)\n\n* Test ZJ-80 driver on Linux PC with USB printer:\n    \n    sudo systemctl start cups\n    sudo /usr/sbin/lpadmin -p ZJ-58 -E -v $URI -P /usr/share/cups/model/zjiang/ZJ-58.ppd\n\n* ``start_printer.sh`` for other printer testing and various lp management commands\n\n\n![printed_bunch](.readme_images/printed_bunch.jpg \"printed bunch\")\n\n\n## Trouble shooting\n\n* [Information about Instagram rate limiting](https://developers.facebook.com/docs/instagram-api/overview/#rate-limiting) -- see also headers server returns on requests. Not sure what the restrictions are for un-registered apps -- 200 requests per hour?\n* pip install error `fatal error: cups/cups.h: No such file or directory` required installing `sudo apt-get install libcups2-dev`\n\n## Direct interaction\n\ncan try various commands found with:\n    \n    stty -F /dev/serial0 19200\n    # print test page works\n    echo -en '\\x12T' \u003e /dev/serial0\n    # Change font settings failed:\n    echo -en '\\x1D!\\x00' \u003e /dev/serial0 # small\n    echo -en '\\x1D!\\x11' \u003e /dev/serial0 # large\n    echo -en '\\x1B-\\x01' \u003e /dev/serial0 # small underline\n    echo -en '\\x1B@' \u003e /dev/serial0 # reset\n    echo \"test\" | lp -d PRINTER\n    # above fails, below works:\n    echo -e \"test\\n\\n\" \u003e /dev/serial0\n    # may have require first sending? '\\x1b\\x37\\x07\\xff\\x02' which changes heat?\n    # Alternatively this also works:\n    echo -e \"test\\n\\n\\n\\n\" \u003e /tmp/print \u0026\u0026 lp -d PRINTER -o raw /tmp/print\n    \n[More examples](https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer/blob/master/adafruit_thermal_printer/thermal_printer.py)\n\n\n### loss of internet\n\nAdded try/except and hope this will no longer crash the instagram thread:\n\n```\nconnection: [Errno -3] Temporary failure in name resolution')) [retrying; skip with ^C]\nJSON Query to explore/tags/goawaysorrowoftheworld/: HTTPSConnectionPool(host='www.instagram.com',port=443): Max retries exceeded with url: /explore/tags/goawaysorrowoftheworld/?__a=1 (Caused byNewConnectionError('\u003curllib3.connection.VerifiedHTTPSConnection object at 0xb38f62b0\u003e: Failed toestablish a new connection: [Errno -3] Temporary failure in name resolution')) [retrying; skip with ^C]\n192.168.0.132:50074 - - [29/Oct/2019 06:07:23] \"HTTP/1.1 POST /admin\" - 303 See Other\n192.168.0.132:50074 - - [29/Oct/2019 06:07:23] \"HTTP/1.1 GET /admin\" - 200 OK\n192.168.0.132:50074 - - [29/Oct/2019 06:07:29] \"HTTP/1.1 GET /admin\" - 200 OK\nJSON Query to explore/tags/goawaysorrowoftheworld/: HTTP error code 500. [retrying; skip with ^C]\nException in thread Thread-1:\nTraceback (most recent call last):\nFile \"/usr/lib/python3.7/threading.py\", line 917, in _bootstrap_inner\nself.run()\nFile \"/home/pi/shrine_code/web/instagram.py\", line 88, in run\nself.get_latest_post()\nFile \"/home/pi/shrine_code/web/instagram.py\", line 48, in get_latest_post\nfor post in self._posts:\nFile \"/usr/local/lib/python3.7/dist-packages/instaloader-4.2.9-py3.7.egg/instaloader/instaloader.py\", line 833, in get_hashtag_posts\nparams)['graphql']['hashtag']['edge_hashtag_to_media']\nFile \"/usr/local/lib/python3.7/dist-packages/instaloader-4.2.9-py3.7.egg/instaloader/instaloadercontext.py\", line 372, in get_json\nraise QueryReturnedNotFoundException(\"404 Not Found\")\ninstaloader.exceptions.QueryReturnedNotFoundException: 404 Not Found\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyphunk%2Fshrine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyphunk%2Fshrine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyphunk%2Fshrine/lists"}