Rookie here.
I have a simple python code that's supposed to subscribe to a topic and publish JSON payload to the same topic using MQTT protocol. But for some reason, I am unable to load the payload as JSON!
What am I doing wrong here?
# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt
import json
mqtt_broker = '192.168.1.111'
mqtt_topic_one = 'mqtt_topic/tops_one'
mqtt_topic_two = 'mqtt_topic/tops_two'
json_data_1 = '''{
"this_json": "info",
"data": {
"multi_keyval": {
"1": "1",
"5": "5",
"15": "15"
},
"single_keyval": {
"single_key": "200"
}