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

Please test: improved Linux access to URC-6440+OARUSB04G
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - General Forum
View previous topic :: View next topic  
Author Message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Sun Jun 18, 2023 6:08 pm    Post subject: Please test: improved Linux access to URC-6440+OARUSB04G Reply with quote

As Graham/Mathdon has done such a splendid job with RMIR3.0.0, I thought I ought to see if I could contribute something by simplifying the mounting these remotes in Linux. The stuff I wrote a few years ago in the wiki really only worked if there was only one user logged in, and even if someone else had logged out, and the second person to log in tried to use RMIR with one of these remotes, it was touch and go whether it mounted.

Well, I think I have found the solution, and I wonder if any of you who have one of these remotes could test it, before I re-write the page.

The change is to forget about trying to mount the remote as user, but mount it as root, but with read-write access to any user.

The file in /etc/udev/rules.d, 62-usbremote.rules, can be changed slightly by getting rid of an intermediate file to hand control back to the system, by going straight to "mount_ofa" and putting an ampersand at the end, thus:

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


The file which does the work, at /usr/local/bin/ called mount_ofa is re-written as:

Code:

#!/bin/bash

mkdir /media/REMOTE

mount -t vfat /dev/disk/by-id/usb-UEI_Remotes_UEI_Mass_Storage_000000000001-0:0-part1 /media/REMOTE/ -o user,umask=0000

From "mount" to "0000" is all one line. It's the options user, and umask=0000 that allow any user to read and write to the remote.

Anyway, I know that Graham/Mathdon and Randy/HamburgerHelper1 have these remotes working with Linux. It would be great if they can confirm that it works for them as well.

The other thing I will try to do is to write a "remove" script as well. Because of the way that RMIR sends data to these remotes in Linux, it is safe to unplug them without unmounting, but you can sometimes end up with multiple dead mounts on your system. So maybe I can sort that out too.

I will update the wiki when I'm sure everything will work OK.

Dave
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Mon Jun 19, 2023 2:40 pm    Post subject: Reply with quote

OK! I tried this and it worked!

I changed /etc/udev/rules.d/62-usbremote.rules so it now contains these two lines:

Code:

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

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


Then I kept the revised /usr/local/bin/mount_ofa from the first post, and added /usr/local/bin/umount_ofa as follows:

Code:

#!/bin/bash

umount -f /media/REMOTE/

rmdir /media/REMOTE


I am using it on PCLinuxOS and it's working. I will now test it on another Linux I also use called MXLinux.

EDIT: All files must be owned by root. mount_ofa and umount_ofa must be marked as executable.

EDIT2: In every test, the remote is mounted on connection. On disconnection, it unmounts most of the time. Not sure why it occasionally doesn't, but it shouldn't be a problem in reality.
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661


Last edited by davecs on Thu Jun 22, 2023 8:06 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Thu Jun 22, 2023 7:59 am    Post subject: Reply with quote

I have changed the file umount_ofa to read:

Code:

#!/bin/bash

sleep 1
umount /media/REMOTE/

sleep 1
rmdir /media/REMOTE


This is to ensure that the system is ready to unmount the drive before we attempt it, and to give time to /media/REMOTE to be empty before we attempt to remove it. If, for some reason, /media/REMOTE is not unmounted, then rmdir will have contents and thus will fail. rmdir without any switches will not remove a directory that's not empty, so this will not wipe the contents of your remote if still mounted.

Since I've had no comments on this, I assume that it's OK to rewrite the page in the wiki. Since I've made a small update, though, I will give it 3-4 days before I do, unless anyone has any objections.

I'd also like to change the page title to be specifically about these two remotes, not USB remotes in general, as the "rules.d" entries for the Xsight and Nevo remotes are included in the RMIR download with instructions, and indeed have their own pages in the wiki.
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Tue Jun 27, 2023 2:31 pm    Post subject: Reply with quote

OK I have posted this method to the Wiki. I have left the old method there for the time being, but marked it as Deprecated.

@The Robman:

Can you change the page title to make clear that the page is just about the URC-6440 and OARUSB04G, please? The XSight and Nevo remotes have their own instructions in the RM download. I will then tidy up the intro to get rid of some of the stuff which is only there because it refers to other remotes in the first place!

@Mathdon:

Do you think that it would be a good idea to zip the three files, along with a brief instruction text, in future versions of RMIR?
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
The Robman
Site Owner


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

                    
PostPosted: Tue Jun 27, 2023 6:20 pm    Post subject: Reply with quote

davecs wrote:
@The Robman:

Can you change the page title to make clear that the page is just about the URC-6440 and OARUSB04G, please? The XSight and Nevo remotes have their own instructions in the RM download. I will then tidy up the intro to get rid of some of the stuff which is only there because it refers to other remotes in the first place!

I've done what I think you're asking me to do. Any reason you didn't just do it yourself? If it's because you don't know how, to change the name/title of a page, you need to use Move, which you can access from the drop down menu to the right of the View History link.
_________________
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
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Tue Jun 27, 2023 6:52 pm    Post subject: Reply with quote

The Robman wrote:

