{"id":16525683,"url":"https://github.com/tinue/hp82240","last_synced_at":"2025-08-03T14:38:46.333Z","repository":{"id":206694997,"uuid":"701254911","full_name":"tinue/hp82240","owner":"tinue","description":"An emulator for the HP printers 82240A and 82240B","archived":false,"fork":false,"pushed_at":"2024-11-22T15:41:46.000Z","size":5649,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T01:24:52.159Z","etag":null,"topics":["82240","82240a","82240b","hewlett-packard","hp-50","hp-printer"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-10-06T08:57:38.000Z","updated_at":"2025-01-06T08:50:11.000Z","dependencies_parsed_at":"2024-05-02T19:01:52.091Z","dependency_job_id":null,"html_url":"https://github.com/tinue/hp82240","commit_stats":null,"previous_names":["tinue/hp82240"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinue%2Fhp82240","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinue%2Fhp82240/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinue%2Fhp82240/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinue%2Fhp82240/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinue","download_url":"https://codeload.github.com/tinue/hp82240/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248130408,"owners_count":21052741,"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":["82240","82240a","82240b","hewlett-packard","hp-50","hp-printer"],"created_at":"2024-10-11T17:04:43.724Z","updated_at":"2025-04-09T23:34:57.409Z","avatar_url":"https://github.com/tinue.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hp82240\n\n # General\n\nThe Java based HP 82240 is a command line printer simulator for the Hewlett Packard HP-82240A/B \ninfrared printer. It will decode printer commands received via a serial port, and produce\na text and a bitmap file.\n\nThe printer commands are text strings, escape sequences and line feeds, encoded in a character\nset as defined by HP. See [Printer Character Sets](documentation/charactersets/charactersets.md)\nfor details.\n\nNote that the simulator does not understand the raw infrared pulses generated by the\nHP calculators. It needs special hardware (see below) that interprets these pulses and\nconverts them into bytes.\n\nThe output of the simulator consists of two files:\n* `Hp8224-Text.txt`: Any text that was sent to the printer, converted from the HP character set into UTF-8. \n* `Hp8224-Image.png`: Text and graphics as they would look on the printer paper.\n\nTo illustrate, see the actual printer on the left, and the generated bitmap file on the right:\n\n| Printer                                                                             | Simulated Output                                                                                       |\n|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|\n| \u003cimg src=\"documentation/pictures/HP82240A.jpg\" width=\"320\" alt=\"HP 82240A printer\"\u003e | \u003cimg src=\"documentation/pictures/HPSelfTestFromSimulator.png\" width=\"320\" align=\"top\" alt=\"Self Test\"\u003e |\n\nMore examples are available [here](documentation/examples.md) and\n[here](documentation/validation/validation.md).\n\n# Acknowledgements\n* Thanks to \u003ca href=\"http://hp.giesselink.com/\"\u003eChristoph Gießelink\u003c/a\u003e: He develops\na Windows based simulator of the HP printers 82240A/B and 82143A. The bitmaps for the\nprinter characters directly come from this simulator (See\n\u003ca href=\"https://www.hpcalc.org/details/7386\"\u003ehpcalc.org\u003c/a\u003e\nfor the full source code)\n* Thanks to [Martin Hepperle](https://www.mh-aerotools.de): He developed the first\n\"Red Eye\" reader, see \"Hardware\" section below.\n* Thanks to [Meindert Kuipers](https://www.hpmuseum.org/forum/user-215.html): His version\nof the \"Red Eye\" receiver is the one that I am using.\n* Thanks to Christian Vogel; His [avr-redeye](https://github.com/vogelchr/avr-redeye) project allowed me to send any print commands\nthat I like to my real HP 82240A printer and observe its behaviour.\n\n# Installation\nCopy the `hp82240.jar` file to a convenient location. Make sure to have a Java 17 or higher\nruntime available on your system. Then, start the simulator with:  \n`java -jar hp82240.jar [-p=comport]`  \nThis will start the simulator and open the com port for reading. Any existing output files\n(`Hp8224-Text.txt` and `Hp8224-Image.png`) will be overwritten on application startup.  \nWhen you are done with your session stop the simulator with `Ctrl-C`. Save away the output\nfiles for later use.  \nIf you omit the com port, the simulator will attempt to auto-detect the correct port.\n\n## Quick testing\nFor some quick testing, the simulator can work with input files. To produce a self test,\none can use this: `java -jar hp82240.jar -i selftest.yaml`. The files are the same ones as used\nin the Red Eye sender (see below). The file format is not explicitly documented, but should\nbe self explanatory when looking at the provided samples.\n\n## Receiver Hardware\nTo receive the infrared pulses from an actual calculator, and convert this data to a serial stream,\nspecial hardware is required. I built a receiver based on\n[this](https://www.hpmuseum.org/forum/thread-14858.html) guideline, which in turn is a\nmodified version of\n[this](https://www.mh-aerotools.de/hp/red-eye/HP-IR%20Receiver%20with%20Arduino.pdf)\nguideline.\n\n# Comparison with other simulators\nThis simulator is currently limited in functionality, supporting only the HP 82240A/B printer,\nand lacking a graphical user interface. Its main advantage is that it runs on all platforms\nsupporting a Java 17 or higher runtime, including ARM devices such as the Raspberry Pi. \n\n# Validation on a real HP82240A printer\nTo [validate](documentation/validation/validation.md) and compare any output generated by\nthis simulator with the output from a real\nHP 82240A printer, one needs to be able to send very specific strings / graphic codes to\nthe printer. The real calculators are only of limited use here, because their firmware\nprevents certain issues to happen. For example, lines that are too long (longer than the\nprinters buffer) get Line Feeds added by the firmware.\n\nTherefore, a tool has been developed that allows to send any sequence of bytes that one wants\nto a serial port. On this serial port a piece of hardware is required that generates the\n\"Red Eye\" pulses that the printer understands.\n\n## Sender Hardware\n\nI am using this project with an Arduino clone and a simple IR diode:\n[avr-redeye](https://github.com/vogelchr/avr-redeye). The project is a few years old, but it works perfectly right out of\nthe box. Note that you can't use the Arduino IDE to compile / send, because this is pure\nC code and not an Arduino sketch. On the Mac I installed two tools:\n* `brew install avrdude`\n* `brew install avr-gcc`\n\nI had to slightly adapt the `PROGRAMMER_DUDE` part of the `Makefile`\nto  \n`PROGRAMMER_DUDE = -P/dev/cu.usbmodem4101 -carduino -b57600`, and then it worked right away.\n\nFor the first test I used a genuine Arduino Uno, and found that this device sends spurious\nbytes (`0xF0`) when the serial port gets closed (which happens automatically at the end of\nthe application). So if you see strange characters on your printer, try with a different\ntype of Arduino. Here is the device that I am using now:\n\n\u003cimg src=\"documentation/pictures/Sender.jpg\" alt=\"IR Sender\"\u003e\n\n## Sending print commands\n\nThe tool is invoked as follows:\n`java -cp hp82240.jar ch.erzberger.emulation.sender.RedEyeSender`. It will then tell you\nthe necessary parameters. Some sample files are provided in the\n`documentation/sampleoutput` directory.\n\n\n# Stdin, Stdout\nThe simulator can read from Stdin instead of from a serial port. Use this if you have e.g.\nan emulator of a calculator that sends print output to Stdout. To test, use the RedEyeSender, \nsending to StdOut:   \n`java -cp hp82240.jar ch.erzberger.emulation.sender.RedEyeSender -p=stdout -i=selftest.yaml | java -jar hp82240.jar -p stdin`\n\n# License\nHP82240 - A Java based HP 82240A/B Printer Simulator\nCopyright (C) 2023 Martin Erzberger.\n\nThis program is free software; you can redistribute it and/or modify it under the terms\nof the GNU General Public License Version 2 or any later version, as published by the Free\nSoftware Foundation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinue%2Fhp82240","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinue%2Fhp82240","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinue%2Fhp82240/lists"}