# ROS 2 Humble – Continue Program Execution After Network Loss

**URL:** <https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517>\
**Category:** ROS General\
**Tags:** humble\
**Created:** [May 3, 2025, 8:30am UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517 "2025-05-03T08:30:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marija\_Golubovic](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/marija_golubovic/32/22881_2.png) [@Marija\_Golubovic](https://discourse.openrobotics.org/u/Marija_Golubovic)\
**Post date:** [May 3, 2025, 8:30am UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/1 "2025-05-03T08:30:54Z")

</div>

Hello everyone,

I’m using ROS 2 Humble on an embedded platform. During program execution, if the robot loses network connection, everything stops and the program halts. I would like to ensure that the robot continues executing the program even after the network connection is lost.

I’ve already tried the solution described in [this post](https://robotics.stackexchange.com/questions/92050/ros2-on-embedded-board-without-any-network-connection), but unfortunately, it didn’t work for me.

Has anyone encountered a similar issue or found a reliable solution?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![jbcpollak](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/jbcpollak/32/23100_2.png) [@jbcpollak](https://discourse.openrobotics.org/u/jbcpollak)\
**Post date:** [May 3, 2025, 11:22am UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/2 "2025-05-03T11:22:19Z")

</div>

What middleware are you using? If it’s an option, you may want to consider switching to rmw\_zenoh, which by default _only_ works on localhost. This should make your system robust to the network dropping.

We have had the best results compiling rmw\_zenoh from source as we found the release builds had a few issues.

Alternatively, try the “Improves Dynamic Discovery” configuration as linked to in the first reply here: [Proposal : Restrict DDS to localhost by default](http://discourse.ros.org/t/proposal-restrict-dds-to-localhost-by-default/36018) (direct link is here - [Improved Dynamic Discovery — ROS 2 Documentation: Rolling documentation](https://docs.ros.org/en/rolling/Tutorials/Advanced/Improved-Dynamic-Discovery.html))

---

<div class="post-metadata">

**Author:** ![RobotDreams](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/robotdreams/32/10689_2.png) [@RobotDreams](https://discourse.openrobotics.org/u/RobotDreams)\
**Post date:** [May 3, 2025, 11:55am UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/3 "2025-05-03T11:55:05Z")

</div>

> [@Marija\_Golubovic](#):
>
> During program execution, if the robot loses network connection, everything stops and the program halts.

How are you invoking the “program”?

Does your OS have nohup command?

I use something similar to this from a remote term:

> nohup /home/ubuntu/HumbleDave2/start\_robot.sh \>/dev/null 2\>&1 &

If you want to move the concept into crontab, getting the user and path is trickey so make a “nohup\_start\_robot.sh” and crontab start that script.

Better startup is to start your robot with a service instead of crontab, but more complex to explain and many more options.

---

<div class="post-metadata">

**Author:** ![Marija\_Golubovic](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/marija_golubovic/32/22881_2.png) [@Marija\_Golubovic](https://discourse.openrobotics.org/u/Marija_Golubovic)\
**Post date:** [May 3, 2025, 2:25pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/4 "2025-05-03T14:25:31Z")

</div>

Thank you for your reply. We are using cyclonedds RMW, but switching to zenoh is not an option as we are building a system for a robotics competition next week. Therefore we need a robust solution, without critical changes.

---

<div class="post-metadata">

**Author:** ![Marija\_Golubovic](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/marija_golubovic/32/22881_2.png) [@Marija\_Golubovic](https://discourse.openrobotics.org/u/Marija_Golubovic)\
**Post date:** [May 3, 2025, 2:30pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/5 "2025-05-03T14:30:09Z")

</div>

> [@RobotDreams](#):
>
> How are you invoking the “program”?

Using the ssh protocol, we communicate with the embedded platform, where we start all the necessary components (navigation, detection, hardware components). We have a startup launch script that starts all.

---

<div class="post-metadata">

**Author:** ![Marija\_Golubovic](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/marija_golubovic/32/22881_2.png) [@Marija\_Golubovic](https://discourse.openrobotics.org/u/Marija_Golubovic)\
**Post date:** [May 3, 2025, 2:50pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/6 "2025-05-03T14:50:48Z")

</div>

> [@RobotDreams](#):
>
> Does your OS have nohup command?

Thank you for your reply. Unfortunately, our system don’t support that command. We are using Ubuntu 22.04.

---

<div class="post-metadata">

**Author:** ![RobotDreams](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/robotdreams/32/10689_2.png) [@RobotDreams](https://discourse.openrobotics.org/u/RobotDreams)\
**Post date:** [May 3, 2025, 2:51pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/7 "2025-05-03T14:51:57Z")

</div>

> [@Marija\_Golubovic](#):
>
> Using the ssh protocol, we communicate with the embedded platform, where we start all the necessary components (navigation, detection, hardware components). We have a startup launch script that starts all.

quick and easy test:

- use “nohup” before the startup script:

> nohup start\_robot.sh &  
> exit

Then ssh back in and look at the file nohup.out to see the output of your programs

> [@Marija\_Golubovic](#):
>
> Unfortunately, our system don’t support that command. We are using Ubuntu 22.04.

??? Ubuntu 22.04 doesn’t have nohup ???  
What is the result of:

> nohup --version

If command not found then:

> sudo apt-get install coreutils

---

<div class="post-metadata">

**Author:** ![jlblancoc](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/jlblancoc/32/4731_2.png) [@jlblancoc](https://discourse.openrobotics.org/u/jlblancoc)\
**Post date:** [May 3, 2025, 3:06pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/8 "2025-05-03T15:06:52Z")

</div>

Have you tried?

- ssh into the robot
- ‘screen’
- run the system
- CTRL+A, then D. (Detach terminal) It keeps running in the background
- go on, disconnect ssh, whatever

At any moment:

- ssh
- screen -R

---

<div class="post-metadata">

**Author:** ![chfritz](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/chfritz/32/26180_2.png) [@chfritz](https://discourse.openrobotics.org/u/chfritz)\
**Post date:** [May 3, 2025, 3:43pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/9 "2025-05-03T15:43:04Z")

</div>

> [@Marija\_Golubovic](#):
>
> Using the ssh protocol, we communicate with the embedded platform, where we start all the necessary components

This is a common question but has actually nothing to do with ROS. See this question for a number of good options (including nohup, screen, and also tmux):  
[How to keep processes running after ending ssh session?](https://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session)

---

<div class="post-metadata">

**Author:** ![Marija\_Golubovic](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/marija_golubovic/32/22881_2.png) [@Marija\_Golubovic](https://discourse.openrobotics.org/u/Marija_Golubovic)\
**Post date:** [May 3, 2025, 4:14pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/11 "2025-05-03T16:14:55Z")

</div>

We are already using tmux, and I mean that is not an issue.

> [@chfritz](#):
>
> This is a common question but has actually nothing to do with ROS. See this question for a number of good options (including nohup, screen, and also tmux):

We are already using tmux, and I mean that is not an issue.

---

<div class="post-metadata">

**Author:** ![mnumanuyar](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/mnumanuyar/32/17531_2.png) [@mnumanuyar](https://discourse.openrobotics.org/u/mnumanuyar)\
**Post date:** [May 5, 2025, 7:00am UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/12 "2025-05-05T07:00:53Z")

</div>

Is using systemd service suitable for you?

---

<div class="post-metadata">

**Author:** ![peci1](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/peci1/32/10145_2.png) [@peci1](https://discourse.openrobotics.org/u/peci1)\
**Post date:** [May 5, 2025, 9:08am UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/13 "2025-05-05T09:08:55Z")

</div>

Are you saying your problem is that when a network interface disappears and then appears again, the RMW doesn’t notice it and doesn’t communicate on this interface? Or does the disappearing of the network device even break comms on localhost while the link is lost?

---

<div class="post-metadata">

**Author:** ![tfoote](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/tfoote/32/3813_2.png) [@tfoote](https://discourse.openrobotics.org/u/tfoote)\
**Post date:** [May 5, 2025, 4:22pm UTC](https://discourse.openrobotics.org/t/ros-2-humble-continue-program-execution-after-network-loss/43517/14 "2025-05-05T16:22:04Z")

</div>

Hi @Marija_Golubovic and everyone helping resolve this,

We appreciate the iterations here. However this thread is a much better suited for [Robotics Stack Exchange](https://robotics.stackexchange.com) As is described in our [support guidelines](https://docs.ros.org/en/rolling/Contact.html#support) ROS Discourse we want to focus on general disussions and troubleshooting support is on [Robotics Stack Exchange](https://robotics.stackexchange.com/) which has many better mechanisms to improve the flow for helping get to the best answer faster.

@Marija_Golubovic based on all these iterations please try to make a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) so that others can help you better. Because your question is not clearly defined and reproducible you’re getting a lot of suggestions that are not helpful for you. Please ask your question and then follow up here one last time to provide a link to the question so that if someone has an issue similar to yours they can find the question and hopefully answer on Stack Exchange.
