I'm having trouble getting this to talk to an old-school JP1 interface. In the long distant past I had a Delcom interface that I would expose to a WinXP instance in a VM and use IR802. More recently I've been using RMIR and a JP1.3 remote, which works nicely in Linux, so I've not needed the windows config. But today I tried to use it and it failed.
So I went to see if I could get RMIR to work. Annoyingly the Delcom adapter doesn't seem to be visible to Linux so I hunted around and found the Arduino adapter (
http://www.hifi-remote.com/forums/dload ... e_id=11537 ). After a little bit of trial and error I was able to get an Arduino Nano to talk to a URC-8811 (that I bought from Robman in 2009!). Minor code fixes to the "dump" (formatting) and "fill" (that'd never have worked before) routines and I was also to demonstrate successful reads and writes. And taking the "dump" output I was able to generate a .ir file that RMIR loaded. Definitely the talk-to-remote was working!
But whenever I try to use RMIR using "JP1.x Serial" (which the readme says to use) I can see the Arduino blink and then get "no remote" error.
Slightly odd, I see in the error file:
Code: Select all
Starting normal download
Interface Name = JP1.X Serial
Port Name = /dev/ttyUSB0
Testing interface: JP1.X Serial
Interface matched. Trying to open remote
Port Name = NULL
Failed to open
That looks like it's just a logging error, though; stracing the code shows it's talking on the right port.
So let's dig further. OK, I can see the code sending 'E' (ping) requests, but the read() response isn't returning anything. So we try a few more times then give up. Hmm. I can see the Arduino flashing, so what's going on?
I hunted down the source ( svn checkout
https://svn.code.sf.net/p/controlremote/code/trunk controlremote-code ) and stuck some debugging print statements into jp12serial.cpp starting with jp12Test().
Idea... could it be the Arduino is still rebooting after the port had opened? Let's put some sleep() statements in (before/after setting the serial port attributes). No, that didn't help. Could it be an issue at the arduino end? Let's force a serial flush... nope, no change.
Let's dig further... hey, my debug statements in ReadSerial() didn't show up. Let's turn TRACE_SERIAL. That broke the compile! Oh, there's two versions of the function, but because the first has an optional parameter the second isn't used. Huh.
OK, let's just make the delay default to 1 second. And... hey... err... that worked! The remote downloaded. Of course it's very slow because following commands (eg Info) don't fill the buffer ('cos we don't know how many bytes will be sent) and so wait the whole second.
So let's go back to jp12Test() and make that delay for 0.1 second. Hmm, worked 75% of the time. Let's make it 0.5 seconds... Seems to work every time in my tests; it seems to take make 12-15 iterations of the loop on average, so definitely not the whole 0.5 seconds.
Code: Select all
*** 1174,1180 ****
return 0;
DWORD bytesRead = 0;
! if ( !ReadSerial( hSerial, cmdBuff, 1, &bytesRead))
return 0;
if ( cmdBuff[ 0 ] != 6 )
--- 1174,1180 ----
return 0;
DWORD bytesRead = 0;
! if ( !ReadSerial( hSerial, cmdBuff, 1, &bytesRead, 0.5))
return 0;
if ( cmdBuff[ 0 ] != 6 )
Now do uploads work? Err, that seems to be a not really.
At the moment I'm mostly concerned with reading 'cos this URC8811 is the only learning remote I have (the Atlas 5 can't learn) so I've fixed my immediate need.