Arduino Leonardo and linears encoders.
Ok, i´ve been searching the file shuttlexpress.c and i can´t locate it, can you say to me where it is?!
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...7a447992052e;hb=HEAD
Unfortunately as this is a userspace component written in C it is not possible to compile it with comp
www.linuxcnc.org/docs/html/hal/comp.html...side_the_source_tree
Which is slightly unfortunate.
Please Log in or Create an account to join the conversation.
If i cannot compile with comp, how can i do it?
How ArcEye did it?
Thank you!!
Regards.
Please Log in or Create an account to join the conversation.
comp can also compile and install a component written in C, using the --install and --compile options shown above:
comp --install rtexample2.c
is contradictorious, isn´t it?
To compile it, what is the normal proccess?
comp --compile shuttlexpress.c
And it would make an executable file in the same directory??
Thank you.
Please Log in or Create an account to join the conversation.
Andy a bit upper in the link you posted yesterday says:
comp can also compile and install a component written in C, using the --install and --compile options shown above:
comp --install rtexample2.c
is contradictorious, isn´t it?
To compile it, what is the normal proccess?
comp --compile shuttlexpress.c
If you try it you will see Andy is right, certainly regards the file in the build sources.
It is not that it cannot compile it per se, it only launches gcc, but outside the build environment it cannot resolve the includes and linkages.
The simplest way to build it, is to download the sources for Linuxcnc 2.5.1
www.linuxcnc.org/dists/lucid/linuxcnc2.5...inuxcnc_2.5.1.tar.gz
Then extract it into /usr/src/build and run ./configure --prefix=/usr from the .../build/src directory
Fix any dependencies then run make
Do NOT run make install
You can then replace .../src/hal/usr_comps/shuttlexpress.c with your own one and run make again
You will now have the compiled binary in /usr/src/build/bin and can copy it to /usr/bin
If your Linuxcnc version installed is different, obviously download the one to match.
This is not how I did it, I have a lot of development scripts etc which I use, but it is how I compile modules for other peoples machines, to ensure that they are compatible.
regards
Please Log in or Create an account to join the conversation.
Andy a bit upper in the link you posted yesterday says:
comp can also compile and install a component written in C, using the --install and --compile options shown above:.
Comp can compile and install:
Userspace and Realtime components written in the .comp preprocessing language.
Realtime components written in C.
It _can't_ compile and install Userspace components written in C, and shuttlexpress.c is a userspace component written in C.
Unfortunately to compile the modified shuttlexpress.c file you will need to download the source of LinuxCNC, make your changes, and then recompile LinuxCNC. (You can do this without messing up your installed version).
This probably sounds like a big step, but it isn't actually all that painful.
Instructions here:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Instal...ge_already_installed
(You need sections 2.1.2 onwards)
Please Log in or Create an account to join the conversation.
I´m going to try the compilation, let´s rock....
Thank you!
Please Log in or Create an account to join the conversation.
pablo@Pablo-cnc:~$ halrun
halcmd: loadusr shuttlexpress
halcmd: shuttlexpress: checking /dev/hidraw0
shuttlexpress: error opening /dev/hidraw0: Permission denied
shuttlexpress: make sure you have read permission on /dev/hidraw0, read the shuttlexpress(1) manpage for more info
shuttlexpress: checking /dev/hidraw1
shuttlexpress: error opening /dev/hidraw1: Permission denied
shuttlexpress: make sure you have read permission on /dev/hidraw1, read the shuttlexpress(1) manpage for more info
shuttlexpress: checking /dev/hidraw2
shuttlexpress: error opening /dev/hidraw2: Permission denied
shuttlexpress: make sure you have read permission on /dev/hidraw2, read the shuttlexpress(1) manpage for more info
shuttlexpress: checking /dev/hidraw3
shuttlexpress: dev /dev/hidraw3 has unexpected Product ID 0xffffeb70 (expected ShuttleXpress, 0xeb70)
shuttlexpress: no devices found
It is no normal, because in shuttlexpress.c i changed the two values, the original was this:
// USB Vendor and Product IDs
55 #define VENDOR_ID 0x0b33 // Contour Design
56 #define PRODUCT_ID 0x0020 // ShuttleXpress
And i changed to:
// USB Vendor and Product IDs
55 #define VENDOR_ID 0x10ce // Contour Design
56 #define PRODUCT_ID 0xeb70 // ShuttleXpress
ArcEye did you change the two values or just the Vendor Id one??
Thank you.
Please Log in or Create an account to join the conversation.
ArcEye did you change the two values or just the Vendor Id one??
You have to change both, both are checked
Your problem is user permissions, just run as root or start with sudo halcmd to see if it works, then sort out your permissions afterwards.
PS
I can replicate the exact same error if I attempt to load the module logged in as my partner (whom I have given very limited permissions on this machine so she can't screw it up!)
My ordinary user account can load the module, but that is because I made myself a member of the group 'root' which is allowed to read /dev/hidrawN
That is probably the easiest thing to do to load it under your ordinary user log in
Please Log in or Create an account to join the conversation.
I have done this to make me as root user:
sudo -u root passwd
su -
and doing this in the terminal it shows me as root@pablo-cnc: ~
doing this, do i became a member o group "root", at least in that terminal??
Because it continues showing the same error.
Thank you!
Please Log in or Create an account to join the conversation.
sudo passwd root
Then supply a password twice when requested
sudo passwd -u root
unlocks
su root
Then supply root password and you are running as root
It is very hard to diagnose from a distance. I know nothing about your system, not even if you are running Ubuntu.
My devices were owned by root so I was able to access them no problem
If that does not allow read access to /dev/hidrawN
do ls -l on /dev and look to see who is the owner of the /dev/hidrawN devices and what group has read/write access
That is part of what the udev rules are about, to create consistent device names and allow specific access to devices created on the fly by udev
You may have to create one to easily be able to use them
regards
Please Log in or Create an account to join the conversation.