SpaceBall 4000 + USB serial + 3dxWare 10

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
arpruss
Posts: 29
Joined: Tue Aug 21, 2018 7:50 am

SpaceBall 4000 + USB serial + 3dxWare 10

Post by arpruss » Wed Aug 29, 2018 7:04 am

I have found a way of using the SpaceBall 4000 with the latest 3dxware drivers, using only one piece of additional hardware, a serial to USB converter. I've tested this on Windows 10.

It's not simple. It uses the USB/IP project to create an emulated SpacePilot Pro that receives its data from the SpaceBall via a python script. (Except that the SpaceBall only has 13 buttons, instead of the 15 of the SpacePilot, and there are no LEDs.)

Step 1: Install the USB/IP driver.

Unfortunately, currently the USB/IP project's last signed Windows driver release has a buggy driver that causes a blue screen crash whenever a device is disconnected (including when you log out or reboot with a device running). But it is a signed driver, which makes this much more convenient to install. If you can live with the limitations and use the signed USB/IP driver, download it from here: https://sourceforge.net/projects/usbip/ ... p_windows/

If you want to use the unsigned USB/IP driver, download it from here: https://sourceforge.net/p/usbip/discuss ... /86c5e473/ . You'll need to put your Win 8/10 system in TESTSIGNING mode, which may also require turning off secure boot on your device. I am using the unsigned driver.

Unzip the zip file. Start the device manager on Windows (e.g., type devmgmt.msc into the Windows search bar). Go to Action | Add legacy hardware | Next | Install ... manually select | Next | Show all devices | Next | Have Disk | Browse. Then find your USBIPEnum.inf and choose Open.

Step 2: Make sure you have Python 2.7 installed and in your path. https://www.python.org/downloads/

Step 3: Install the PySerial package:

Code: Select all

python -m pip install pyserial
Step 4: Install the contents of https://github.com/arpruss/USB-Emulation in a directory that also contains your USB/IP files. If you are using the old signed USB/IP driver, edit USBIP.py and change USBIP_VERSION = 273 to USBIP_VERSION = 262 near the top.

Step 5: Plug in your SpaceBall 4000 via the serial adapter. It should beep twice.

Step 6: Identify its serial port, e.g., COM26. You can do that with the device manager or by running

Code: Select all

python 3d.py -l
in the directory containing my scripts.

Step 7: Install 3dxware 10.

Step 8: Start up the SpaceBall emulation driver:

Code: Select all

