spaceball again and again 2022

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
zawier
Posts: 10
Joined: Mon May 30, 2022 6:13 pm

spaceball again and again 2022

Post by zawier »

Hi Everyone,
I'm new on that forum as well as in FreeCad world :)

Currently I'm using Garuda Linux (which is based on Arch).
Installed a Freecad on it and wanted to force my 3Dconnexion manipulator work together.
Unfortunatelly Pacman (default package manager) doesn't include spacenavd. That's why tried to install it manually as suggested bellow:

https://wiki.freecadweb.org/3Dconnexion_input_devices

Ewerything go ok until:

Code: Select all

sudo make install
Which returns :

mkdir -p /usr/local/bin
cp spacenavd /usr/local/bin/spacenavd
cp ./spnavd_ctl /usr/local/bin/spnavd_ctl
cd . && ./setup_init --no-install

--- Spacenavd installation complete ---
To have spacenavd start automatically at bootup, you must add an appropriate
init script. Refer to your system's manual for details on how to do that.
An example init script is available in the spacenavd source directory.
If you wish to attempt and install an init script automatically, run ./setup_init
Which is simmilar to an old topic:
pperisin wrote: Sun Mar 11, 2012 8:33 pm here is what I get on half of the wiki process:

Code: Select all

barba@linux-3dil:~/Downloads> ls
libspnav-0.2.2  libspnav-0.2.2.tar.gz  spacenavd-0.5  spacenavd-0.5.tar.gz  spnavcfg-0.2.1  spnavcfg-0.2.1.tar.gz
barba@linux-3dil:~/Downloads> cd spacenavd-0.5/
barba@linux-3dil:~/Downloads/spacenavd-0.5> ls
AUTHORS  Changelog  configure  COPYING  doc  init_script  Makefile.in  README  setup_init  spnavd_ctl  src
barba@linux-3dil:~/Downloads/spacenavd-0.5> ./configure
configuring spacenavd - 0.5
  prefix: /usr/local
  optimize for speed: yes
  include debugging symbols: yes
  x11 communication method: yes
  use hotplug: yes

creating Makefile ...
creating config.h

Done. You can now type make (or gmake) to compile spacenavd.

barba@linux-3dil:~/Downloads/spacenavd-0.5> make
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/client.c -o src/client.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/proto_unix.c -o src/proto_unix.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/proto_x11.c -o src/proto_x11.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/dev_linux.c -o src/dev_linux.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/dev_serial.c -o src/dev_serial.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/cfgfile.c -o src/cfgfile.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/xdetect_linux.c -o src/xdetect_linux.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/event.c -o src/event.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/spnavd.c -o src/spnavd.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/serial/sball.c -o src/serial/sball.o
gcc -pedantic -Wall -g -O3 -fno-strict-aliasing -I./src -c src/serial/sballserial.c -o src/serial/sballserial.o
gcc -o spacenavd src/client.o src/proto_unix.o src/proto_x11.o src/dev_linux.o src/dev_serial.o src/cfgfile.o src/xdetect_linux.o src/event.o src/spnavd.o src/serial/sball.o src/serial/sballserial.o -lX11
barba@linux-3dil:~/Downloads/spacenavd-0.5> sudo make install
root's password:
install -d /usr/local/bin
install -m 755 spacenavd /usr/local/bin/spacenavd
install -m 755 ./spnavd_ctl /usr/local/bin/spnavd_ctl
cd . && ./setup_init --no-install

--- Spacenavd installation complete ---
To have spacenavd start automatically at bootup, you must add an appropriate
init script. Refer to your system's manual for details on how to do that.
An example init script is available in the spacenavd source directory.
If you wish to attempt and install an init script automatically, run ./setup_init

barba@linux-3dil:~/Downloads/spacenavd-0.5> ./setup_init
You're either using a non-standard init or this detection failed.
You'll have to setup your init, to start spacenavd, manually.
barba@linux-3dil:~/Downloads/spacenavd-0.5> sudo ./setup_init
You're either using a non-standard init or this detection failed.
You'll have to setup your init, to start spacenavd, manually.
barba@linux-3dil:~/Downloads/spacenavd-0.5> /etc/init.d/spacenavd start
bash: /etc/init.d/spacenavd: No such file or directory
barba@linux-3dil:~/Downloads/spacenavd-0.5> 
So 10 years after and we have the same problem? Is that correct?
Any idea how to fix that?
Best regards
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: spaceball again

