Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
albert.emil
Posts: 8
Joined: Sat Jul 14, 2018 9:59 pm

Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby albert.emil » Sat Jul 14, 2018 10:24 pm

I am trying to use a 3Dconnexion SpaceNavigator with FreeCAD 0.17 on Fedora 28 64-bit with GNOME (using the FreeCAD-13522.glibc2.17-x86_64.AppImage from GitHub):
OS: "Fedora release 28 (Twenty Eight)"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13522 (Git) AppImage
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
I installed spacenavd as explained in the Wiki. Double-checked if the `spacenavd.service` was running (started it manually since it was not running), connected my SpaceNavigator to the computer and the LED ring lit up.

However, the device is not available in FreeCAD's Customize dialog, which just shows:
No Spaceball Present
The device itself is registered to the system since it is listed by lsusb

Code: Select all

$ lsusb
# some other devices
Bus 002 Device 003: ID 046d:c626 Logitech, Inc. 3Dconnexion Space Navigator 3D Mouse
# some other devices
and can be used for 3D navigation in Blender. As a first fix I tried the suggested

Code: Select all

$ sudo xhost +
access control disabled, clients can connect from any host
$ sudo systemctl restart spacenavd.service
which does not result in any different behaviour. Since the problem might be related to spacenavd I started FreeCADd with the --write-log option and got a first hint:

Code: Select all

# some other log messages
Log: Couldn't connect to spacenav daemon
# some other log messages
So I needed to make sure that the deamon is indeed running

Code: Select all

$ sudo systemctl status spacenavd.service
● spacenavd.service - 3Dconnexion Input Devices Userspace Driver
   Loaded: loaded (/usr/lib/systemd/system/spacenavd.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-07-14 23:01:52 CEST; 40min ago
 Main PID: 5438 (spacenavd)
    Tasks: 1 (limit: 4700)
   Memory: 720.0K
   CGroup: /system.slice/spacenavd.service
           └─5438 /usr/bin/spacenavd

Jul 14 23:01:52 localhost.localdomain systemd[1]: Starting 3Dconnexion Input Devices Userspace Driver...
Jul 14 23:01:52 localhost.localdomain systemd[1]: spacenavd.service: Can't open PID file /var/run/spnavd.pid (yet?) after start: No such file or directory
Jul 14 23:01:52 localhost.localdomain systemd[1]: Started 3Dconnexion Input Devices Userspace Driver.
According to this output, the deamon (or at least its service) is running. The needed /var/run/spnavd.pid is created/available and owned by user root.

Despite Blender using a socket connection to spacenavd (which is working), FreeCAD uses the X11-bindings. I did some further search on this topic online and came up with this thread. So I tryied to start the X11-events manually:

Code: Select all

$ spnavd_ctl x11 start
You must have an X server running before starting up spacenavd-X11 events.
Due to error message raised by this command, I wondered whether I am using Wayland or X11 as desktop server. Executing

Code: Select all

$ loginctl show-session 3 -p Type
Type=x11
shows that I am running an X11 session, but the dirty trick, namely copying .Xauthority to root's home directory by

Code: Select all

$ cp ~/.Xauthority /root/
does not make sense since

Code: Select all

$ ll -lha
is not listing such a file inside the user's home directory.

Another FreeCAD/Fedora user had the same issue and posted it to the Fedoraforum, but was not able to get any advice either.

How could we either solve this issue or narrow it down at least? I am still not sure whether this issue is a problem of Fedora, spacenavd or FreeCAD 0.17. Unfortunately, I could not test this on other, non-Fedora systems. It would be nice if someone else might be able to test this on e.g. Debian-based systems or try to reproduce this issue on another Fedora-based system.

Any hint is very much appreciated as I am currently switching to Fedora as my production machine. Thanks in advance.

Regards,
Albert
chrisb
Posts: 17489
Joined: Tue Mar 17, 2015 9:14 am

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby chrisb » Sat Jul 14, 2018 11:06 pm

Hi Albert, welcome to the FreeCAD forum.
Have you tried running FreeCAD as root?
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby NormandC » Sat Jul 14, 2018 11:33 pm

This may be an AppImage problem too...

Can't you install FreeCAD v0.17 from a Fedora repo?

https://forum.freecadweb.org/viewtopic. ... 80#p236139
albert.emil
Posts: 8
Joined: Sat Jul 14, 2018 9:59 pm

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby albert.emil » Sun Jul 15, 2018 6:16 am

NormandC wrote:
Sat Jul 14, 2018 11:33 pm
This may be an AppImage problem too...

Can't you install FreeCAD v0.17 from a Fedora repo?

https://forum.freecadweb.org/viewtopic. ... 80#p236139
I added the nighly repo from copr to the system packages and installed FreeCAD 0.18_pre (did not find out how to install 0.17). My SpaceNavigator does not show up in the Customize dialog in this version either.

chrisb wrote:
Sat Jul 14, 2018 11:06 pm
Have you tried running FreeCAD as root?
Running both the AppImage of 0.17 as well as the nightly version of 0.18_pre from copr as root by calling

Code: Select all

# for 0.18_pre from copr
sudo FreeCad		

# for 0.17 AppImage from GitHub							
sudo ./FreeCAD-13522.glibc2.17-x86_64.AppImage 		
does not change the problem. SpaceNavigator still not available.
User avatar
bejant
Posts: 5803
Joined: Thu Jul 11, 2013 3:06 pm

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby bejant » Sun Jul 15, 2018 1:24 pm

albert.emil wrote:
Sat Jul 14, 2018 10:24 pm
How could we either solve this issue or narrow it down at least? I am still not sure whether this issue is a problem of Fedora, spacenavd or FreeCAD 0.17. Unfortunately, I could not test this on other, non-Fedora systems. It would be nice if someone else might be able to test this on e.g. Debian-based systems or try to reproduce this issue on another Fedora-based system.
Hi Albert, and welcome. I'm using Ubuntu and (although it didn't work for you) I have to do this before my old USB Spaceball will work in FreeCAD:
albert.emil wrote:
Sat Jul 14, 2018 10:24 pm
As a first fix I tried the suggested

