ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

mqtt_bridge's Problem

asked 2020-03-06 12:12:33 -0500

KevinZehou gravatar image

updated 2020-03-06 12:15:59 -0500

gvdhoorn gravatar image

I just installed mqtt_bridge on the ROS Melodic But when i use

roslaunch mqtt_bridge demo.launch

it always shown this problem. i have installed the python module inject

Problem is :

Traceback (most recent call last):
  File "/home/kevin/catkin_ws/src/mqtt_bridge-master/scripts/mqtt_bridge_node.py", line 5, in <module>
    from mqtt_bridge.app import mqtt_bridge_node
  File "/home/kevin/catkin_ws/src/mqtt_bridge-master/src/mqtt_bridge/app.py", line 4, in <module>
    import inject
ImportError: No module named inject
[mqtt_bridge-1] process has died [pid 7778, exit code 1, cmd /home/kevin/catkin_ws/src/mqtt_bridge-master/scripts/mqtt_bridge_node.py __name:=mqtt_bridge __log:=/home/kevin/.ros/log/2b77c57e-5fd2-11ea-bb19-f894c224a270/mqtt_bridge-1.log].
log file: /home/kevin/.ros/log/2b77c57e-5fd2-11ea-bb19-f894c224a270/mqtt_bridge-1*.log
all processes on machine have died, roslaunch will exit
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2020-03-08 04:41:16 -0500

Shazam gravatar image

Hi,

I recently struggled with the same problem, so follow these instructions and it would get working:

1) If you have both Python 2 and Python 3 at the same system then founding the right packages in the right directories can become a big mess. What I did was use Pycharm (virtual environment) and use Python 2.7 as the interpreter when you create a new project.

2) Use the command 'python -m site' and see the defined directories to look for the required packages. For example, right now it can't find the inject package in the defined directories but the package would be installed (probably in python 3.7 directory).

3) Install the specified required versions listed in the requirements.txt packages and NOT the latest ones. Use the pip install --target=/someplace package_name.version For example, I downloaded the packages in the python2.7/sitepackages

4) Start mosquitto by just writing 'mosquitto' in a new terminal.

5) Run the roslaunch command.

6) You might also have to install the rosbridge package.

Do these steps and I believe it will get working. I spent a lot of time struggling with the same issue so hopefully it helps :)

edit flag offensive delete link more

Comments

Thank you very much for your help. I tried the steps you told, and it really works. I install the modules with the right versions which shown in the requirements. But some problems happened, i tried many ways to solve the problems but it still not work. When i install the 'bson 0.5.2' , this problems hanppened. The errors are: n"/tmp/pip-install-t42_ ev/bson/setup.py"t's flle_ - 1nL '/tmp/pip-lnstall-t42_ ev /bson/setup. py'" '"l;f-getattr(tokenlile'open'do', open)(_ file_ );code-f.read().replace(liairln Tn"0f.close();exec(complle(code, file_ exec")' egg. info · -egg base 7tmp/plp -install-t42 ev/bson/pip-egg in cwd: /tmp/pip-install-t42_ ev/bson/ Complete output (5 Lines): File "/tmp/pip-install-t42 ev/bson/setup.py", line 8, in «module> from plp import get_ Installed_ distributions ImportError: cannot tmport name get installed _distributtons ERROR: Conmand errored out with exit status 1 ...(more)

KevinZehou gravatar image KevinZehou  ( 2020-03-08 06:42:51 -0500 )edit

Hi,

Is mosquitto running? and secondly uninstall bson. Then install bson it with the specified version in the target directory of python2.7/sitepackages

Shazam gravatar image Shazam  ( 2020-03-08 07:33:35 -0500 )edit

Thank you very much for your help. It finally working. I installed 'pymongo bson' and did the steps you guide me. And there is one more problem which is: [WARN] [1583671503.426540]: Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details.

KevinZehou gravatar image KevinZehou  ( 2020-03-08 08:15:36 -0500 )edit

Actually, I'm also facing a similar issue and trying to solve it. Can you please explain what you're trying to do and where you are sending these values through mqtt? Which web platform are you using?

Shazam gravatar image Shazam  ( 2020-03-08 08:18:08 -0500 )edit

Sure. I was just triyng to test it: Publish "hello" to /echo and see response to /back. It's not really stable and i am not sure when it happened. When i do it the first time this problem happened but when i try it again, no warning happened. I am using Ubuntu 18.04LTS, and ROS Melodic.

KevinZehou gravatar image KevinZehou  ( 2020-03-08 08:28:24 -0500 )edit

I'm glad to know it's working. Let me know if you try some application over it by connecting it to a web platform.

Shazam gravatar image Shazam  ( 2020-03-08 08:42:42 -0500 )edit

No Problem. Thanks for your help!!

KevinZehou gravatar image KevinZehou  ( 2020-03-08 08:44:21 -0500 )edit

Hi, did you build anything using this package?

Shazam gravatar image Shazam  ( 2020-06-05 02:56:19 -0500 )edit

Question Tools

Stats

Asked: 2020-03-06 12:12:33 -0500

Seen: 1,185 times

Last updated: Mar 08 '20