python 3d.py -pCOMxx
where COMxx is the port you found. (You can also use a port description. For instance, by default the script looks for a port named "USB-SERIAL CH340", as that's what I have.)

Press ctrl-c or ctrl-break when you want to exit (but you'll get the BSOD if you're using the signed driver).

My, this is complicated! But it works. It would be simpler if there were a signed USB/IP driver that doesn't crash.

The 3d.py has a few commandline options (to list them: python 3d.py -h). You can set a maximum deviation (might be useful: things get weird if you press too hard with the default settings), you can turn on cubic sensitivity mode, and instead of emulating a SpacePilot Pro, you can emulate a 6-axis HID joystick with lots of buttons for gaming.

jwick
Moderator
Moderator
Posts: 2517
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by jwick » Fri Aug 31, 2018 1:13 am

Wow. Bravo! That was a lot of work.
Now you can extend it for the gaming devices. A few people on here would be interested in that.

arpruss
Posts: 29
Joined: Tue Aug 21, 2018 7:50 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by arpruss » Fri Aug 31, 2018 6:19 am

By the "gaming devices", you mean the SpaceOrb and things like that?

This could run into problems with the 3dxware EULA, which says that 3dxware is specifically for use with 3dconnexion products. If I were to hear from 3dconnexion that they don't mind people using 3dxware with other products, then I would consider doing it.

(The SpaceBall was made by Labtec, but Labtec's 6dof business was acquired by 3dconnexion.)

arpruss
Posts: 29
Joined: Tue Aug 21, 2018 7:50 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by arpruss » Fri Aug 31, 2018 6:24 am

I've made a bunch of improvements.

Now, you don't need to edit USBIP_VERSION in the script: it will auto-detect which version of usbip you're using.

It now works with both Python 2.7 and Python 3.x.

If anyone was put off by having to make a choice between BSOD on disconnect and use of an unsigned driver, the latest version of my python scripts works with the signed driver AND finds a way around the BSOD on disconnect issue.

The script will re-launch itself with admin permission, and then when you exit the script with ctrl-c (do NOT press the Windows window close X button) it will uninstall the device cleanly before it passes control back to the buggy usbip driver, thereby avoiding the BSOD. (Only caveat: if you have 64-bit Windows and want to do it this way, then please make sure the script runs on a 64-bit Python.)

arpruss
Posts: 29
Joined: Tue Aug 21, 2018 7:50 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by arpruss » Fri Aug 31, 2018 11:12 am

Maybe I misunderstood your suggestion. If so, sorry. Maybe all you want for a SpaceOrb is USB HID joystick support, rather than 3dxware support. That would be extremely easy (and 3dxware EULA would be irrelevant), if I had a SpaceOrb for testing. But I don't own one and the device isn't cheap ($50 on ebay, vs. $15 for a SpaceBall 4000). Without an actual SpaceOrb, it could also be done just by looking at the orbduino source code, but I am not very motivated since I don't own the device.

SpaceRob
Posts: 3
Joined: Fri Aug 17, 2018 9:44 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by SpaceRob » Sun Sep 02, 2018 2:09 pm

Hello ArPruss
Unfortunately I don't know much of anything about python or how it works.
I installed pyserial and future, but I get an error upon execution of 3d.py:" from ctypes.wintypes import CHAR | ImportError: cannot import name CHAR

SpaceRob
Posts: 3
Joined: Fri Aug 17, 2018 9:44 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by SpaceRob » Sun Sep 02, 2018 11:16 pm

Ok I made advances, but I received errors. I've tried with a Spaceball 5000 and I'm using an ancient belkin FSU103-MAC usb-serial adapter, so perhaps one or both are at fault. I purchased a cheapo adapter off of eBay also. PS, this has been a fun learning experience, so thanks.

I get:

Opening COM3
Connected('127.0.0.1', 49189)
Header Packet
command:0x8005
list of devices
Error Cannot configure port, something went wrong. Original message: WindowsError(31, 'A device attached to the system is not functioning.')
Opening Com3
Connected('127.0.0.1', 49191)
Header Packet
command: 0x8003
attach device
new usb device attached to usbvbus port 1

Error Cannot configure port, something went wrong. Original message: WindowsError(31, 'A""""...functioning.')

jwick
Moderator
Moderator
Posts: 2517
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by jwick » Mon Sep 03, 2018 6:03 am

arpruss wrote:
Fri Aug 31, 2018 6:19 am
By the "gaming devices", you mean the SpaceOrb and things like that?

This could run into problems with the 3dxware EULA, which says that 3dxware is specifically for use with 3dconnexion products. If I were to hear from 3dconnexion that they don't mind people using 3dxware with other products, then I would consider doing it.

(The SpaceBall was made by Labtec, but Labtec's 6dof business was acquired by 3dconnexion.)
Yes, of course, we would have an issue if you started supporting devices outside of ours. But all 10 SpaceOrb owners out there would be happy. I'd like to see what can be done with games. Since you have skills at the hardware/python/maker level, how about driving some RC vehicles and drones?

arpruss
Posts: 29
Joined: Tue Aug 21, 2018 7:50 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by arpruss » Mon Sep 03, 2018 6:26 am

SpaceRob wrote:
Sun Sep 02, 2018 2:09 pm
Unfortunately I don't know much of anything about python or how it works.
I installed pyserial and future, but I get an error upon execution of 3d.py:" from ctypes.wintypes import CHAR | ImportError: cannot import name CHAR
My bad. For a while yesterday I had up a version that didn't work with Python 2.7. The current version should work on both 2.7 and 3.x. (And it also makes a major change under the hood: it doesn't use TCP/IP any more, so it should be a lot faster.)
SpaceRob wrote:
Sun Sep 02, 2018 11:16 pm
Opening COM3
Connected('127.0.0.1', 49189)
Header Packet
command:0x8005
list of devices
Error Cannot configure port, something went wrong. Original message: WindowsError(31, 'A device attached to the system is not functioning.')
I think this is an error with your USB-to-serial adapter, but it could also be a problem with pyserial. You can try to diagnose it by seeing if you can connect to your SpaceBall with a terminal emulator. Use 9600 8 N 1 parameters. Then press some buttons and see if you can see some packets starting with "K" or with ".".

arpruss
Posts: 29
Joined: Tue Aug 21, 2018 7:50 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by arpruss » Tue Sep 04, 2018 7:21 am

I've made .exe files of my python code, which should greatly simplify installation for non-pythoners. Currently, I am having trouble with the 32-bit version, but the 64-bit version works fine.

Here are new simpler installation instructions:

1. Download the latest signed USB/IP driver. (You get more stability with the unsigned one, but installation is more complex and less secure.)

2. Unzip the zip file somewhere.

3. Start Device Manager: Win-R devmgmt.msc

4. Click on any display line. Starting with the menu, do: Action | Add legacy hardware | Next | Install ... manually select | Next | Show all devices | Next | Have Disk | Browse. Then find your USBIPEnum.inf (from your zip in step 2) and choose Open.

5. Download the correct exe file for your system: 32 bit or 64 bit. Currently the 32-bit version is having some trouble.

6. Plug your SpaceBall into a serial-to-USB adapter. Find out the COM port number of that adapter. (E.g., look in Device Manager under ports, or run 3d -l).

7. Run:

Code: Select all

3d -p COMx
where COMx is your COM port. An admin window will pop up and create an emulated SpaceMouse Pro (in my original post I mistakenly said SpacePilot Pro) which should work with 3dxware. If you want to create a standard six-axis 12-button joystick instead, try:

Code: Select all

3d -p COMx -j -m 700
(The 700 controls the maximum deviation. Games won't work well without that.)

8. To exit, close the window that runs the emulation.

arpruss
Posts: 29
Joined: Tue Aug 21, 2018 7:50 am

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by arpruss » Thu Sep 20, 2018 12:23 pm

I just added SpaceBall 2003/3003 support. To use it, put -M003 on the commandline. Untested (I don't have the device).

Plans for the future:
- Magellan / SpaceBall 5000

backoakum
Posts: 1
Joined: Sat Oct 27, 2018 10:58 pm

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by backoakum » Sat Oct 27, 2018 11:08 pm

arpruss wrote:
Wed Aug 29, 2018 7:04 am
I have found a way of using the SpaceBall 4000 with the latest 3dxware drivers, using only one piece of additional hardware, a serial to USB converter. I've tested this on Windows 10.

It's not simple. It uses the USB/IP project to create an emulated SpacePilot Pro that receives its data from the SpaceBall via a python script. (Except that the SpaceBall only has 13 buttons, instead of the 15 of the SpacePilot, and there are no LEDs.)

Step 1: Install the USB/IP driver.

Unfortunately, currently the USB/IP project's last signed Windows driver release has a buggy driver that causes a blue screen crash whenever a device is disconnected (including when you log out or reboot with a device running). But it is a signed driver, which makes this much more convenient to install. If you can live with the limitations and use the signed USB/IP driver, download it from here: https://sourceforge.net/projects/usbip/ ... p_windows/

If you want to use the unsigned USB/IP driver, download it from here: https://sourceforge.net/p/usbip/discuss ... /86c5e473/ . You'll need to put your Win 8/10 system in TESTSIGNING mode, which may also require turning off secure boot on your device. I am using the unsigned driver.

Unzip the zip file. Start the device manager on Windows (e.g., type devmgmt.msc into the Windows search bar). Go to Action | Add legacy hardware | Next | Install ... manually select | Next | Show all devices | Next | Have Disk | Browse. Then find your USBIPEnum.inf and choose Open.

Step 2: Make sure you have Python 2.7 installed and in your path. https://www.python.org/downloads/

Step 3: Install the PySerial package:

Code: Select all

python -m pip install pyserial
Step 4: Install the contents of https://github.com/arpruss/USB-Emulation in a directory that also contains your USB/IP files. If you are using the old signed USB/IP driver, edit USBIP.py and change USBIP_VERSION = 273 to USBIP_VERSION = 262 near the top.

Step 5: Plug in your SpaceBall 4000 via the serial adapter. It should beep twice.

Step 6: Identify its serial port, e.g., COM26. You can do that with the device manager or by running

Code: Select all

python 3d.py -l
in the directory containing my scripts.

Step 7: Install 3dxware 10.

Step 8: Start up the SpaceBall emulation driver:

Code: Select all

python 3d.py -pCOMxx
where COMxx is the port you found. (You can also use a port description. For instance, by default the script looks for a port named "USB-SERIAL CH340", as that's what I have.)

Press ctrl-c or ctrl-break when you want to exit (but you'll get the BSOD if you're using the signed driver).

My, this is complicated! But it works. It would be simpler if there were a signed USB/IP driver that doesn't crash.

The 3d.py has a few commandline options (to list them: python 3d.py -h). You can set a maximum deviation (might be useful: things get weird if you press too hard with the default settings), you can turn on cubic sensitivity mode, and instead of emulating a SpacePilot Pro, you can emulate a 6-axis HID joystick with lots of buttons for gaming.

Thanks for the link.

epicflunkie
Posts: 2
Joined: Sat Apr 20, 2019 5:33 pm

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by epicflunkie » Sat Apr 20, 2019 6:05 pm

Just want to start by saying thanks for the effort in making this bridge. The SpaceBall is a great piece of hardware, and the prospect of running it with modern software is exciting.

With that being said, I can't seem to get it to work. I've gotten the unsigned driver set up, and I'm running the 64-bit exe on Windows 10. It seems to start off fine, but it gets to "Error Cannot confirm P20" and ends up caught in an infinite loop where it opens the port (two beeps, as expected), initializes the serial connection, and errors out.

I've tried using different USB ports, different RS-232 adapters, and running older versions off your git tree. I've also tried fiddling the the serial settings, but the only one that seems to work at all is 9600 baud, 8 data bits, 1 stop bit, no flow control and no parity.

Would you have any advice on how to proceed?

epicflunkie
Posts: 2
Joined: Sat Apr 20, 2019 5:33 pm

Re: SpaceBall 4000 + USB serial + 3dxWare 10

Post by epicflunkie » Mon Apr 22, 2019 9:05 pm

As an update to the issue I'm encountering, I've tried running the signed version of USB/IP to see if there would be any difference.

Running it directly as an admin results in the same issue as using the unsigned version of USB/IP, wherein it errors out when a P20 packet is sent to it.

Running it unprivileged and allowing it to open an admin command line gets me a little further, but the device is otherwise completely unresponsive.

I can confirm that the SpaceBall itself is not faulty, as it functions on a Windows XP SP3 VM without a hitch.

Post Reply