View previous topic :: View next topic |
Author |
Message |
jeffs555
Joined: 04 Feb 2009 Posts: 8
|
Posted: Sat May 19, 2018 6:27 pm Post subject: Arduino interface - resolved problems with RMIR |
|
|
I haven't used JP1 since the old parallel port days but recently needed to add a new device to an old URC-8810. No more parallel ports, but did have some Arduinos and found the code in the files section to turn them into an interface for the old eeprom based controls. Had a lot of problems, but finally got it to work. Thought I would describe the problems in case anyone else tried this interface.
First problem was that I needed to add a 10k pull up to the SCL line. Most of the eeprom based remotes have a pull up on the SDA line, but not on the SCL line.
Next problem was that the current code sends out a 4 byte command for the JP2_4 that is not handled in the Arduino code. The first 3 bytes are invalid commands for the eeprom adapter, but the last byte is an "S" which is a write eeprom command. Patched the arduino code to ignore this 4 byte command.
After these fixes it found the control and identified it correctly as an 881x, however, it still didn't work. It showed the eeprom as all zeros. I am using win7 and was able to download and build jp12serial.dll and trace through and find the problem. The cause was that it was timing out on long eeprom reads (and also writes). JP12serial.dll was setting ReadTotalTimeoutMultiplier and WriteTotalTimeoutMultiplier to 10ms. Changing them to 20ms fixed the problem and I was able to successfully program the control with the new device.
Don't know if the arduino is just too slow on the I2C eeprom accesses or what. The default arduino I2C clock is supposedly 100kHz and could probably try changing it to 400kHz but don't know if eeproms in all controls would handle that. Changing the timeouts in JP12serial.dll worked fine for me and I am happy. The new Remote Master is a lot easier than the old spreadsheet stuff from when I used JP1 long ago. |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21271 Location: Chicago, IL |
Posted: Sun May 20, 2018 9:05 am Post subject: |
|
|
Thanks for that info Jeff, it may well help others at some point. _________________ Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help! |
|
Back to top |
|
|
binky123 Expert
Joined: 14 Feb 2004 Posts: 1292
|
Posted: Sun May 20, 2018 10:16 am Post subject: |
|
|
Can you post pointers to what files you used? I have a Raspberry Pi and URC-6131 EEPROM remotes and may be interested in making it work with the RPi.
I believe you are making the Arduino act like a EEPROM Protocol Adapter(UART on one side and SDA/SCL on the other side).
Thanks. |
|
Back to top |
|
|
jeffs555
Joined: 04 Feb 2009 Posts: 8
|
Posted: Sun May 20, 2018 11:55 am Post subject: |
|
|
Here is link to the Arduino code.
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=11537
Yes, it does make the Arduino act like the serial to eeprom adapter and was based on the original PIC code here. http://www.compendiumarcana.com/jp1epa/
Don't know if you are planning to just run the RM/RMIR software on the Pi and drive an external serial adapter or if you want to run the Arduino code on the Pi and have a stand alone programmer. If you wanted to run it all on the Pi, you might be better off starting with the Linux parallel port driver which is still in the RM/RMIR code. Should be easy to modify the parallel port code to just bit bang the ports on the Pi.
OOPS: just looked and the parallel port driver is only in the 386 Linux version and not in the ARM Linux version. Don't know how hard it would be to modify the 386 code to run on the ARM. |
|
Back to top |
|
|
binky123 Expert
Joined: 14 Feb 2004 Posts: 1292
|
Posted: Sun May 20, 2018 12:12 pm Post subject: |
|
|
Thanks for the pointers. There is a I2C driver on the Pi. It isn't difficult to bit bang things on the Pi. There is a wiringPi library with C, Python interfaces.
I think others have run RM/RMIR on the Pi itself but I haven't looked into it much. |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Sun May 20, 2018 12:48 pm Post subject: |
|
|
RM[IR] already runs on the RPi, see this thread, supported in the current official release.
The current Linux parallel driver is brain damaged; it may be possible possible to write something saner using GPIO. |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Sun May 20, 2018 1:06 pm Post subject: |
|
|
There is one idea that I have been toying around with for some time:
Create an interface device, connected to the JP1 remote and to [W]LAN. There are very cheap Arduino-compatible (loosely speaking ) devices with WLAN like the ESP8266.
Then we need to define an Ethernet based interface (e.g. TCP-sockets) between the interface and RMIR, should not be too hard. Thus (disregarding DecodeIR and hdiapi for a moment), RMIR will be pure Java, i.e. does not need any JNI-libraries any more. |
|
Back to top |
|
|
jeffs555
Joined: 04 Feb 2009 Posts: 8
|
Posted: Sun May 20, 2018 10:06 pm Post subject: |
|
|
For anyone contemplating using the Arduino serial to eeprom adapter code, I looked at it again and see why it is timing out on long eeprom reads. Reading from an I2C eeprom requires 3-4 bytes of setup and address. Kevin's original PIC code does sequential reads where this setup and address is sent once then just continue to read bytes. The Arduino code is doing individual byte reads and sending the setup sequence for each byte. Sending 3 extra bytes for each byte read is slowing it way down.
Also, the Arduino code does not support larger than 2kbyte eeproms.
NOTE: Mathdon's continuation of this discussion is here:
http://www.hifi-remote.com/forums/viewtopic.php?t=102890 |
|
Back to top |
|
|
|