Post by PrzemoF »

Welcome to the FreeCAD forum!

The installation didn't show any problems, so you seem to have it installed. Did you test it outside of FreeCAD? The old post was showing some errors. Your compilation doesn't show any unless you trimmed the output.

That might help you: http://spacenav.sourceforge.net/faq.html
zawier
Posts: 10
Joined: Mon May 30, 2022 6:13 pm

Re: spaceball again

Post by zawier »

Przemo you are right:
PrzemoF wrote: Mon May 30, 2022 7:45 pm you seem to have it installed.

Code: Select all

╭─zawier@zawier in /usr/local/bin🔒 as 🧙 took 623ms
✦ [🔴] × spacenavd -V
spacenavd v1.0
What do you mean by testing outside?
No I haven't trimmed shell output, that's it.
Somehow my spacenav isn't added to systemctl and here don't know how to enabe it.
Of course I've tried :

Code: Select all

sudo systemctl enable spacenavd
But it doesn't recoginize I'm guessing:

Code: Select all

╭─zawier@zawier in ~/Pobrane/spacenavd-1.0 took 1ms
╰─λ sudo systemctl enable spacenavd
[sudo] hasło użytkownika zawier:
Failed to enable unit: Unit file spacenavd.service does not exist.
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: spaceball again

Post by M4x »

Welcome to the forum! A separate thread would've been more appropriate I think.

Which input device are you using? Your full FreeCAD version information would be nice too, please have a look at https://forum.freecadweb.org/viewtopic.php?f=3&t=2264

spacenavd just released version 1.0 (2022-04-01) and they've changed a lot! Please remove your current version using your packet manager and install the 1.0 version manually.

You'll need spacenavd, libnavd and optionally spnavcfg (haven't used the later yet but I had a brief look at it yesterday and I'm definitely going to install that one!)

spacenavd
https://github.com/FreeSpacenav/spacenavd
https://github.com/FreeSpacenav/spacenavd/releases

libnav
https://github.com/FreeSpacenav/libspnav/
https://github.com/FreeSpacenav/libspnav/releases

spnavcfg
https://github.com/FreeSpacenav/spnavcfg/
https://github.com/FreeSpacenav/spnavcfg/releases

After you've installed everything, make sure the input device is working by using one of the examples provided by libnav:
If you're not sure if spacenavd is set up correctly and works with your device, a good first step is to try and run the "simple" example program which comes with libspnav. It builds into two variants: simple_af_unix and simple_x11, which is helpful for testing both supported communication protocols. If either or both fail to work, there's something wrong with your setup.
https://github.com/FreeSpacenav/spacena ... leshooting

Thank you!

edit:
While I've written my reply, @zawier made another post. Which version are you using? From your first post I thought it was something like 0.5. Now I'm seeing 1.0. Please make sure that only one version is installed and make clear what you've done and what you've tested so far.
zawier
Posts: 10
Joined: Mon May 30, 2022 6:13 pm

Re: spaceball again

Post by zawier »

Hi M4x!
So lets start from top of your list:
M4x wrote: Mon May 30, 2022 8:05 pm Which input device are you using?
Exactly that one: https://3dconnexion.com/us/product/spacemouse-compact/

FreeCAD info :

