Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - MisterE

1
USB Infrared Toy / Re: Fixed overflow bug in Sample mode in Firmware 2.4
Hi,
I seem to have a similar problem with my raspberry pi.
Want to try to test this new firmware.

I once managed to update the firmware but it failes now. Can use some help.

Steps i did:
* downloaded "USBIRToy.package.v22.zip" and unpacked it
* downloaded this alternative firmware "USBIRToyv24.hex" en copied it to the "firmware" folder
* created "bat" file "update-USBIRToy.v24.bat", modified it to use "USBIRToyv24.hex"

* wired PGC and PGD
* plugged it in, orange light is burning
* In the device manager, under "human interface devices" i get a "usb input device" with a exclamation mark (This device cannot start. (Code 10))

* start "cmd" with admin rights
* Enter Com Port => pressing enter

Results below:

C:TEMPbin>update-USBIRToy.v24.bat
Enter Com Port Number
Could not open com port.
Once the device has entered boot loader mode
Press any key to continue . . .
U2IO flash erasing: FAILED.
Device is not found.
Operation aborted.
Press any key to continue . . .
4
USB Infrared Toy / Problems with a HID divice
In my other thread i have problems with the irtoy. I also found a Zotac IR Receiver.
It seems this one likes to behave like a keyboard.
I found two sites with a udev rule. Tried both. It does not seem to work for me.

Quote
root@raspberrypi:/etc/udev/rules.d# cat 10-local.rules
# http://ben.periton.co.uk/2012/06/config ... e-control/
#SUBSYSTEM=="usb" , ATTRS{idVendor}=="0471", ATTRS{idProduct}=="20cc", SYMLINK+="remote", ACTION=="add", RUN+="/sbin/initctl --quiet emit --no-wait ir-ready"

# https://sourceforge.net/p/lirc/git/ci/d ... guide.html
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="20cc",
MODE="0660", GROUP="lirc",
RUN="/bin/sh -c 'echo -n $kernel:1.0 > /sys/bus/usb/drivers/usbhid/unbind'"


After a reboot i see
Quote
[  54.859074] input: PHILIPS MCE USB IR Receiver- Spinel plus as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/0003:0471:20CC.0001/input/input0
[  54.912086] hid-generic 0003:0471:20CC.0001: input,hiddev0,hidraw0: USB HID v1.00 Keyboard [PHILIPS MCE USB IR Receiver- Spinel plus] on usb-3f980000.usb-1.5/input0

I Assume this whole "hid-generic" line should dissapear? What will be the device name?


Another solution would be a working alternative. Anyone ideas? I have a couple (simple) requirements:
* small, casing, should be placed under the TV
* must have a usb cord
* receiver is enough
* if it works with the ancient lirc versions is a plus
* easy to order in Holland
5
USB Infrared Toy / Re: RaspberryPi3: does not register all keypresses with IRW
I do not understand the bug. So i find it kinda hard to file it.
Furthermore, am i the only one with problems? I did not suspect problems with the latest version of Lirc.
I did another test, now on verbose level 10. I pressed the button a couple of times until irw stopped detecting presses. After a pause it will work again.
See attachment


I noticed the debian deb builder is using a extra patch.

Code: [Select]
pi@raspberrypi:~/lirc-debian-src-0.9.4b/lirc-0.9.4b/debian/patches $ cat 0003-irtoy-improve-error-handling-220.patch
From 62b9172bf52584e0c621d0163052ccca9a240846 Mon Sep 17 00:00:00 2001
From: Helen Foster <helen-foster@users.sourceforge.net>
Date: Sun, 14 Aug 2016 14:00:30 +0100
Subject: [PATCH 03/10] irtoy: improve error handling (#220).

Avoid double init. Avoid calling setPin or trying to send if irtoy
is not initialized (segfault).
---
 plugins/irtoy.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/plugins/irtoy.c b/plugins/irtoy.c
index f6e81d7..f7a6feb 100644
--- a/plugins/irtoy.c
+++ b/plugins/irtoy.c
@@ -467,6 +467,9 @@ static int init_device(void)
                          IRTOY_MINFWVERSION,
                          dev->swVersion);
                free(dev);
+              dev = NULL;
+              close(drv.fd);
+              tty_delete_lock();
                return 0;
        }
        rec_buffer_init();
