groove-x / mqtt_bridge

mqtt_bridge provides a functionality to bridge between ROS and MQTT in bidirectional
MIT License
159 stars 146 forks source link

after roslauch I get "ValueError No JSON object could be decoded" #6

Closed Binsoma closed 6 years ago

Binsoma commented 6 years ago

started roslaunch server http://debian:45571/

SUMMARY

PARAMETERS

NODES / mqtt_bridge (mqtt_bridge/mqtt_bridge_node.py)

ROS_MASTER_URI=http://localhost:11311

running rosparam delete /mqtt_bridge/ process[mqtt_bridge-1]: started with pid [4631] [INFO] [1516109094.645015]: MQTT connected Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.kwargs) File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 2650, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 1481, in loop_forever rc = self.loop(timeout, max_packets) File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 1003, in loop rc = self.loop_read(max_packets) File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 1284, in loop_read rc = self._packet_read() File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 1849, in _packet_read rc = self._packet_handle() File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 2305, in _packet_handle return self._handle_publish() File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 2500, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/paho/mqtt/client.py", line 2642, in _handle_on_message callback(self, self._userdata, message) File "/home/ruhl/catkin_ws/src/mqtt_bridge/src/mqtt_bridge/bridge.py", line 115, in _callback_mqtt ros_msg = self._create_ros_message(mqtt_msg) File "/home/ruhl/catkin_ws/src/mqtt_bridge/src/mqtt_bridge/bridge.py", line 125, in _create_ros_message msg_dict = self._deserialize(mqtt_msg.payload) File "/usr/lib/python2.7/json/init__.py", line 339, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

I did not publish anything, Just after roslaunch I get the above error. Help, please.

Binsoma commented 6 years ago

I resolved it by starting at the beginning.