OS: Garuda Linux (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24415 (Git)
Build type: Release
Branch: makepkg
Hash: 476ecf091941bead59b14e44afa6064d5a66afa3
Python version: 3.10.4
Qt version: 5.15.3
Coin version: 4.0.1
OCC version: 7.5.3
Locale: Polish/Poland (pl_PL)
M4x wrote: Mon May 30, 2022 8:05 pm spacenavd just released version 1.0
Yeap, exactly that version I compilled on my station.
M4x wrote: Mon May 30, 2022 8:05 pm You'll need spacenavd, libnavd
Got it:

Code: Select all

╭─zawier@zawier in /usr/local/bin🔒 as 🧙 took 623ms
✦ [🔴] × spacenavd -V
spacenavd v1.0

╭─zawier@zawier in /usr/local/bin🔒 took 6ms
✦  ╰─λ pacman -Q libspnav
libspnav 1.0-1
M4x wrote: Mon May 30, 2022 8:05 pmspnavcfg
a such lib doesn't exists in arch repossitory .
M4x wrote: Mon May 30, 2022 8:05 pmPlease make sure that only one version is installed and make clear what you've done and what you've tested so far.
Yeap, I'm sure I have only one version of spacenavd installed.
What I have done so far? Not much I guess: checked systemclt service (failed), checked whether FreeCad see device (failed), checked if computer recognize my device (correct). What's more installed libs which you mentioned, except spnavcfg which in my case seams to be not needed (where I don't have planty of additional buttons).

Interesting thing is fact that long time ago (a few months) I succesfully installed spacenavd + libs and it was working out of the box. Right now I faced problems and that's why I've decived to ask for yours help.

M4x wrote: Mon May 30, 2022 8:05 pm simple_af_unix and simple_x11,
Ok, how to fired it up? :) I'd like to test it.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: spaceball again

Post by PrzemoF »

"Also make sure to check out the example programs which come with libspnav: simple, cube, fly"

Look for them in the compiled code.

http://spacenav.sourceforge.net/
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: spaceball again

Post by M4x »

Thank you for making use of the quote-function ;)
zawier wrote: Mon May 30, 2022 8:17 pm
M4x wrote: Mon May 30, 2022 8:05 pm Which input device are you using?
Exactly that one: https://3dconnexion.com/us/product/spacemouse-compact/
Great, this is going to work.
zawier wrote: Mon May 30, 2022 8:17 pm FreeCAD info :
Perfect, thanks.
zawier wrote: Mon May 30, 2022 8:17 pm
M4x wrote: Mon May 30, 2022 8:05 pmspnavcfg
a such lib doesn't exists in arch repossitory .
Like I've said, it's optional. But I think it's very valuable to adjust settings regarding the axis and overall behavior for example. You can use the config file too of course. I've posted the GitHub link previously.

Please try these examples from libnav:
  • simple_af_unix (test button input)
  • cube (test "joystick" input)

Code: Select all

    Download the latest libspnav release from https://github.com/FreeSpacenav/libspnav/releases extract it somewhere, and change into that directory.
    run ./configure and then make in the libspnav directory to build libspnav
    change into the examples/simple directory, and run make to build the example program.
    finally run ./simple_af_unix
https://github.com/FreeSpacenav/spacena ... tton-names

It's the same for cube. Cube can be found in the folder cube instead of simple.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: spaceball again and again 2022

Post by wmayer »

zawier wrote: Mon May 30, 2022 6:30 pm Installed a Freecad on it and wanted to force my 3Dconnexion manipulator work together.
Does your FreeCAD installation link to the spacenav library as otherwise it's pointless. The best way to check this is by running

Code: Select all

FreeCAD --log-file /tmp/freecad.log
and close it immediately again. Then open the file /tmp/freecad.log and search for the messages

Code: Select all

Connected to spacenav daemon
or

Code: Select all

Couldn't connect to spacenav daemon. Please ignore if you don't have a spacemouse.
If none of them appears then your FreeCAD build doesn't link the spacenav library. If the former message appears then it basically works and for the latter message there is probably a problem with the spacenav daemon.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: spaceball again and again 2022

Post by Kunda1 »

wmayer wrote: Tue May 31, 2022 8:43 am Couldn't connect to spacenav daemon. Please ignore if you don't have a spacemouse.
IIRC this wasn't backportrdnto 0.19 right? All the up-to-date spacemouse improvements are in v0.20dev
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: spaceball again and again 2022

Post by wmayer »

Kunda1 wrote: Tue May 31, 2022 10:38 am IIRC this wasn't backportrdnto 0.19 right? All the up-to-date spacemouse improvements are in v0.20dev
It is also part of v0.19: https://github.com/FreeCAD/FreeCAD/blob ... ux.cpp#L51
Post Reply