You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Why this error is occuring while deploying in ROS2?
5 views (last 30 days)
Show older comments
Hey all, I am trying to deploy in a ROS2 device from Simulink. I keep facing this error. FYI, the device being deployed in is Intel Nuc. It is being deployed through Wi-Fi. I also deployed in another ROS2 machine without any error therefore the Simulink model has no error by design. Please don't hesitate to ask for further information. Glad to provide to solve the issue.

11 Comments
Jagadeesh Konakalla
on 25 Mar 2025
From the error, looks like you are using external mode. Is that correct ? Or you just wanted to build and deploy ?
I suggest you to use Local Host Workflow and use Generate Code only option. You can see tar file in the folder where the simulink model is present. You can copy this tar file to Intel Nuc where the ROS 2 installation is available. Then you can untar and perfrom colcon build and run the executable node. Let me know if this works or not.
Also, you mentioned that it worked on other ROS 2 machine. What is the opertaing system of ROS2 machine that is working ? How is that connected to your Host machine ?
Ahmed
on 25 Mar 2025
Hey there, thanks for reaching out.
Yes, you're right. I'm using external mode.
But I need to tune variables real time when being deployed, that's the goal and that's why I'm using external mode. I change the variables by using the knob block in the library. Will copying and performing colcon build let me do that?
The other ROS2 machine is a laptop that has Ubuntu 22 and ROS2 Humble and connected by Wi-Fi. Just like the Intel Nuc where I'm trying to deploy. I tested the Simulink model several times there before trying to deploy on the Nuc. Everything seems to remain same, that's why I can't seem to figure out what's going wrong.
Jagadeesh Konakalla
on 25 Mar 2025
We designed ROS 2 deployment workflow considering that Remote target is Linux machine with ROS 2 installed. I guess that may be the reason for failure.
- Are you able to do to Build and Run workflow on the Intel Nuc ?
- If so, in the Target Harware Resource, can you ensure that Device vendor and Device type Set correctly ?
Thanks,
JagadeeshK
Ahmed
on 25 Mar 2025
But the remote target is a Linux machine with ROS2.
- Build and run as in using generate code? Used generate code once. Transfered the src file that was produced to the ros workspace in the Nuc and then used colcon build. It had a problem but was solved and worked fine. However I'm interested in external mode for reasons stated earlier. I need to change variable real time.
- I think so, Device vendor set as Intel and Device type as x86-64(Linux 64). Earlier when I tested on the laptop, Device type was x86-64(Windows 64). It work fine. I tested on Nuc before setting to Linux.
Jagadeesh Konakalla
on 25 Mar 2025
I understand that you are interested in ROS 2 external mode. You should be able to do if the Remote machine is linux.
Do you see any wi-fi configurations are different than the one working before ?
From the external mode error that you shared, it could be issue with connection only.
When you run simple program on the Intel Nuc, do you those nodes and topics in the Host MATLAB ? If so, looks like setup is good. Also verify that whether the two communication works, i.e publish from Host MATLAB and verify that remote Intel Nuc can see those nodes and topics and vice versa.
Ahmed
on 25 Mar 2025
Edited: Ahmed
on 25 Mar 2025
Wi-fi configurations are same as the laptop I tested on. I tested with different network as well like the hotspot of a mobile. Result from Testing connection is positive. I should add, the port on the Nuc was not the default port 22. that's why connection test failed. But it was changed to port 22 later and since then connection test was positive
Is connection seems to be the issue because of that line in diagnostics that says "Attempting to establish connection with hostname '10.55.3.116' through port 17725" ?
Actually, running program on the Nuc from MATLAB/ Simulink has never been attempted before to my knowledge. That's what I have been trying to verify, the publishing/ subscribing between host simulink and Nuc and that's where I keep facing the error that I mentioned in the beginning. I haven't tried subscribing to Nuc yet, only tried publishing so far. I expected it to work as it worked on a laptop. The laptop and the Nuc aren't that different right?
Here's the model I'm trying to deploy on the Nuc.

I tested build and run and it works fine.
Anything else that I should check?
Jagadeesh Konakalla
on 25 Mar 2025
The external mode tries make connection to the target machine on the default Port 17725. Is there any issue on the Port 17725 ? You can change to other Port. Also, can you enable Verbose and provide the error snapshot.

Ahmed
on 25 Mar 2025
Here's the error snapshot

Didn't face any issue with port 17725 when deployed on laptop. Can you suggest how I should check if there's any issue? And how can I change the port? Simply type there a random number in place of 17725?
Abhishek
on 26 Mar 2025
Yes, try providing a different values in the 'Port' edit field in place of 17725. If this does not resolve the issue, enable the 'Verbose' option and provide the detailed error log.
Additionally, ensure that Simulink has the necessary access to initiate the process by verifying that the user has root privileges. You may create a dummy user with root access to determine if the issue is related to insufficient permissions. For reference on setting up a root user, refer to this MATLAB answer.
Ahmed
on 28 Mar 2025
Hi there, I've tried as instructed. I changed the port number to 65535. Verbose was also enabled. It works on the laptop but the error still persists on the Nuc even after providing a different value in the 'Port' field. Here's the detailed error log. Is that what you were talking about or is it a different thing?

As for the root priveleges, during connection test in the diagnostics, it showed that user has administrative privileges. Is it not indicative of that?
Ahmed
on 2 Apr 2025
Hi, I tried the way you suggested for the root access. I followed the steps showed on the link you shared. However, the problem that is occurring is during the testing connection it cannot connect due to wrong name or password as it shows on the diagnostics. Also, I think simulink can't find ROS workspace.
Accepted Answer
Ahmed
on 5 Apr 2025
Edited: Ahmed
on 22 Apr 2025
The issue has been solved. The problem was the firewall. It was activated in the Nuc therefore causing hamper in communication between the Nuc and Simulink therefore causing hindrance in external mod. In my opinion, if firewall could cause such a hindrance in external mode then it should have been discerned during the connection testing phase, during which no such an issue was discovered. I hope developers will keep that under consideration for future versions.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)