JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Arduino interface - resolved problems with RMIR

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Software
View previous topic :: View next topic  
Author Message
jeffs555



Joined: 04 Feb 2009
Posts: 6

PostPosted: Sat May 19, 2018 6:27 pm    Post subject: Arduino interface - resolved problems with RMIR Reply with quote

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
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 18452
Location: Chicago, IL

PostPosted: Sun May 20, 2018 9:05 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
binky123
Expert


Joined: 14 Feb 2004
Posts: 1292

PostPosted: Sun May 20, 2018 10:16 am    Post subject: Reply with quote

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
View user's profile Send private message
jeffs555



Joined: 04 Feb 2009
Posts: 6

PostPosted: Sun May 20, 2018 11:55 am    Post subject: Reply with quote

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
View user's profile Send private message
binky123
Expert


Joined: 14 Feb 2004
Posts: 1292

PostPosted: Sun May 20, 2018 12:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 832

PostPosted: Sun May 20, 2018 12:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Barf
Expert


Joined: 24 Oct 2008
Posts: 832

PostPosted: Sun May 20, 2018 1:06 pm    Post subject: Reply with quote

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 Wink) 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
View user's profile Send private message Send e-mail Visit poster's website
jeffs555



Joined: 04 Feb 2009
Posts: 6

PostPosted: Sun May 20, 2018 10:06 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Software All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central