Games joypad and write permissions to /etc/udev/rules.d

More
12 Dec 2016 20:58 #83980 by Maitland
I'm new to LinuxCNC, and not experienced in Linux, so please bear with what must be virtually an FAQ. I have got LinuxCNC going and successfully controlling my Chinese 3020 flatbed and my Austrian Emco Unimat 3 lathe of ancient vintage. Now I'm trying to set up a joypad following Big John T's instructions. The very last line warns about invisibility of the joypad, and sure enough the halmeter can't see it, although js0 is in /dev/input. The fix is to write a one- line file to open the eyes of the HAL. The trouble is that having written the text, I can't save it in /etc/udev/rules.d. How do I get permission to write?

Version is 2.6.11.

While I'm asking, the instruction tells me to modify my .hal file and my .ini file. Where are these located?

Sorry to bother you with such basic questions.

Please Log in or Create an account to join the conversation.

More
12 Dec 2016 21:29 #83988 by andypugh
You won't have the permissions to save from your text editor to /etc/udev... by default.

If you open the editor with sudo privileges then you would be able to. To do this you need to start in a terminal window and type "sudo gedit" or "sudo mousepad"

Alternatively, save the file somewhere in your home folder then move it with another sudo command.
sudo mv ~/99_joypad   /etc/udev/rules.d/

The HAL and INI files will be found in your home folder, inside linuxcnc/configs/

Please Log in or Create an account to join the conversation.

More
12 Dec 2016 21:34 #83990 by Todd Zuercher
After you have ran Linuxcnc or one of the config wizzards within your home directory there should be a directory /linuxcnc/configs/

Please Log in or Create an account to join the conversation.

More
13 Dec 2016 11:30 #84022 by Maitland
Thanks very much for the quick, and right, responses. I should have remembered about sudo, it's all a bit like "Simon Says". I can now see my gamepad inputs. Bleaaagh! They seem to have forgotten to change the input assignations when they reshuffled the PCB. For example, the right hand button star 1,2,3,4 comes out as "top", "thumb2", "thumb" and "joystick". The top back righthand button is "pinkie", and you couldn't get at that with either pinkie unless you'd had a serious accident.

A few more questions/ comments if I may.

First, although all works fine in LCNC, halcmd still can't find the joystick. I'm looking at hal_input rather than hal_joystick which doesn't exist in my version.

Second, I notice that the current name for my joystick is js1. There is a js0 in there. Does this correspond to a previous insertion, removal cycle of the joystick and if so how do I stop it re- enumerating each time I plug it in? Or doesn't this matter because of the "unique" naming (I almost certainly- hopefully- will never hear of "DragonRise" again)?

Third, the main .hal file warns me that my changes will be overwritten if I run stepconf again. Which I will certainly do because I haven't finalised the step size for the Unimat yet (short story, but I can't easily get at the stepper pulleys to count the teeth). Is there any way of preserving my changes, or does stepconf recognise these as a special case?

Please Log in or Create an account to join the conversation.

More
13 Dec 2016 18:16 - 13 Dec 2016 18:23 #84048 by cncnoob1979

There is a js0 in there. Does this correspond to a previous insertion, removal cycle of the joystick and if so how do I stop it re- enumerating each time I plug it in?



From a post linked below: This creates a rule by vendor and ID. So not what hub its connected to.

I generated a file /etc/udev/rules.d/90-xhc.rules with the following content to get access to USB without root privileges as the guide says

SYSFS{idProduct}=="eb70", SYSFS{idVendor}=="10ce", MODE="666", OWNER="root", GROUP="users"


Link to thread
Link to HB04 Wiki

If the enumerating prevents your from loading or accessing the device then change this to correspond with what you have. That should stop the problem with failures associated with enumerating. If it does not affect you in the naming scheme then I would believe its fine the way it is.

Third, the main .hal file warns me that my changes will be overwritten if I run stepconf again.


StepConf will overwrite your file again. The best solution is to make a backup of your ini and save your configuration file; however in StepConf you can save your template (configuration) so you can freely edit until your basic configuration (hal & ini) is complete.

Afterwards you will not run StepCong again, everything else will be completed by hand in your ini and hal files.


Hope that helps and does not confuse you further!
Last edit: 13 Dec 2016 18:23 by cncnoob1979. Reason: clarification

Please Log in or Create an account to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum