Unable to communicate with master with Real Robot connected to Rosject

Hello,

I have run and followed the instructions to connect a real robot to my rosject and everything was looking good. I can run roscore in my robot, and it seems like it is connected to my rosject (see image below). Unfortunately, when I try to run “rostopic list” in my rosject’s terminal I get the following message: “ERROR: Unable to communicate twith master!” so I cannot run any command.

Below I have also included the last lines of my /etc/hosts and .bashrc files:
.bashrc
export ROS_IPV6=on
export ROS_MASTER_URI=http://husarnet-local:11311
export ROS_HOSTNAME=husarnet-local
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI=file:///var/lib/theconstruct.rrl/cyclonedds.xml
export FASTRTPS_DEFAULT_PROFILES_FILE=/var/lib/theconstruct.rrl/fastdds_husarnet.xml

/etc/hosts
127.0.0.1 husarnet-local
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1 raspberrypi

fc94:c41e:b11d:8728:a03f:1a9d:54f5:4883 husarnet-local # managed by Husarnet

I woudl appreciate if you could help me to solve this problem, I am really stuck in my project due to this.

Thanks in advance and best regards,
Jaime

Hi Jaime,

Is your robot running? If there is nothing running with ROS in the robot, then that error is expected.

Make sure that in the local terminal, where you are launching your robot drivers, you source your .bashrc beforehand:

source ~/.bashrc

Did you paste the command shown once you add the robot?

If so, could you paste the output of the following command?

sudo service theconstruct.rrl status

Hi @Jaime795,

So, have you manually added ROS_MASTER_URI and ROS_HOSTNAME pointing to husarnet-local?

export ROS_MASTER_URI=http://husarnet-local:11311
export ROS_HOSTNAME=husarnet-local

Our system expects ROS_HOSTNAME and ROS_MASTER_URI to be pointing to master.

The correct expected values are:


export ROS_IPV6=on
export ROS_MASTER_URI=http://master:11311
export ROS_HOSTNAME=master
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI=file:///var/lib/theconstruct.rrl/cyclonedds.xml
export FASTRTPS_DEFAULT_PROFILES_FILE=/var/lib/theconstruct.rrl/fastdds_husarnet.xml

Can you try:

  • Put the master values again
  • source ~/.bashrc
  • Relaunch your ROS nodes?

Hi @ralves,

Yes, as you said, i changed the file manually. This is because with the initial configuration (the one you said) I wasn’t even able to run roscore in my robot. I have done what you said and I got the same result, my files now look like this:
.bashrc
export ROS_IPV6=on
export ROS_MASTER_URI=http://master:11311
export ROS_HOSTNAME=master
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI=file:///var/lib/theconstruct.rrl/cyclonedds.xml
export FASTRTPS_DEFAULT_PROFILES_FILE=/var/lib/theconstruct.rrl/fastdds_husarnet.xml

/etc/hosts
127.0.0.1 master
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1 raspberrypi

fc94:c41e:b11d:8728:a03f:1a9d:54f5:4883 husarnet-local # managed by Husarnet

With this configuration when i run roscore in my robot i get the following:

if a change in /etc/hosts fc94:c41e:b11d:8728:a03f:1a9d:54f5:4883 husarnet-local # managed by Husarnet to fc94:c41e:b11d:8728:a03f:1a9d:54f5:4883 master # managed by Husarnet i can run roscore but i am still not able to get communication to master from my rosject webshell.

Hope you can help me, if I have to change any configuration file to test if this works, please tell me.

Thanks in advance and best regards,
Jaime

Hi @roalgoal,

Yes, i did everything you said. When I run the command you told me I get the following output:

Clearly something is wrong but I don’t know what, hope that you can come up with something.

Thanks in advance and best regards,
Jaime

Hi Jaime,

Thank you for sharing that screenshot. It looks like the service is having an error. We are sorry for the inconvenience.

Could you share the whole output of the following command?

sudo service theconstruct.rrl status

