{"id":17576924,"url":"https://github.com/bengtmartensson/agirs","last_synced_at":"2025-10-26T09:04:10.535Z","repository":{"id":30910479,"uuid":"34468314","full_name":"bengtmartensson/AGirs","owner":"bengtmartensson","description":"A Girs infrared server for the Arduino","archived":false,"fork":false,"pushed_at":"2025-04-22T18:14:58.000Z","size":3244,"stargazers_count":56,"open_issues_count":2,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-24T03:45:23.743Z","etag":null,"topics":["arduino","girs","infrared","server"],"latest_commit_sha":null,"homepage":"http://www.harctoolbox.org/Girs.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bengtmartensson.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,"zenodo":null}},"created_at":"2015-04-23T16:33:02.000Z","updated_at":"2025-04-22T18:15:01.000Z","dependencies_parsed_at":"2025-04-22T19:25:58.946Z","dependency_job_id":"99bc9b43-94eb-4a12-a150-02204e43a63f","html_url":"https://github.com/bengtmartensson/AGirs","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FAGirs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FAGirs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FAGirs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FAGirs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bengtmartensson","download_url":"https://codeload.github.com/bengtmartensson/AGirs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250559994,"owners_count":21450168,"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":["arduino","girs","infrared","server"],"created_at":"2024-10-21T23:43:39.529Z","updated_at":"2025-10-26T09:04:10.422Z","avatar_url":"https://github.com/bengtmartensson.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AGirs (formerly ArduinoGirs)\nThis project implements a [Girs\nserver](http://www.harctoolbox.org/Girs.html) for the Arduino. That\nis, it is an interactive server that can send and receive IR signals,\nwith some bells and whistles. The interactive server is mainly meant\nfor interact with other programs. communicating over a serial line\n(likely in USB disguise), or TCP-sockets.\n\nIt is build on top of the low-level library called [Infrared4Arduino](https://github.com/bengtmartensson/Infrared4Arduino).\n\nThe main content of the project is an applications,\n_Girs_ (including the \"light\" version _GirsLite_), which constitutes the server.\nThere is also another application, _Listener_, which is a uni-directional program that just\nemits decodes on the serial interface.\n(It can for example to be used in conjunction with my Java program\n[dispatcher](https://github.com/bengtmartensson/dispatcher)).\nFinally, there is a IR-to-serial demonstration program; an IR to serial converter (_Opponator_).\nThese application are found as subdirectories of the directory `examples`.\nThe subdirectory `src` contains a fairly small amount of supporting functionality,\nforming a library in the traditional Arduino sense.\n\nThis slighty unlogical organization is due to the wish to be compatible with the current\n[Arduino library specification](https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification),\nrequired/desired for inclusion in the Arduino library manager.\n(There is presently no \"Arduino application manager\".)\n\nFor compilation with the Arduino IDE, the library\n[Infrared4Arduino](https://github.com/bengtmartensson/Infrared4Arduino)\nshould be installed with the Arduino library manager.\n\n## Configuration files\nIt is a modular program that is heavily based on CPP symbols, defined\nin the configuration file `examples/Girs/config.h`. This determines the capacities of the\ncompiled program, and adapts the configuration to the underlying\nhardware. The options are (somewhat) documented in `examples/Girs/GirsFat.config.h`.\nNot all combination are sensible or implemented. Some, but not all,\nof the non-sensible\ncombinations will be detected and will generate a compilation error.\n\nIf the preprocessor symbol `LCD` is defined in `src/GirsLib/LedLcdManager.cpp`\n(which is the default, except for the Arduino Micro), the library is configured\nwith support for the LCD display, regardless of the settings in `config.h`.\n\n## Modules and interactive commands\n\n### General\nThe program takes commands from its input stream, and write responses on its output stream.\nThe general concept is presented [here](http://www.harctoolbox.org/Girs.html).\nA command input consists of one single line, terminated with a carrage return (binary 0x0d).\nOutput is also presented as a single line, terminated with a carrage return.\nNeedless to say, these lines can be long. On a successful execution, typically \"OK\"\nis returned.\n\nThe communication can take place with another program or with a human using a\nversion of a serial terminal. The command names can, in this implementation,\nbe shortened as long as they are unique. Generally speaking, error handling\nand plausibility checking are presently basically non-existent...\n\nThe program runs in a single thread, with no multitasking whatsoever.\nAlso, even in the Ethernet version, only one concurrent session is supported.\n\n### [Base commands](http://www.harctoolbox.org/Girs.html#Base)\nThese commands are always present in a Girs server. They correspond to the `Base` module.\n#### version\n*Input*: `version`\n\n*Output*: The program name followed by the version string. Example: `AGirs 1.0.0`.\n\n#### modules\n*Input*: `modules`\n\n*Output*: Returns list of implemented modules, separated by whitespace.\nExample: `Base Transmit Capture Renderer Receive Decoder Led Lcd Parameters`.\n\nComment: A communicating peer evaluates this, in order to find out the capabilities of\nthe Girs implementation. Both IrScrutinizer and the Lirc Girs driver do this, and adjust\ntheir behavior accordingly.\n\n### [NamedRemotes](http://www.harctoolbox.org/Girs.html#NamedRemotes)\nPresently not implemented, but is [planned](https://github.com/bengtmartensson/AGirs/issues/37).\n\n### [Transmit](http://www.harctoolbox.org/Girs.html#Transmit)\nSupported if the CPP symbol `TRANSMIT` is defined in the configuration.\n#### transmit\n*Input*: `send \u003cno_sends\u003e \u003cfrequency\u003e \u003clength_intro\u003e \u003clength_repeat\u003e \u003clength_ending\u003e \u003cdurations...\u003e`\n\n*Output*: `OK`\n\nSemantics:\n* `\u003cno_sends\u003e` denotes the number of times to send the signal.\n* `\u003cfrequency\u003e` denotes the modulation frequency in Hz (not kHz as in some other programs!). The value 0\nis treated as \"no modulaton\", and sent to a non-modulating sender, if configured.\n* `\u003clength_intro\u003e` denotes how many of the numbers supplied as `\u003cdurations...\u003e`\nare to be considered as belonging to the intro sequence,\n* `\u003clength_repeat\u003e` denotes how many of the numbers supplied as `\u003cdurations...\u003e`\nare be considered as belonging to the repeat sequence (following the intro sequence durations),\n* `\u003clength_ending\u003e` (normally 0) denotes how many of the numbers supplied as `\u003cdurations...\u003e`\nare to be considered as belonging to the ending sequence, following after the repeat durations,\n* `\u003cdurations\u003e` the durations in micro seconds, making up the intro-, repeat-, and ending sequence,\naccording to the preceding parameters.\n\nThe intro sequence is always sent exactly one. If it is empty, the repeat sequence is sent `\u003cno_sends\u003e` times,\notherwise `\u003cno_sends\u003e` - 1 times. Finally, the (normally empty) ending sequence is sent once.\n\n### [Capture](http://www.harctoolbox.org/Girs.html#Capture)\nAvailable if configured with the `CAPTURE` option.\n\n*Input*: `analyze` or `capture`\n\n*Output* (Normal): `f=\u003cfrequency\u003e \u003cdurations with signs...\u003e`\n\n*Output* (Timeout): `.`\n\nSemantics:\n* `\u003cfrequency\u003e` is the measured modulation frequency.\n* `\u003cdurations with signs...\u003e` the measured durations in micro seconds; flashes with \"+\",\ngaps as \"-\".\n\n### [Receive](http://www.harctoolbox.org/Girs.html#Receive)\nAvailable if configured with the `RECEIVE` option.\n\n*Input*: `receive`\n\n*Output* (Normal): `\u003cdurations with signs...\u003e\n\n*Output* (Timeout): `.`\n\nSemantics:\n* `\u003cdurations with signs...\u003e` the measured durations in micro seconds; flashes with \"+\",\ngaps as \"-\".\n\n### Render\nAvailable if configured with the RENDER option.\n\n*Input*: `transmit \u003cno_sends\u003e \u003cprotocol\u003e \u003cprotocol_parameters\u003e`\n\n*Output* (normal): `OK`\n\n*Output* (Syntax error): `\u003cerror message\u003e`\n\nSemantics:\n* `\u003cno_sends\u003e` number of times to send signal\n* `\u003cprotocol_name\u003e` name of protocol, presently `NEC1` and `RC5`-\n* `\u003cprotocol_parameters\u003e` protocol parameters, dependent on protocol.\n\n*Example*: `transmit 1 rc5 0 12`.\nThis turns on or off most Philips TVs.\n\n### Decoder\nAvailable if configured with the `DECODER` option. No additional interactive commands,\ninstead the `receive`-d commands are attempted to be decoded, and optionally\ndisplay on an LCD display.\n\n### LED\nAvailable if configured with the `LED` option.\n\n*Input*: `led \u003clogical_led_nr\u003e on|off|blink`\n\n*Output*: `OK`.\n\nTurns on/off/blinks the LED with the given logical number.\n\n### LCD\nAvailable if configured with the `LCD` option.\n\n*Input*: `lcd \u003cmessage\u003e`\n\n*Output*: `OK`\n\nShows the message `\u003cmessage\u003e` on a connected LCD display for a certain time.\n\n### Parameters\nAvailable if configured with the `PARAMETERS` option. The allows to inspect and\nto change some parameters.\n\n*Input*: `parameter \u003cparameter_name\u003e [\u003cparameter_value\u003e]`\n\n*Output:* `\u003cparameter_name\u003e=\u003cparameter_value\u003e`\n\nSemantics: If `\u003cparameter_value\u003e` is given, the value is assigned to the\nnamed parameter, if possible. If not given, the present value is reported.\n\n#### Named of available adjustable parameters:\nThe adjustable parameters depend on the configuration options.\nA few of these are listed next.\n\n* `beginTimeout`: time in milliseconds until timeout by not detected signal\n* `captureEndingTimeout`: time in milliseconds for capture ending marking end of signal\n* `receiveEndingTimeout`: time in milliseconds for receive ending marking end of signal\n* `captureSize`: size, in number of durations, of captured (received) signals. Must be even.\n\n### Pronto\nAvailable if configured with the `PRONTO` option.\n\n*Input*: `hex \u003cno_sends\u003e \u003cpronto_hex_signal\u003e`\n\n*Output*: `OK`.\n\nSemantics:\n* `\u003cno_sends\u003e` number of times to send signal\n* `\u003cpronto_hex_signal\u003e` Pronto hex form IR signal. Always start with `0000`.\n\nSends the given signal the requested number of times.\n\n### Info\nAvailable if configured with the option `INFO`.\n\n*Input*: info\n\n*Output*: Information on current platform;\nfor example `Board: Arduino Mega2560, CPU frequency: 16000000L`\n\n### Memory\nAvailable if configured with the option `FREEMEM`.\n\n*Input*: memory\n\n*Output*: number of free bytes.\n\n### Ethernet support\nIf using an Ethernet shield with W5500 or W5200 chip, be sure that the\nEthernet library version 2.0.0 or later is used,\nsince it supports all W5*00 chips, auto-detecting during runtime.\n\nThis applies both to the Girs application as well as to the Listener.\n\n## Hardware configuration\nI have written a [fairly detailed description](http://www.harctoolbox.org/arduino_nano.html)\nof using an Arduino Nano (clone) by soldering suitable components to the PCB. This is\na small handy gadget at the size of a (large) stamp and the price of a (small) pizza,\nperfect for using with IrScrutinizer and Lirc.\n\nThe hardware configuration is determined by including a suitable\nheader file. It describes the attach sensor(s) and the pins\nthey are connected to. To allow soldering sensors directly to the\nholes in some boards, the program supports defining e.g. `SENSOR_GND`\nand `SENSOR_VCC`, which will make the program define these pins as\ndigital outputs, being fed by constant 0 and 5 volts (3.3 Volts on a 3.3 Volt board) respectively.\n\nNote that the sending pin and the capture pin\n(as opposed to the receive pin) are not configurable, but has to\nfollow the following table:\n\n\u003cpre\u003e\n                          Sender Pin      Capture Pin\nUno/Nano (ATmega328P)          3             8\nLeonardo/Micro (ATmega32U4)    9             4\nMega2560 (ATmega2560)          9            49\n\u003c/pre\u003e\n\n## Sending non-modulated signals.\nRF signals (433 MHz and other carrier frequencies) do not use the IR\ntypical modulation. Also there are a few IR protocols (like [Revox, Barco,\nArcher](http://www.hifi-remote.com/forums/viewtopic.php?t=14186\u0026start=40))\nnot using modulation. These signals can be sent by defining the symbol\n`NON_MOD`, and connecting\nsome hardware capable of sending non-modulated signals (IR- _or_ RF-)\nto the GPIO pin defined as `NON_MOD_PIN`. Then transmitted signals\nhaving frequency 0 will be directed to that device. (Later versions\nmay use different syntax and semantic.)\n\n## Testing\nThe flashed unit can be tested with a standard terminal program, like the\nserial monitor of the Arduino IDE. For this, set the baud rate to 115200, and\nthe line ending to carriage return. It is now possible to communicate\nwith the unit using the [commands of\nGirs](http://www.harctoolbox.org/Girs.html). Just type the command to\nthe program, and the unit will respond.\nExactly which commands are\navailable depends on the configuration. In all cases, the\n`version` and the `modules` commands are\navailable. If `receive` is implemented, just type\n\"`r`\" (without the\nquotes), followed by return, and fire a suitable IR signal at the\nreceiver. The raw capture will be output to the terminal program. Using\nthe clipboard, it can be pasted to IrScrutinizer, and analyzed. Of course, also\nthe other commands can be tested in this way.\n\n## API\n\n[Up-to-date API, generated by Doxygen](http://bengtmartensson.github.io/AGirs).\n\n## Dependencies\n\n* [`Infrared4Arduino`](https://github.com/bengtmartensson/Infrared4Arduino) by myself.\n  Current version is 1.0.1. Can be installed by the library manager within the Arduino IDE.\n  (Sketch -\u003e Include library -\u003e Manage libraries, name Infrared (Category: Others)).\n* `Ethernet`, preferably version 2.0.0 or later.\n* `SPI` (if enabling the `ETHERNET` or `LCD_I2C` configure option). Contained in the Arduino IDE.\n* `Wire` (if enabling the `LCD_I2C` configure option). Contained in the Arduino IDE.\nIf the preprocessor symbol `LCD` is defined in `src/GirsLib/LedLcdManager.cpp`,\nthis is needed also if not actually using an LCD display.\n* (Optional) [`Beacon`](https://github.com/bengtmartensson/ABeacon) for an AMX compatible Ethernet beacon.\n It is also available in the Arduino library manager with the name `Beacon`.\n\nIn previous versions, the library LiquidCrystal_I2C was explicitly needed to be included.\nCurrently, it has been integrated in the project (and slightly modified); see `src/GirsLib/LiquidCrystal_I2C_bm.[h|cpp]`.\n\n## Questions and answers\n\n* How do I setup Lirc to use this?\n\nUse the `girs` driver contained in the recent official upstream Lirc distribution.\nThis is described [here](http://lirc.org/html/girs.html).\nalso contained in the (recent) distro as `girs.html`.\nConfiguration options: use TRANSMIT if sending is desired, and RECEIVE if receiving is desired.\nCAPTURE is not meaningful for Lirc. Turn on PARAMETERS -- Lircd adjust the ending timeout.\nIf using DECODE and an LCD display (which is cool, but useless), be sure to\ndefine DONT_REPORT_DECODES. Use of Ethernet connections are supported.\nDue to the inner workings of Lirc, it is advantageous not define both TRANSMIT and RECEIVE\nunless you really need it.\n\n* What are Makefiles doing in an Arduino project?\n\nTo build the project for the Arduino, use the Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software),\nas in most Arduino projects.\nThe Makefile is used for maintainer work, like generating API documentation with Doxygen,\nas well as generating keywords.txt. It also generates scripts for Linux and Windows,\nthat can be used for flashing the firmware to an Arduino Nano without deploying the\nArduino IDE.\n\n* What is the difference between\n  [\"receive\"](http://www.harctoolbox.org/Glossary.html#ReceivingIrSignals)\n  and   [\"capture\"](http://www.harctoolbox.org/Glossary.html#Capturing)?\n\nPlease follow the links given. Differently put, \"receive\" uses a\ndemodulating receiver, \"capture\" a non-demodulating decoder. Note that\nthis is not universally accepted terminology (yet!).\n\n* What Ethernet modules are supported?\n\nOnly cards based on the W5100, W5200, and W5500 chip (and compatible), like the\n[official\nshield](https://www.arduino.cc/en/Main/ArduinoEthernetShield).  There are both cheap clones of the original available, as well as\nsmallish W5100-based cards.\n\nAlso the next generation of W5500 based shields, like the\nofficial [Arduino Ethernet Shield 2](https://www.arduino.cc/en/Main/ArduinoEthernetShield)\nwork. For this, use the `Ethernet` library version 2.0.0 (or later).\n\n* What about \"GirsLite\"?\n\nAs indicated by the\nname, it is a minimalist Girs server\nfor the Arduino, that implements only the\n[capture](http://www.harctoolbox.org/Girs.html#Capture) and the\n[transmit](http://www.harctoolbox.org/Girs.html#Transmit) modules,\nwithout all options. It is meant to be used with\n[IrScrutinizer](http://www.harctoolbox.org/IrScrutinizer.html)\nversions 1.1.0 or later, as well as with Lirc, using  the Lirc\n`girs` driver by yours truly. Documentation is found with the [Lirc\ndriver](http://lirc.org/html/girs), in the Lirc sources the file `girs.html`.\n\nIt is not an independent program, it is just AGirs\nwith certain options enabled, namely\nthe CPP symbols `TRANSMIT, CAPTURE, LED`, and (optionally) `NON_MOD`\ndefined. Alternatively, if `RECEIVE` is defined, but not `CAPTURE`, the\nprogram mimics the capture command with a demodulating sensor, for\nusage with IrScrutinizer without a non-demodulating sensor.\n\n* Were did the `example/GirsLite` directory go?\n\nIt has been merged with `examples/Girs`. To build GirsLite, make sure that `examples/config.h`\nis configured as you desire.\n\n* What about Girs4Lirc?\n\n_Now discontinued_, replaced by GirsLite.\nJust as GirsLite, this was just a certain configuration of AGirs,\n\"optimized\" for Lirc, supporting `TRANSMIT,\nNON_MOD` (optionally), `RECEIVE, LED, LCD, DECODE` (only to the LCD), `TRANSMITTERS`\n(only a dummy implementation).\n\n* Can I keep and maintain the library configuration in another location, for example together with\nmy own sketch?\n\nNo, the present Arduino IDE does not support this.\nI an not aware of a clean solution. Sorry.\nFiddling with the library's `config.h` for project specific configurations defeats the very idea of a library.\n\n* How is \"Girs\" pronounced?\n\nIt is pronounced like in \"girl\". The \"language\" Girs is written capitalized, the name of an implementation is usually written in lower case.\n\n## License\nThe entire work is licensed under the GPL2 \"or later\" license, just as Infrared4Arduino. Michael's code\n(that is contained in Infrared4Arduino) carries the\nGPL2-license, although he is [willing to agree to \"or later\nversions\"](http://www.hifi-remote.com/forums/viewtopic.php?p=112586#112586).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengtmartensson%2Fagirs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbengtmartensson%2Fagirs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengtmartensson%2Fagirs/lists"}