This is a very common issue, which is why I've created a gist script to set it up correctly, together with some troubleshooting steps: https://gist.github.com/chfritz/8c2adab45a94e091be77c55b0432ad2e.
Originally posted by chfritz with karma: 553 on 2020-11-07
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by med97 on 2020-11-07:
thank you sir it worked , the problem was that i did not set the ROS_HOSTNAME and ROS_IP for both pi and pc
Comment by chfritz on 2020-11-07:
Glad it helped! Please don't forget to upvote the answer.
Comment by gvdhoorn on 2020-11-08:
@chfritz: thank you for answering the question, but could you please not post link-only answers? If/when your gist changes or disappears (and this does happen more frequently than you might think), this answer will lose all its value.
It would be great if you could include the relevant parts from your gist here in your answer, and then also explain what users are seeing, such that it becomes less of a magic incantation they'll just copy-paste.
Comment by chfritz on 2020-11-08:
Hi Gijs, I know what you are getting at, but at the same time we do this sort of thing all the time when we point people at a package or some other ros tool that solves their problem. Granted, packages are perhaps better maintained than gists (perhaps!), but certainly in both cases the benefit is that the outside resource can continue to improve. Maybe the best option would be to move the snippet of my gist over to the ros wiki somewhere? Do you think that would be better?