I've done what I think you're asking me to do. Any reason you didn't just do it yourself? If it's because you don't know how, to change the name/title of a page, you need to use Move, which you can access from the drop down menu to the right of the View History link.


That's great. It's 1am here, I'll tidy up the start of the page tomorrow.

EDIT: 15:50 28 June 2023 > All done now!
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Wed Jun 28, 2023 1:06 pm    Post subject: Reply with quote

davecs wrote:
@Mathdon:

Do you think that it would be a good idea to zip the three files, along with a brief instruction text, in future versions of RMIR?

Yes, and you are just in time for me to include this in v3.0.1 that I expect to release tomorrow.

To test, I have today followed your instructions with my Ubuntu Linux, but find I have to do one extra step to complete the mounting. If I open "Files" and select "Other Locations", I get an entry "urc6440" as well as "Computer". I need to click on the "urc6440" entry, which then disappears and a new mounted drive appears instead. The remote then downloads without further problems. Is there a way to automate this step too? Do you know why it is needed? Might I be missing something in your instructions, or is it just Ubuntu behaving a little differently?
_________________
Graham
Back to top
View user's profile Send private message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Wed Jun 28, 2023 1:21 pm    Post subject: Reply with quote

mathdon wrote:

Yes, and you are just in time for me to include this in v3.0.1 that I expect to release tomorrow.

To test, I have today followed your instructions with my Ubuntu Linux, but find I have to do one extra step to complete the mounting. If I open "Files" and select "Other Locations", I get an entry "urc6440" as well as "Computer". I need to click on the "urc6440" entry, which then disappears and a new mounted drive appears instead. The remote then downloads without further problems. Is there a way to automate this step too? Do you know why it is needed? Might I be missing something in your instructions, or is it just Ubuntu behaving a little differently?


Probably Ubuntu being Ubuntu as Ubuntu tends to do. One of the problems I have being a Linux-but-not-ubuntu user (since before Ubuntu was invented), is that whenever I go on the internet to find out how to do something in Linux, the search engine always gives me how to do it in Ubuntu, which is often totally wrong for most other distros. Did you have to create the folder /etc/udev/rules.d/ or was it already there?

Or it could also be that the desktop you are using with Ubuntu works differently. I am using KDE with PCLinuxOS and XFCE with MX-Linux. KDE has a little "Removable Device" applet in the System Tray, but with XFCE you have to set it so that Removable Device icons appear on the desktop. Either way, though, you don't actually have to do anything with them for the remote to be open and available to RMIR.

Still, I think that having a desktop icon that you have to click on, to finish the job, is better than having to run a custom mount command every time which I understand that you and HH1 were doing?

---------

Just thought of something else. When you first plug in the Remote, does it show in the File Manager at /media/REMOTE? And after you click on this icon, does it also show somewhere else? (for example /media/mathdon/REMOTE). If so, set your RMIR to: Remote>Interface>JPS...>/media/REMOTE and it would work first time. I hope!
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Wed Jun 28, 2023 2:18 pm    Post subject: Reply with quote

davecs wrote:
I think that having a desktop icon that you have to click on, to finish the job, is better than having to run a custom mount command every time which I understand that you and HH1 were doing?

Oh, absolutely! I am very grateful for your work on this. As for your specific questions, the folder /etc/udev/rules.d/ was already there. When I first plug in the remote, the media folder contains an empty subfolder called urc6440. After I click on the urc6440 entry that is separate from Computer and that entry disappears, the /media/6440 folder gains two files, settings.bin and urc_6440.url.

In the instructions I have written for RMIR, based entirely on your Wiki article, I have added a note about this behaviour with Ubuntu. I have no idea what desktop I am using. I am not a true Linux user, I use it entirely for testing things like this.
_________________
Graham
Back to top
View user's profile Send private message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Wed Jun 28, 2023 2:55 pm    Post subject: Reply with quote

mathdon wrote:

Oh, absolutely! I am very grateful for your work on this. As for your specific questions, the folder /etc/udev/rules.d/ was already there. When I first plug in the remote, the media folder contains an empty subfolder called urc6440. After I click on the urc6440 entry that is separate from Computer and that entry disappears, the /media/6440 folder gains two files, settings.bin and urc_6440.url.

In the instructions I have written for RMIR, based entirely on your Wiki article, I have added a note about this behaviour with Ubuntu. I have no idea what desktop I am using. I am not a true Linux user, I use it entirely for testing things like this.


That's strange. The instructions in the script that the rules file calls, specifically say to create a folder called /media/REMOTE — if that's not created, then the script is being ignored, and something else in Ubuntu is detecting your plugged in device. Unless you interpreted "REMOTE" to mean 6440 (i.e., the name of your remote)? When I put /media/REMOTE in the instructions, I meant literally! Though if you change that to 6440 or anything else, as long as it's consistent throughout, it shouldn't matter.
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Thu Jun 29, 2023 4:36 am    Post subject: Reply with quote

I am now totally confused by what is going on. I have tried the following. First I deleted the /media/6440 folder then clicked on the separate 6440 link. I got the message
Code:
mount: /media/urc6440 no such file or directory

