Why can I ping my Speedgoat target and update the software, but the connection from MATLAB fails?

108 views (last 30 days)
I'm using Simulink Real-Time (SLRT) with a Speedgoat target computer. I've successfully done the following:
  1. Migrated the target to the new QNX operating system as explained in this MATLAB Answer.
  2. Configured Windows Defender Firewall to allow traffic between MATLAB and Speedgoat and unblocked ports as explained in this MATLAB Answer.
  3. Updated the target software with the "Update Software" button in SLRT Explorer, or "tg.update" command in MATLAB.
  4. Verified that the target screen is showing the matching version of MATLAB.
  5. Verified that I can ping the Speedgoat target from the Windows Command Prompt.
However, when I try to establish the host-target connection from MATLAB using Connect Buttons or the "tg.connect" command, I get one of the following errors:
Unable to connect to target computer 'TargetPC1': Unable to connect to target computer. Unable to connect to target computer due to possible firewall issue.
Cannot connect to target 'TargetPC1': Cannot connect to target. Cannot connect to target computer due to possible firewall issue.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 11 Jun 2025
Edited: MathWorks Support Team on 4 Feb 2025
If the ping and software update succeed but the connection from MATLAB fails with one of the above errors, it is likely that incoming UDP traffic is blocked. This issue specifically affects ports used by the RTPS/FastDDS protocol. To address this, create a UDP-specific inbound rule in Windows Defender Firewall. Coordinate with your IT team to follow these steps:
 

Option 1: Create Inbound UDP Rule using PowerShell (recommended)

Start Windows PowerShell as an administrator and run the following command:
New-NetFirewallRule -DisplayName "Speedgoat" -Direction Inbound -RemotePort 5505-5507,5510-5512,5515-5517 -Protocol UDP -Action Allow -Profile Any -RemoteAddress <SpeedgoatIPaddress>
Replace <SpeedgoatIPaddress> with your device's IP address (e.g., 192.168.7.1), or use an IP range/subnet if you wish to connect to multiple targets. If you prefer not to specify an IP address, use 'Any' for the -RemoteAddress flag, or omit it entirely.
For more details, refer to Microsoft's documentation: New-NetFirewallRule (NetSecurity) | Microsoft Learn 

Option 2: Create Inbound UDP Rule using Windows Defender Firewall GUI

Alternatively, implement the rule in the Windows Defender Firewall GUI as shown below:
1. Find "Windows Defender Firewall with Advanced Security" by using the Windows search:
2. Create a new custom inbound rule:
3. Allow UDP connections from remote ports 5505-5507, 5510-5512, 5515-5517:
4. Optionally, for enhanced security and to restrict the rule's scope, consider adding the Speedgoat's remote IP address:
5. Ensure that the rule applies to all three network types (Domain, Private, and Public) as illustrated below:

Further Troubleshooting

If the above instructions don't help resolve the communication issues with your Speedgoat hardware, refer to this MATLAB Answer for additional troubleshooting steps:

More Answers (1)

Pablo Romero
Pablo Romero on 8 Jan 2024
Edited: Pablo Romero on 28 Jun 2024
You can also use the following cmdlet in Powershell to configure the firewall accordingly in one single step. Please replace <SpeedgoatIPaddress> with your Speedgoat IP address, for example, 192.168.7.1 or remove that argument completely.
New-NetFirewallRule -DisplayName "Speedgoat" -Direction Inbound -RemotePort 5505-5507,5510-5512,5515-5517 -Protocol UDP -Action Allow -Profile Any -RemoteAddress <SpeedgoatIPaddress>

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!