Polhemus Patriot No Longer Detected by Brainstorm

Hello,

I’m experiencing another issue with my Polhemus Patriot system. It was previously working, but it suddenly stopped being recognized by Brainstorm.

Here’s what I’ve tried so far:

  • The COM port is still visible in PuTTY, and when I press "P", I can see coordinate data being streamed.
  • I also tested the connection in MATLAB using the serial port interface. When I click the stylus button, the number of bytes available increases, so data is clearly being sent.
  • However, when I go to **Brainstorm > Digitize and then enter Global Digitize, no serial port is detected or selected, and there’s no error message indicating that something is wrong.

It seems that Brainstorm is not recognizing the serial port, even though the device is clearly communicating.

Any ideas on what might be causing this or how to fix it?

Thanks in advance!

Some basic troubleshooting (apologies if you have already done this):

  1. Verify the Digitize settings File > Edit settings

  2. Check that the port name is the correct. You may want to check that there are not empty spaces, 0 instead of O, or other typos.

  3. Make sure that the port is not being used by any other software. E.g. the port is open in PuTTY, or in the same Matlab.

  4. Is this connection issue fixed by reverting the change on the end lines in commit ff3ae10?

Hello Raymundo,

Thank you for the suggestions and help. I’ve double-checked all the troubleshooting steps you mentioned, and it is still not working. I've attached screenshots to show that data is being received properly when using other tools. This seems to confirm that the issue is specific to Brainstorm. Also, reverting the end line changes in commit ff3ae10 did not resolve the issue.

Please let me know if there’s anything else I should try.

Best,
Maxime



Let me add a few thoughts here:

Since you were able to see the Digitize panel, I believe this confirms that Brainstorm was able to detect the serial connection.
(can you try to use the legacy version, and see if you can see same thing?)

However, without access to the device, it’s a bit challenging to debug this issue thoroughly. I suggest adding breakpoints to inspect what’s happening within the panel_digitize_2024 function.

In particular, try setting breakpoints at the following function and try to go step by steps:

  • Line 1409: CreateSerialConnection
  • Line 1515: BytesAvailable_Callback

This should help you trace the flow and identify where things might be going wrong.

A few more ideas:

Is it possible someone turned on the simulation? You could see it in Digitize.Options.isSimulate. What happens if you click collect point in the panel?

@Raymundo.Cassani Maybe we should have a warning issued when simulation is on, each time we go through the CreateSerialConnection function.

Since the behaviour changed, the first question that comes to mind is: what changed that caused this? Did you upgrade any hardware, software, OS?

You probably tried this already, but did you try rebooting and trying again without using the port with any other tool first?

But other than that, it would indeed be a matter of stepping through the code as it executes (with breakpoints) to see where it doesn’t work, as @tmedani suggested.

Other potential workaround: do you have another computer or laptop you can try?

1 Like

Thanks everyone for the suggestions. For now, I just downloaded everything onto another laptop and everything works fine there, so at least I can keep going while I troubleshoot the original issue. I had already tried a bunch of things. What’s strange is that even when the Polhemus isn’t plugged in, the interface doesn’t show any error about a missing connection. I’ll try running the script step by step to see where it fails.

I didn’t do any updates on the original computer. It doesn’t have internet access, so nothing should have changed on that end. One thing I do remember is that I accidentally clicked on 3D scanner just before the issue started. I’ll also double check whether the simulation is turned on in Digitize.Options.isSimulate. Will keep you posted if I figure out what’s causing it.

Thanks again for your help!

Quick update: I just checked the simulation setting and it might actually be the issue. I ran Digitize.Options.isSimulate and it returned 1, so simulation mode is on. Do you know how I can turn it off? Also, any idea how I might have turned it on by accident? I don’t see that option anywhere in the interface.

You turn it off as:

panel_digitize_2024('SetSimulate', 0);

It was indeed the problem. Everything works well now. Thank you so much!

FYI: I also tried clicking on the 3D scanner option again, and that seems to automatically set isSimulate to 1.

Yes, we just realized that is how you got there.

This bug is now fixed. Commit 0bf7f3d
FYI @chinmay.chinara

This warning is now present. Commit 2c4fde7.
If the Digitizer is used and Simulation is ON, the user is asked if they want to turn it OFF and continue.

4 Likes