{"id":22026391,"url":"https://github.com/florianporada/printerprinter","last_synced_at":"2026-04-17T07:31:03.951Z","repository":{"id":41761581,"uuid":"219359224","full_name":"florianporada/printerprinter","owner":"florianporada","description":"Client and Server component for a raspberrypi connected thermal printer","archived":false,"fork":false,"pushed_at":"2023-01-05T00:04:09.000Z","size":1785,"stargazers_count":2,"open_issues_count":28,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T11:15:25.610Z","etag":null,"topics":["client-server","iot","node-js","printer","python","raspberrypi","socket-io","thermal-printer","thermal-printing","thermalprinter"],"latest_commit_sha":null,"homepage":"","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/florianporada.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}},"created_at":"2019-11-03T20:12:24.000Z","updated_at":"2024-11-17T13:00:53.000Z","dependencies_parsed_at":"2023-02-03T01:00:38.246Z","dependency_job_id":null,"html_url":"https://github.com/florianporada/printerprinter","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/florianporada/printerprinter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florianporada%2Fprinterprinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florianporada%2Fprinterprinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florianporada%2Fprinterprinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florianporada%2Fprinterprinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/florianporada","download_url":"https://codeload.github.com/florianporada/printerprinter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florianporada%2Fprinterprinter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31919837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["client-server","iot","node-js","printer","python","raspberrypi","socket-io","thermal-printer","thermal-printing","thermalprinter"],"created_at":"2024-11-30T07:27:19.809Z","updated_at":"2026-04-17T07:31:03.924Z","avatar_url":"https://github.com/florianporada.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🖨 PrinterPrinter\n\n![printerprinter](https://repository-images.githubusercontent.com/219359224/39577000-9c80-11ea-94f6-5e725a4249c4 \"printerprinter\")\n\n## 📄 Description\n\nPrinterPrinter is a standalone/companion project for connecting a raspberrypi zero attached thermal printer via socket.io to an exisiting nodejs environment\n\n## 🛠 Installation\n\n### Client\n\n#### Build\n\n- Instructions for building the physical client coming soon ...\n\n#### Install\n\n- Follow the instruction in the link below to set up your raspberry pi\\\n  **[Install RaspberryPi](https://styxit.com/2017/03/14/headless-raspberry-setup.html)**\n\n- Add a empty file named`ssh` to the `/boot` directory of the SD Card\n- Add a `wpa_supplicant.conf` to the `/boot` directory of the SD Card with the following content:\n\n```config\ncountry=DE\nctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev\nupdate_config=1\n\nnetwork={\n    ssid=\"\u003cYOUR_WIFI_SSID\u003e\"\n    scan_ssid=1\n    psk=\"\u003cYOUR_WIFI_PASSWORD\u003e\"\n    key_mgmt=WPA-PSK\n}\n```\n\n- Run this command to install and configure the client\n\n```sh\nwget -O - https://raw.githubusercontent.com/florianporada/printerprinter/master/scripts/install_client.sh | bash\n```\n\n- (Optional) Add `$GITHUB_ACCESS_TOKEN=\u003cgist-enabled-access-token\u003e scripts/post_ip_gist.sh` to run during boot to get the ip of the printer (headless)\n\n#### Usage\n\n##### Automatic\n\nIf you use the install script above, the client will install all necessary packages and configure the service to run on startup.\nYou can go to `http://\u003cip-of-client\u003e:8080/` to configure printerprinter client.\n\n##### Manual\n\nYou can either use a `.env` file to configure the printer or use a lowdb file for get/set the configuration.\nSet PRINTER_CONFIG_MODE to **db** or **env** to switch between the two modes.\n\n```sh\nPRINTER_CONFIG_MODE='\u003cdb|env\u003e' # mode for handling the config\nPRINTER_SOCKET_URL='http://socketurl:3030/' # URL to the service\nPRINTER_WEBSERVER_PORT=8080 # Port for the web ui\nPRINTER_NAME='Printy McPrintface'\nPRINTER_UID=0 # Identifier for the service when sending a job\nPRINTER_BAUDRATE=9600 # Baudrate of the printer\nPRINTER_SERIALPORT='/dev/ttyS0' # Port where printer is connected\nPRINTER_LED=12 # Pin of the info LED\n```\n\n- Install `printerprinter` via npm\n\n```sh\nnpm i printerprinter\n```\n\n- Initialize the client component in your codebase.\n\n```javascript\nimport { PrinterClient } from \"printerprinter\";\n\nconst printer = new PrinterClient({\n  url: \"http://socketurl:3030\", // points to the socketserver explained below\n  name: \"Printy McPrintface\",\n  uid: 0,\n  baudrate: 9600,\n  serialport: \"/dev/ttyS0\",\n  ledpin: 12,\n});\n\nprinter.init();\n```\n\n### Server\n\n#### Install\n\n- Install `printerprinter` via npm\n\n```sh\nnpm i printerprinter\n```\n\n- If the `prepare` script is not executed try:\n\n```sh\ncd node_modules/printerprinter\nnpm install \u0026\u0026 npm run build\n```\n\n#### Usage\n\nInitialize the service\n\n```javascript\nimport { PrinterService } from \"printerprinter\";\n\nconst printerService = new PrinterService({\n  port: 3030, // defines the port for the socket service\n});\n\nprinterService.init();\n```\n\nTo send something to the printer:\n\n```javascript\nprinterService\n  .print({\n    message: {\n      text: \"foo\",\n      image: \"\u003cbase64 encoded image\u003e\",\n      sender: \"bar\",\n    },\n    printerUid: 0,\n  })\n  .then((res) =\u003e console.log(res))\n  .catch((err) =\u003e console.log(err));\n```\n\n## 🐜 Troubleshooting / Additional Notes\n\n- ...\n\n## 📑 ToDos\n\n- Job query on client side\n- API on server side\n\n## 👋 Credits\n\n- [Adafruit - Python Thermal Printer](https://github.com/adafruit/Python-Thermal-Printer)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianporada%2Fprinterprinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorianporada%2Fprinterprinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianporada%2Fprinterprinter/lists"}