Using URC6440 and OARUSB04G Remotes with Linux

From JP1 Remotes Wiki
Revision as of 14:38, 24 September 2019 by The Robman (talk | contribs) (text by davecs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

When you plug a USB remote into your computer, a device is created, but its path is unpredictable. It may turn up as /dev/sdc1. /dev/sdd1, sde1 etc., because of other things already plugged in. However, there is a "predictable" shortcut that is created when you plug it in, and it's the same for both the European and American models.

That shortcut is: /dev/disk/by-id/usb-UEI_Remotes_UEI_Mass_Storage_000000000001-0:0-part1

Granted it's not much of a shortcut, but it will always be the same, so we can make use of it in the mount command.

The following will allow one named user to get access to the remote control in order to run RMIR and communicate with the remote.

Create the following script and store it under /etc/udev/rules.d and I've called it 62-usbremote.rules -- it's all one line, by the way.

[Select]
ACTION=="add", KERNEL=="sd*[0-9]", ATTRS{idVendor}=="06e7", ATTRS{idProduct}=="8015|8020", RUN+="/usr/local/bin/mount_ofa_setup"

This next script serves merely to return control to the udev system as quickly as possible, hence the & at the end of the line. I've called it mount_ofa_setup and it goes in /usr/local/bin. It must be made executable:

[Select]
#!/bin/bash
/usr/local/bin/mount_ofa &

This next script does the actual job. It also goes in /usr/local/bin and is called mount_ofa and must be made executable:

#!/bin/bash
mkdir /media/your-user-name
mkdir /media/your-user-name/REMOTE
chown your-user-name:your-group-name /media/your-user-name/REMOTE
mount -t vfat /dev/disk/by-id/usb-UEI_Remotes_UEI_Mass_Storage_000000000001-0:0-part1 /media/your-user-name/REMOTE/ -o uid=500,gid=500,utf8,dmask=027,fmask=137

NOTE: The line in RED is a single line when typed in.

In PCLinuxOS, the main user is normally numbered 500, and group number 500 too. If this is not correct for you, change the numbers in BLUE.

And of course change your-user-name and your-group-name for your actual user and group names!

After a reboot, your new udev rule should be available. Plug in your remote and the icon will appear on your desktop. You can unmount it in the normal way.

Set up RemoteMasterIR to point to it correctly from its menus:

Remote > Interface > JPS... > Other : /media/your-user-name/REMOTE/settings.bin

Once it has been determined how to get this to work for any user, this page will be updated.