@@ -490,10 +493,15 @@ static int init(void)
                "Additional irtoy device found: %s (ignored)";
        const char* const MSG_FOUND = "irtoy device found on %s";

+      log_trace("irtoy: init");
        if (drv.device == NULL) {
                log_error("irtoy: NULL device.");
                return 0;
        }
+      if (dev != NULL) {
+              log_debug("irtoy: init: irtoy already initialized");
+              return 1;
+      }
        if (strcmp(drv.device, "auto") != 0)
                return init_device();
        for (found = 0, i = 0; i <= 9; i++) {
@@ -516,6 +524,8 @@ static int init(void)

 static int deinit(void)
 {
+      log_trace("irtoy: deinit");
+
        // IMPORTANT do not remove this reset. it is vital to return the
        // irtoy to IRMAN mode.
        // If we leave the irtoy in sample mode while no-one has the
@@ -527,14 +537,14 @@ static int deinit(void)
        // sending the next one, while sample mode will keep streaming
        // (and under fluorescent light it WILL stream..)
        // triggering the problem
-      setPin(openPin, 0);
-      setPin(sendingPin, 0);
-      setPin(receivePin, 0);
        if (dev != NULL) {
+              setPin(openPin, 0);
+              setPin(sendingPin, 0);
+              setPin(receivePin, 0);
                irtoy_reset(dev);
                free(dev);
+              dev = NULL;
        }
-      dev = NULL;

        close(drv.fd);
        drv.fd = -1;
@@ -562,10 +572,6 @@ static int irtoy_send_double_buffered(unsigned char* signals, int length)
        unsigned char reply[16];
        int irtoyXmit;

-      if (dev == NULL) {
-              log_error("irtoy_send: irtoy not initialized");
-              return 0;
-      }
        res = write(dev->fd, IRTOY_COMMAND_TXSTART, sizeof(IRTOY_COMMAND_TXSTART));

        if (res != sizeof(IRTOY_COMMAND_TXSTART)) {
@@ -647,6 +653,12 @@ static int send(struct ir_remote* remote, struct ir_ncode* code)
        lirc_t val;
        int res;

+      log_trace("irtoy: send");
+
+      if (dev == NULL) {
+              log_error("irtoy: send: irtoy not initialized");
+              return 0;
+      }

        if (!send_buffer_put(remote, code))
                return 0;
--
2.5.5

6
USB Infrared Toy / Re: RaspberryPi3: does not register all keypresses with IRW
A little progress. But i am at the point to destroy this thing. Partly to blame to Debian, they have a ancient Lirc version.

I have installed the latest "unofficial" debian version using the README
Quote
    $ sudo apt-get install devscripts
    $ tar xf lirc-debian-src-0.9.4-1.tar.gz
    $ cd /lirc-debian-src-0.9.4b
    $ dpkg-source -x *dsc
    $ cd lirc-0.9.4
    $ mk-build-deps
    $ sudo dpkg -i lirc-build-deps*.deb
    $ sudo apt-get install -f --fix-missing
    $ sudo dpkg -i lirc-build-deps*.deb
    $ rm lirc-build-deps*.deb
    $ debuild -us -uc
    $ cd ..
    $ sudo dpkg -i $(ls *.deb ) => this should fail?
    $ sudo apt-get install -f --fix-missing
    $ sudo dpkg -i $(ls *.deb )
   
cp /etc/lirc/lircd.conf.dist /etc/lirc/lircd.conf
mv /etc/lirc/lircd.conf.d/devinput.lircd.conf /etc/lirc/lircd.conf.d/devinput.lircd.conf.org
wget -O /etc/lirc/lircd.conf.d/CD720.conf http://lirc.sourceforge.net/remotes/philips/CD720

I am faking a Philips CD player. I am using a Harmony 525 remote.

Now i start LIRC

Quote
root@raspberrypi:/etc/lirc/lircd.conf.d# lircd --nodaemon --dev /dev/irtoy --driver irtoy --loglevel=9
lircd-0.9.4b[12539]: Trace1: lircd:  Opening log, level: Trace1
lircd-0.9.4b[12539]: Warning: Running as root
lircd-0.9.4b[12539]: Trace: started server socket
lircd-0.9.4b[12539]: Trace1: parsing '/etc/lirc/lircd.conf'
lircd-0.9.4b[12539]: Trace1: parsing '/etc/lirc/lircd.conf.d/CD720.conf'
lircd-0.9.4b[12539]: Trace: parsing remote
lircd-0.9.4b[12539]: Trace1: creating first remote
lircd-0.9.4b[12539]: Info: Using remote: Philips_CD720.
lircd-0.9.4b[12539]: Trace1: flags value: 16386
lircd-0.9.4b[12539]: Trace1:    begin codes
lircd-0.9.4b[12539]: Trace1:    end codes
lircd-0.9.4b[12539]: Trace1: end remote
lircd-0.9.4b[12539]: Trace: lengths: 113266 113266 89283 90186
lircd-0.9.4b[12539]: Trace: lengths: 113266 113266 89283 90186
lircd-0.9.4b[12539]: Trace: config file read
lircd-0.9.4b[12539]: Notice: lircd(irtoy) ready, using /var/run/lirc/lircd


I open another shell with "irw"

Quote
lircd-0.9.4b[12539]: Trace: registering local client
lircd-0.9.4b[12539]: Notice: accepted new client on /var/run/lirc/lircd
lircd-0.9.4b[12539]: Trace: irtoy: init
lircd-0.9.4b[12539]: Trace: irtoy_getversion: Got version V222
lircd-0.9.4b[12539]: Trace: irtoy_reset: Got protocol S01
lircd-0.9.4b[12539]: Trace: Version hw 2, sw 22, protocol 1

Then i press "play"

Quote
lircd-0.9.4b[12539]: Trace: irtoy_raw_rec
lircd-0.9.4b[12539]: Trace: new signal after large space
lircd-0.9.4b[12539]: Trace: readdata 0 1000000
lircd-0.9.4b[12539]: Trace: trying "Philips_CD720" remote
lircd-0.9.4b[12539]: Trace: decode: enter
lircd-0.9.4b[12539]: Trace: sync
lircd-0.9.4b[12539]: Trace: readdata 1 810
lircd-0.9.4b[12539]: Trace: readdata 0 959
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 810
lircd-0.9.4b[12539]: Trace: readdata 0 917
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace: readdata 0 895
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1834
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 917
lircd-0.9.4b[12539]: Trace: readdata 1 853
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1834
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 810
lircd-0.9.4b[12539]: Trace: readdata 0 917
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1791
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1813
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: code: 1d35
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace1: sum: 23730
lircd-0.9.4b[12539]: Trace: readdata 0 92010
lircd-0.9.4b[12539]: Trace: decode: 1
lircd-0.9.4b[12539]: Trace: found: KEY_PLAY
lircd-0.9.4b[12539]: Trace: 55abd948 0 0 0 0 0 0 0 0 0
lircd-0.9.4b[12539]: Trace: release_gap: 273311
lircd-0.9.4b[12539]: Trace: writing to client 0: 0000000000001535 00 KEY_PLAY Philips_CD720
lircd-0.9.4b[12539]: Trace: irtoy_raw_rec
lircd-0.9.4b[12539]: Trace: trying "Philips_CD720" remote
lircd-0.9.4b[12539]: Trace: decode: enter
lircd-0.9.4b[12539]: Trace: sync
lircd-0.9.4b[12539]: Trace: readdata 1 853
lircd-0.9.4b[12539]: Trace: readdata 0 917
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace: readdata 0 895
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 853
lircd-0.9.4b[12539]: Trace: readdata 0 917
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1706
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1834
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 895
lircd-0.9.4b[12539]: Trace: readdata 1 853
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1791
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 853
lircd-0.9.4b[12539]: Trace: readdata 0 917
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1834
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1834
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: code: 1d35
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace1: sum: 23795
lircd-0.9.4b[12539]: Trace: readdata 0 92010
lircd-0.9.4b[12539]: Trace: decode: 1
lircd-0.9.4b[12539]: Trace: found: KEY_PLAY
lircd-0.9.4b[12539]: Trace: 55abd948 55abd948 55abd948 1 1 0 0 1 1 1
lircd-0.9.4b[12539]: Trace: release_gap: 273311
lircd-0.9.4b[12539]: Trace: writing to client 0: 0000000000001535 01 KEY_PLAY Philips_CD720
lircd-0.9.4b[12539]: Trace: irtoy_raw_rec
lircd-0.9.4b[12539]: Trace: trying "Philips_CD720" remote
lircd-0.9.4b[12539]: Trace: decode: enter
lircd-0.9.4b[12539]: Trace: sync
lircd-0.9.4b[12539]: Trace: readdata 1 853
lircd-0.9.4b[12539]: Trace: readdata 0 917
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace: readdata 0 938
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace: readdata 0 938
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1791
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 938
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1834
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 831
lircd-0.9.4b[12539]: Trace: readdata 0 938
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1813
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: readdata 1 1727
lircd-0.9.4b[12539]: Trace1: 0
lircd-0.9.4b[12539]: Trace: readdata 0 1791
lircd-0.9.4b[12539]: Trace1: 1
lircd-0.9.4b[12539]: Trace: code: 1d35
lircd-0.9.4b[12539]: Trace: readdata 1 853
lircd-0.9.4b[12539]: Trace1: sum: 23836
lircd-0.9.4b[12539]: Trace: decode: 1
lircd-0.9.4b[12539]: Trace: found: KEY_PLAY
lircd-0.9.4b[12539]: Trace: 55abd948 55abd948 55abd948 1 1 0 0 1 1 1
lircd-0.9.4b[12539]: Trace: release_gap: 273311
lircd-0.9.4b[12539]: Trace: writing to client 0: 0000000000001535 02 KEY_PLAY Philips_CD720
...little delay
...little delay
lircd-0.9.4b[12539]: Trace: irtoy_raw_rec
lircd-0.9.4b[12539]: Trace: readdata 0 1000000
lircd-0.9.4b[12539]: Trace: trying "Philips_CD720" remote
lircd-0.9.4b[12539]: Trace: decode: enter
lircd-0.9.4b[12539]: Trace: sync
lircd-0.9.4b[12539]: Trace1: pulse expected
lircd-0.9.4b[12539]: Trace: failed on bit 1
lircd-0.9.4b[12539]: Trace: failed on code
lircd-0.9.4b[12539]: Trace: decode: 0
lircd-0.9.4b[12539]: Trace: decoding failed for all remotes

Everytime i see those " failed" messages after a while.
I get a response in IRW tho.
Is this normal?


Quote
pi@raspberrypi:/etc/lirc/lircd.conf.d $ irw
0000000000001535 00 KEY_PLAY Philips_CD720
0000000000001535 01 KEY_PLAY Philips_CD720
0000000000001535 02 KEY_PLAY Philips_CD720
7
USB Infrared Toy / Re: RaspberryPi3: does not register all keypresses with IRW
Thanks for your reply

[quote author="Barf"]
Unfortunately, most Linux distros ship a Linux that is many, many years old. So, unless you are using a Linux that has a current Lirc (Fedora + ???)  you should get the current version and compile it.
[/quote]

No, i am using Raspbian. It has a really old (0.9.0) version of LIRC. If i compile the newer versions myself i get the "lock" problem i mentioned.
If i use the device with my Fedora laptop (lird 0.9.4) it works fine.

I want it to work with Raspbian though.
8
USB Infrared Toy / RaspberryPi3: does not register all keypresses with IRW
Spend more time as expected with this "toy". Hope someone can help.
The device did not work on my raspberry pi 3 with the Rasbian verion of LIRC. (0.9.0).
According to the wiki you should be able to use the "irman" driver.

After some hours i tried Fedora. It has version 0.9.5 of LIRC. And i found out that the device is only supported by version 0.9.2
It works fine with Fedora.

So i tried to manually compile the latest LIRC sources (stable and unstable). After many struggles it compiled. It works but if i start "irw" it registers two keypresses and it seems to "hang". Some keypresses afterwards are registered.

Then i found this helpful guide: https://gist.github.com/bullshit/918d74db9473355d7181
Installed  using this steps, but with version pre1-2 instead of pre1-1.
The same problem.

Hope someone can help. I am at the point to give up.

Firmware is updated to v22 (story on its own).

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01892421472session_write_close ( )...(null):0
20.01932553048ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01932553824Database_MySQL->query( ).../DatabaseHandler.php:119
40.06372692544Database_MySQL->error( ).../Db-mysql.class.php:273