3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Having trouble installing or compiling FreeCAD? Get help here.
Brane212
Posts: 11
Joined: Sun Apr 03, 2016 10:05 pm

3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby Brane212 » Sun Apr 03, 2016 10:38 pm

As I said, I have problems with SpaceNavigator.

FreeCAD simply does not recognise it ( Tools-3d_mouse_movement&buttons)

I have it compiled from git-repo on Gentoo (freecad-9999).

Device itself is recognised by the system as the moment I plug it in, i get /dev/input/spacenavigator, which i can "cat" and see the traffic if i touch the wheel.
I can do also this with "evtest /dev/input/spacenavigator", which reports:
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc626 version 0x111
Input device name: "3Dconnexion SpaceNavigator"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 256 (BTN_0)
Event code 257 (BTN_1)
Event type 2 (EV_REL)
Event code 0 (REL_X)
Event code 1 (REL_Y)
Event code 2 (REL_Z)
Event code 3 (REL_RX)
Event code 4 (REL_RY)
Event code 5 (REL_RZ)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Event type 17 (EV_LED)
Event code 8 (LED_MISC)
Properties:
Testing ... (interrupt to exit)
Event: time 1459721895.049482, type 2 (EV_REL), code 0 (REL_X), value -5
Event: time 1459721895.049482, -------------- SYN_REPORT ------------
Event: time 1459721895.065483, type 2 (EV_REL), code 0 (REL_X), value -258
Event: time 1459721895.065483, type 2 (EV_REL), code 1 (REL_Y), value -154
Event: time 1459721895.065483, type 2 (EV_REL), code 2 (REL_Z), value 111
...
I also installed spacenavd and libspnav.

When started, spacenavd reports device etc. I also do "spnav_ctl x11 start" after that and it reports
signalled spacenavd, it should now start sending X events.
I use systemd service to start spacenavd. At start its blue LED turns ON, so communication with daemon seems to be fine.

spnavcfg works fine ( when spacenavd runs). It starts, finds device, I can ping it, turn LED ON/OFF etc.

But FreeCAD never sees the device.

Is there any way I can check if its daemon's fault ( "cat" its output socket perhaps etc).
Or is there something to check in FreeCAD's config ?

I use Gentoo Linux with portage's unchanged ebiuld for freecad-9999. Latest installation is quite fresh ( yesterday, I think)
Under "About the Program", it reports:
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6686 (Git)
Build type: Release
Branch: master
Hash: 7052fde4deef0dbc228751b971ae0d306c46f4c1
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1
Last edited by Brane212 on Mon Apr 04, 2016 9:37 am, edited 1 time in total.
User avatar
tanderson69
Posts: 1500
Joined: Thu Feb 18, 2010 1:07 am

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby tanderson69 » Mon Apr 04, 2016 1:04 am

start freecad in the terminal with the following command

Code: Select all

freecad -l
Then close FreeCAD. That will generate the log file: YOUR_HOME/.FreeCAD/FreeCAD.log. Open up the log file and search for 'spacenav'. This should tell us if FreeCAD is connecting to the spacenav daemon or not. Here is an excerpt from my log file:

Code: Select all

...
Log: Show main window
Log: Toolbars restored
Log: Connected to spacenav daemon
Log: Init: Entering event loop
Log: Init: Processing command line files
...
Brane212
Posts: 11
Joined: Sun Apr 03, 2016 10:05 pm

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby Brane212 » Mon Apr 04, 2016 9:33 am

I just did that. spacenav is nowhere to be seen/grepped.
That part you listed looks like this here:
Log: Show main window
Log: Toolbars restored
Log: Init: Entering event loop
Log: Init: Processing command line files
...
FIle is not long, but I didn't want to crap on so many eyeballs here, so I attached it instead of quoting it.
Attachments
FreeCAD.log
FreeCAD -l log_file
(9.74 KiB) Downloaded 30 times
Brane212
Posts: 11
Joined: Sun Apr 03, 2016 10:05 pm

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby Brane212 » Mon Apr 04, 2016 11:45 am