I have no idea where that mount instruction comes from. Then I recreated the /media/6440 folder and deleted your three files. Now it worked exactly as it did when your files were present. So apparently they are ignored.

As I explained, I only use Linux for testing and usually then it is not with the 6440, so I cannot remember what used to happen previously when I tried to use it with Linux. Apparently it works as I have described without needing any extra files, and that takes precedence over any other method such as yours.

Can you shed any further light on this, or suggest any further tests I can make?
_________________
Graham
Back to top
View user's profile Send private message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Thu Jun 29, 2023 7:47 am    Post subject: Reply with quote

mathdon wrote:
I am now totally confused by what is going on. I have tried the following. First I deleted the /media/6440 folder then clicked on the separate 6440 link. I got the message
Code:
mount: /media/urc6440 no such file or directory

I have no idea where that mount instruction comes from. Then I recreated the /media/6440 folder and deleted your three files. Now it worked exactly as it did when your files were present. So apparently they are ignored.

As I explained, I only use Linux for testing and usually then it is not with the 6440, so I cannot remember what used to happen previously when I tried to use it with Linux. Apparently it works as I have described without needing any extra files, and that takes precedence over any other method such as yours.

Can you shed any further light on this, or suggest any further tests I can make?


In both the versions of Linux I use, these remotes were autodetected and no further action was necessary. Then later versions stopped working. Automatic recognition was obviously withdrawn. Perhaps Ubuntu left it in. In other words, with Ubuntu you don't need to do anything!

I will revise the page to say that it may work "out of the box" with some versions of Linux in which case you don't need to do anything. I will also see if I can find out where the list of device idVendors and idProducts are kept, and whether just adding these two to the list will solve the problem instantly. That would, of course, be the best solution.

UPDATE: Wiki edited. Have a look at the first paragraph.
http://www.hifi-remote.com/wiki/index.php/Using_URC6440_and_OARUSB04G_Remotes_with_Linux
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Thu Jun 29, 2023 8:29 am    Post subject: Reply with quote

@Mathdon

Can you enter these commands in a terminal. If the first one returns a blank, it will tell me that the file does not exist. Let me know. If the first one returns loads and loads of stuff, that shows that the file exists. In which case, let me know whether the second one returns blank. If not, post here what it says:

cat /var/lib/usbutils/usb.ids

cat /var/lib/usbutils/usb.ids | grep 06e7

I think that Ubuntu must have left the data needed to mount these file automatically in the usb.ids files, whereas in PCLinuxOS it has been removed, and it may be as simple as just putting it back!!


Don't bother. I tried changing that file here and it didn't make any difference. I also downloaded Ubuntu v22 LTS and ran it live and the remote was not autodetected. What version are you running?
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Thu Jun 29, 2023 1:48 pm    Post subject: Reply with quote

davecs wrote:
I also downloaded Ubuntu v22 LTS and ran it live and the remote was not autodetected. What version are you running?

I've been busy most of today with other matters, so have had little time for further testing. I'm running Ubuntu v20 LTS. I think I have discovered what is happening with my system. Although the remote is autodetected, it is not automounted, so I feel that your files SHOULD work. The testing I have had time to do makes me think that the problem is that I created your files in Windows so they have Windows line endings, then copied them to Linux. The mkdir command for /media/REMOTE app therefore has a CR LF as its line ending rather than the expected LF. It appears that the mkdir command is therefore creating a directory with name REMOTE followed by CR, so the directory /media/REMOTE is not found.

I will have time to test this tomorrow. This is written in haste, so apologies if it is rather confused.
_________________
Graham
Back to top
View user's profile Send private message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Thu Jun 29, 2023 2:13 pm    Post subject: Reply with quote

mathdon wrote:

I've been busy most of today with other matters, so have had little time for further testing. I'm running Ubuntu v20 LTS. I think I have discovered what is happening with my system. Although the remote is autodetected, it is not automounted, so I feel that your files SHOULD work. The testing I have had time to do makes me think that the problem is that I created your files in Windows so they have Windows line endings, then copied them to Linux. The mkdir command for /media/REMOTE app therefore has a CR LF as its line ending rather than the expected LF. It appears that the mkdir command is therefore creating a directory with name REMOTE followed by CR, so the directory /media/REMOTE is not found.

I will have time to test this tomorrow. This is written in haste, so apologies if it is rather confused.


I wasn't aware that could be a problem (the CR/LF thing), but I don't think I've ever done anything that would test it. Ubuntu v20.04LTS was issued April 2020, but the problem I had with mounting the 6440 remote was well before then. At first, it worked out of the box, and then after an update in PCLinuxOS, it stopped working. It still worked in MX-Linux but that was because their distro, including the kernel, was less cutting-edge, i.e., it is dated by design. Once that was updated, it stopped working and I was forced to research how to get it mounted, and wrote the original wiki page on 24 September 2019. I was never happy with the convoluted way it detected the current user, and I decided to revisit it recently and did some research.

Let me know how you get on when you create the files in Linux itself.
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - General Forum All times are GMT - 5 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control