Arduino Leonardo and linears encoders.

More
30 Jan 2013 03:02 #29279 by andypugh

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.
The following user(s) said Thank You: casetero

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

More
30 Jan 2013 16:41 #29297 by casetero
Ok i have modify it, now...

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.

More
30 Jan 2013 17:06 #29298 by casetero
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

And it would make an executable file in the same directory??

Thank you.

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

More
30 Jan 2013 17:46 - 30 Jan 2013 17:53 #29299 by ArcEye

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
Last edit: 30 Jan 2013 17:53 by ArcEye.
The following user(s) said Thank You: casetero

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

More
30 Jan 2013 17:53 #29300 by andypugh

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)
The following user(s) said Thank You: casetero

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

More
31 Jan 2013 00:49 #29321 by casetero
Sorry i have been busy and couldn´t do it.

I´m going to try the compilation, let´s rock....

Thank you!

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

More
31 Jan 2013 02:21 #29324 by casetero
Ok, it is done. i think it is been succesfull, but now when i put loadusr in a terminal it shows this:

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.

More
31 Jan 2013 03:25 - 31 Jan 2013 03:35 #29332 by ArcEye

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
Last edit: 31 Jan 2013 03:35 by ArcEye. Reason: add info
The following user(s) said Thank You: casetero

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

More
31 Jan 2013 18:59 #29356 by casetero
Hi again,

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.

More
31 Jan 2013 19:39 #29362 by ArcEye
The sequence I would use is
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
The following user(s) said Thank You: casetero

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

Time to create page: 0.186 seconds
Powered by Kunena Forum