Code: Select all

$ sudo xhost +
access control disabled, clients can connect from any host
$ sudo systemctl restart spacenavd.service
Which also means that If I want to use my Spaceball I have to be using FreeCAD as a sudoer user, which I don't like doing. You know more about linux than I do, so I'm hoping that once you find the fix, it will work for me too.

OS: Ubuntu 16.04.4 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.13522 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)


OS: Ubuntu 16.04.4 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.18.14078 (Git)
Build type: None
Branch: master
Hash: be5e93ddfe29d49a4b1c02e7119b1f926549ccce
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
User avatar
bejant
Posts: 5803
Joined: Thu Jul 11, 2013 3:06 pm

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby bejant » Sun Jul 15, 2018 1:31 pm

albert.emil wrote:
Sat Jul 14, 2018 10:24 pm
Another FreeCAD/Fedora user had the same issue and posted it to the Fedoraforum,
This forum has a user of the same name; probably the same person... FWIW...
User avatar
tanderson69
Posts: 1495
Joined: Thu Feb 18, 2010 1:07 am

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby tanderson69 » Sun Jul 15, 2018 2:04 pm

Spacenavd can be compiled to enable or disable options, x11 being one of them(see bottom). Is there anyway you can check the build logs and verify that x11 was NOT disabled?



Another thing to look at:
When you build libspnav from source there are 2 example/test programs. One of them is called 'simple_x11'. If you can get your hands on that from your package manager, that will narrow the problem down to either spacenavd or freecad.



Code: Select all

	--help)
		echo 'usage: ./configure [options]'
		echo 'options:'
		echo '  --prefix=<path>: installation path (default: /usr/local)'
		echo '  --enable-x11: enable X11 communication mode (default)'
		echo '  --disable-x11: disable X11 communication mode'
		echo '  --enable-hotplug: enable hotplug using NETLINK_KOBJECT_UEVENT (default)'
		echo '  --disable-hotplug: disable hotplug, fallback to polling for the device'
		echo '  --enable-opt: enable speed optimizations (default)'
		echo '  --disable-opt: disable speed optimizations'
		echo '  --enable-debug: include debugging symbols (default)'
		echo '  --disable-debug: do not include debugging symbols'
		echo 'all invalid options are silently ignored'
		exit 0
		;;




Edit: ok, it looks like they didn't disable x11: https://koji.fedoraproject.org/koji/bui ... ID=1041450.

Code: Select all

configuring spacenavd - 0.6
  prefix: /usr
  optimize for speed: yes
  include debugging symbols: yes
  x11 communication method: yes
  use hotplug: yes


ok,package 'libspnav-develop' has some references to 'simple', but it is part of the documentation and is not compiled. I think you could just copy that folder to a temp folder and run 'make' in a terminal and build the 'simple_x11' example/test. https://koji.fedoraproject.org/koji/rpm ... D=12850455

Keep in mind that I am completely fedora ignorant.
User avatar
tanderson69
Posts: 1495
Joined: Thu Feb 18, 2010 1:07 am

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby tanderson69 » Mon Jul 16, 2018 4:18 pm

albert.emil wrote:
Sat Jul 14, 2018 10:24 pm
ping
see previous post.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby NormandC » Mon Jul 16, 2018 4:37 pm

bejant wrote:
Sun Jul 15, 2018 1:31 pm
This forum has a user of the same name; probably the same person... FWIW...
Most assuredly the same person, with such a distinctive nick.

PrzemoF used to package FreeCAD for fedora (as shown in the topic I linked above), so he must know his stuff - he says that the problem is with FreeCAD. I doubt he's using the AppImage so that can probably be ruled out.

PrzemoF wrote:ping
User avatar
PrzemoF
Posts: 2618
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Postby PrzemoF » Mon Jul 16, 2018 5:43 pm

I don't use AppImage. There is possible wayland-x11 problem or the spacenavigator was not compiled in FreeCAD. Anyone has spacenavihator working properly? That would be a good starting point.