- Configure Lirc with lowest (loglevel = ERROR) : e.g. log only errors, this will reduce the numbers of messages in the logs/Systemd/Syslog, and improve performace
- Edit /etc/lirc/lirc_options.conf
- Add loglevel = ERROR
- Configure the lircd systemd service (if you are using systemd), to restart automatically on failure, as otherwise lircd will exit and it will not restart again
- [Service]
- Restart=on-failure
- RestartSec=1s
// ============================================================================ | |
// Libraries, Definitions and Macros | |
// ============================================================================ | |
#ifdef DEBUG | |
#include "stdio.h" | |
__xdata uint8_t buffer[20]; | |
#define DBG(fmt, ...) sprintf(buffer, "%s: " fmt "\r\n", __func__, ##__VA_ARGS__); OLED_print(buffer); | |
#else | |
#define DBG(fmt, ...); | |
#endif |
#include <stdint.h> | |
#include <stdio.h> | |
#define MAX_PACKET_SIZE 64 | |
// The main buffer we want to split alias | |
uint8_t EP2_buffer[128]; | |
//Creating aliases for the main buffer split into two, each 64 bytes | |
uint8_t * cdc_In_Buffer = (uint8_t *) EP2_buffer; | |
uint8_t * cdc_Out_Buffer = (uint8_t *) EP2_buffer+MAX_PACKET_SIZE; | |
int main(void){ |
#include <stdlib.h> | |
#include <stdio.h> | |
#include "list.h" | |
typedef struct episode { | |
int epid; | |
struct list_head list; | |
} episode_t; |
--- ./lirc/plugins/irtoy.c 2022-01-17 13:15:07.827454566 +0200 | |
+++ ./lirc/plugins/irtoy.c 2022-01-17 13:21:01.854548820 +0200 | |
@@ -50,7 +50,14 @@ | |
{0, 0} | |
}; | |
-const unsigned char IRTOY_COMMAND_TXSTART[] = { 0x24, 0x25, 0x26, 0x03 }; | |
+const unsigned char IRTOY_COMMAND_TXSTART[] = { 0x03 }; | |
+// It is important to send the three commands below only on initialization as if sent in the IRTOY_COMMAND_TXSTART it may render the device in a de-enumerated state | |
+// For more information see gist https://gist.github.com/Irdroid/384d5144d24cba7c94e58dde75388968 |
The built in driver for Irtoy / Irdroid in LIRC has a bug that makes the modules to lock from time to time, which require to replug the Irdroy/Irdroid and restart LIRC
This issue seems to be present in LIRC since long time (probably 10 years) and no one came up to a solution until now!
In the last two weeks we were researching the above issue which seems to exist since a long time (many posts on the Internet with that issue with no resolution). This issue was never reported from users on MS Windows / WinLIRC and we have performed a code review of WinLirc (https://github.com/leg0/WinLIRC/blob/master/DLL/Irdroid/SendReceiveData.cpp) and in particular the driver / plugin responsible for communicating with Irtoy / Irdroid.
- Device initialization e.g, entering samling mode with "s" is sent once
The Irdroid IrDA series of modules and development boards provide IrDA data communication for modern Linux based systems, thanks to the compatibility with the irda-tools for Linux and the availability of the relevant kernel modules / drivers for the chipset (mcp2120) used in the Irdroid IrDA product range. The irda-utils for GNU Linux are available for most of the GNU Linux distributions, thus simplifying the installation and configuration process.
The Irdroid USB IrDA transceiver is based on Microchip MCP2120 IrDA communication IC and the CH341 USB to UART serial converter module. The unit enumerates on the host system as a USB Serial port, usually enumarated as /dev/ttyUSB0.
Zijiang based thermal receipt printer usb backend for Linux Cups (via libusb) does not properly initializes the Zijiang based thermal receipt printers and the printers are either not working properly e.g. print just once, print garbage characters when printing graphics or just moves the paper feed and stalls without printing and a power cycle is needed to start a new print.