My colleage @ralves and I will look into what went wrong. For readable formatting, you can paste the output and wrap it with 3 ```

Hi @Jaime795!

Like Rodrigo said, if you paste the whole output of sudo service theconstruct.rrl status, it would be easier for us to diagnose.

I would also ask you to post the output of sudo service husarnet status

These are some of the instructions we see when installing the service:


🐞️ What to do if you cannot connect to your robot from https://app.theconstructsim.com:
 1 - Check the logs with:
    sudo journalctl -f -u theconstruct.rrl

 2 - You can also check the service status with:
    sudo service theconstruct.rrl status

 3 - Or restart the service with:
    sudo service theconstruct.rrl restart

 If you still cannot connect to your robot, please contact us through info@theconstructsim.com

🔴️️ To remove this service, run:
    rrl-uninstall





# You can also check Husarnet:
sudo service husarnet status

So, based on the instructions above, another command that you could try to see more logs is:

sudo journalctl -f -u theconstruct.rrl

Based on your screenshot, I see that you are not connected to Husarnet, because the master host is set automatically by Husarnet.

Please try all the commands I mentioned here, and paste them here so that we can diagnose it better.

You can possibly check Husarnet logs also with:

sudo journalctl -f -u husarnet

Hi @roalgoal ,

You can find the complete output below

If you need anything else, please tell me. I am a little bit in a rush to solve this problem.

Best regards and thanks in advance,
Jaime

● theconstruct.rrl.service - RRL (Real Robot Lab) by The Construct
   Loaded: loaded (/etc/systemd/system/theconstruct.rrl.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2023-04-04 00:04:08 CEST; 14h ago
  Process: 518 ExecStartPre=/usr/bin/env bash -c curl https://app.theconstructsim.com/rrl-connect.sh | tee /usr/bin/rrl-connect.sh >/dev/null (code=exited, status=0/SUCCESS)
  Process: 555 ExecStartPre=/usr/bin/env bash -c chmod +x /usr/bin/rrl-connect.sh (code=exited, status=0/SUCCESS)
  Process: 556 ExecStart=/usr/bin/rrl-connect.sh (code=exited, status=203/EXEC)
 Main PID: 556 (code=exited, status=203/EXEC)

Apr 04 00:04:07 raspberrypi systemd[1]: Starting RRL (Real Robot Lab) by The Construct...
Apr 04 00:04:08 raspberrypi env[518]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Apr 04 00:04:08 raspberrypi env[518]:                                  Dload  Upload   Total   Spent    Left  Speed
Apr 04 00:04:08 raspberrypi env[518]: [136B blob data]
Apr 04 00:04:08 raspberrypi systemd[1]: Started RRL (Real Robot Lab) by The Construct.
Apr 04 00:04:08 raspberrypi systemd[556]: theconstruct.rrl.service: Failed to execute command: Exec format error
Apr 04 00:04:08 raspberrypi systemd[556]: theconstruct.rrl.service: Failed at step EXEC spawning /usr/bin/rrl-connect.sh: Exec format error
Apr 04 00:04:08 raspberrypi systemd[1]: theconstruct.rrl.service: Main process exited, code=exited, status=203/EXEC
Apr 04 00:04:08 raspberrypi systemd[1]: theconstruct.rrl.service: Failed with result 'exit-code'.

Hi @Jaime795,

great to see that you are here online.

I just removed the robot from our database.

Could you just remove our service with:

sudo     rrl-uninstall

And then create a new robot in app.theconstructsim.com, and run the installation script again?

I’ll be here waiting for your feedback.

Hi @Jaime795,

can you try to connect to the robot again?

The system will ask you to give a robot name and will provide you with a new installation script.

Please check my last message above.

Hi @ralves,

Sorry for the delay but I have good news! It looks like is working fine

I have run roscore in my robot without any issue and I have been able to connect to my robot from my rosject. I have run some nodes in my robot and I can see the topics from my rosject.

Thanks a lot for your support.

Best Regards,
Jaime

2 Likes

Awesome.

Great to hear that now everything works fine.

Now, just for my records:

  • Before removing your robot from our system, I found that the network associated with your robot was not found in Husarnet.
  • By removing your robot, I would force you to register a new one, and re-run the installation script, which creates a new network in Husarnet.
  • And this indeed solved the problem