0
$\begingroup$

Rosanswers logo

I am trying to connect from a Client PC (Raspberry Pi) to an AWS EC2 Instance remotely over the internet using by UDP unicast.

I had set up both computers as below.I executed a "ros2 run demo_nodes_py talker" on this Client PC, and executed a "ros2 run demo_nodes_py listener" on this Instance. But this Instance cannot receive topic messageses from this Client PC. Please let me know how to connect AWS EC2 Instance.

Details information is below:

AWS EC2 Instance configuration

  • TYPE: AWS EC2 VPC Instance(t2.micro)

  • OS: Ubuntu 18.04 LTS

  • ROS Version: ROS2 Dashing Diademata

  • Private IP: aaa.aaa.aaa.aaa

  • Public IP: bbb.bbb.bbb.bbb

  • FastRTPS - DEFAULT_FASTRTPS_PROFILES.xml

<?xml version="1.0" encoding="UTF-8" ?>
<profiles>
    <participant profile_name="my_profile_s" is_default_profile="true">
        <rtps>
            <builtin>
                <metatrafficUnicastLocatorList>
                    <locator/>
                </metatrafficUnicastLocatorList>
                <initialPeersList>
                    <locator>
                        <udpv4>
                            <address>ddd.ddd.ddd.ddd</address>
                        </udpv4>
                    </locator>
                </initialPeersList>
            </builtin>
        </rtps>
    </participant>
</profiles>
  • AWS EC2 Security Group Inbound Configuration
type      : port number: src address
-----------------------------------
Custom UDP: port 7412  : 0.0.0.0/0
Custom UDP: port 7413  : 0.0.0.0/0
Custom UDP: port 7414  : 0.0.0.0/0
Custom UDP: port 7415  : 0.0.0.0/0
Custom UDP: port 7416  : 0.0.0.0/0

Client PC configuration

  • TYPE: Raspberry Pi 3+

  • OS: Ubuntu 18.04 LTS

  • ROS Version: ROS 2 Dashing Diademata

  • Private IP: ccc.ccc.ccc.ccc

  • Public IP: ddd.ddd.ddd.ddd

  • FastRTPS - DEFAULT_FASTRTPS_PROFILES.xml

<?xml version="1.0" encoding="UTF-8" ?>
<profiles>
    <participant profile_name="my_profile_c" is_default_profile="true">
        <rtps>
            <builtin>
                <metatrafficUnicastLocatorList>
                    <locator/>
                </metatrafficUnicastLocatorList>
                <initialPeersList>
                    <locator>
                        <udpv4>
                            <address>bbb.bbb.bbb.bbb</address>
                        </udpv4>
                    </locator>
                </initialPeersList>
            </builtin>
        </rtps>
    </participant>
</profiles>

Thank you in advance for reading my question.

Best regards,

Iori


Originally posted by Iori on ROS Answers with karma: 11 on 2019-07-17

Post score: 1


Original comments

Comment by kaliatech on 2019-07-26:
Fwiw, I have also been unable to get UDP unicast to work. However, I was able to get TCP to work from client to EC2 server. Let me know if that configuration would be helpful.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Thank you for your advice.

To use UDP unicast communication with ROS2, both client PC and AWS EC2 had to be able to send and receive data using the udp protocol each other. Since this network condition I have asked was client PC communicate AWS EC via NAT, It didn't work UDP unicast communication.

Therefore, I solved this problem by using an OpenVPN network between a Client PC and AWS EC2.

Best regards, Iori


Originally posted by Iori with karma: 11 on 2019-09-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by btidd on 2023-05-18:
Can I ask how you set up your configuration? With OpenVPN we are able to echo topics on the client PC published on AWS EC2, but not the other way around.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.