Hmm.

I,ve just copied libspnav sources ( svn repo) from http://spacenav.sourceforge.net, compiled their "cube" example and it works without a hitch !

So, it seems like the culprit is within FreeCAD...
jmaustpc
Posts: 9566
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby jmaustpc » Mon Apr 04, 2016 12:25 pm

Brane212 wrote:FIle is not long, but I didn't want to crap on so many eyeballs here, so I attached it instead of quoting it.
another often more convenient to read method to display thing like that is by using the "code" button, then it is displayed in a small scrollable box. :)
Brane212
Posts: 11
Joined: Sun Apr 03, 2016 10:05 pm

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby Brane212 » Mon Apr 04, 2016 1:52 pm

I think I found part of the reason.

I thought that spacenavd depends on libspnav, so since I had it installed prior freecad install.

Only later did I find that libspnav is needed by clients, not server. I've installed it, but it seems that that was too late for freecad as it seems freecad installer needs to know about libspnav presence in order to compile-in support, whatever that means ( linking it in or dlopening at run-time etc).

So, I've tried to recompile FreeCAD, but not compile itself fails with:
make[2]: *** No rule to make target '/usr/lib64/libspnav.so', needed by 'lib/libFreeCADGui.so'. Stop.
I've checked libspnav package files and I do have:
/usr/lib64/libspnav.so
/usr/lib64/libspnav.so.0.1
where stat /usr/lib64/libspnav.so shows:
usr/lib64/libspnav.so« -> »libspnav.so.0
User avatar
bejant
Posts: 5947
Joined: Thu Jul 11, 2013 3:06 pm

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby bejant » Mon Apr 04, 2016 2:57 pm

Before starting FreeCAD, I have to run this in the terminal for my Spaceball to work with FreeCAD:

Code: Select all

sudo /etc/init.d/spacenavd restart
OS: Ubuntu 14.04.4 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.6674 (Git)
Build type: None
Branch: master
Hash: 0e45008f9aa8ebf5b6b9f2cdab5cf94b6ef602b5
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Brane212
Posts: 11
Joined: Sun Apr 03, 2016 10:05 pm

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby Brane212 » Mon Apr 04, 2016 3:24 pm

YES! It works now.

It was combo of several mistakes:

1. I should have libspnav installed before freecad installation

2. I copied existing libspnav-0.2.2 Gentoo ebuild for libspnam-0.2.3. Ebuild worked with 0.2.2, but with 0.2.3 it borked library simlinks, since none pointed at library so file. After correcting that, freecad-9999 build succeeds and program itself shows the device.

Interesting thing is that "cube" demo works even with borked libnavsp symlinks and even when "ldd cube" shows no libnavsp dependency.

But with symlinks corrected, "make cube" produces executable that has libspnav dependency, but works the same- fine...
Brane212
Posts: 11
Joined: Sun Apr 03, 2016 10:05 pm

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby Brane212 » Wed Apr 06, 2016 1:42 pm

bejant wrote:Before starting FreeCAD, I have to run this in the terminal for my Spaceball to work with FreeCAD:

Code: Select all

sudo /etc/init.d/spacenavd restart
OS: Ubuntu 14.04.4 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.6674 (Git)
Build type: None
Branch: master
Hash: 0e45008f9aa8ebf5b6b9f2cdab5cf94b6ef602b5
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
I have Gentoo with systemd instead of initrc infrastructure. It seems that whatever problem you have, it's sensitive to service starttup sequence, so it might differ on other systems. If service fails, systemd will restart it and you will have traces of it in systemd's log file.

But it's nice you mentioned it here, so anyone searching on the forum will have that option to try, too...
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: 3DConnexion Spacenavigator is not recognised in Freecad ( LInux)

Postby NormandC » Thu Apr 07, 2016 12:36 am

systemd has been used in Ubuntu for some time, I'm not sure why the SpaceNavigator deamon is still dependent on init.d. But this stuff is way over my head.