• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Java json/python error

    User help
    4
    9
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      christoffv
      last edited by

      I am trying to generate some mqtt json data that I publish to a mosquitto server, and mango gives me this error.

      MY python code:

      import paho.mqtt.client as mqtt
      import json

      broker = "192.168.111.51"
      topic = "/BrokerID/Support/Broker"

      d = {}
      d["Format"] = "RegisterBroker"
      d["BrokerID"] = "AABBCCDDEEFF"
      d["Version"] = "1.0.5"

      data_out = json.dumps(d, ensure_ascii=False)
      print(data_out)

      mqttc = mqtt.Client()
      mqttc.username_pw_set("xxx", password="************")
      mqttc.connect(broker, port=1883, keepalive=60)
      mqttc.publish(topic, data_out)


      Mango error:
      ERROR 2018-03-03T19:55:39,388 (com.infiniteautomation.m2m2.mqtt.client.MqttClientDataSourceRT.messageArrived:371) - Error during read topic: "/BrokerID/Support/Broker" datapoint: "MyPi - Register Broker" payload: "{"Format": "RegisterBroker", "BrokerID": "AABBCCDDEEFF", "Version": "1.0.5"}" exception: "Invalid input: JSON Pointer expression must start with '/': ":""

      THanks, hope somebody can put some light on this.

      Christoff

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi Christoff,

        Have you configured any data points on your MQTT data source? Can you share the JSON of their configuration?

        1 Reply Last reply Reply Quote 0
        • C
          christoffv
          last edited by

          Sorry, missed the most important part.

          0_1520349682356_66ae142b-82c0-42c2-8420-339a6f69f160-image.png

          1 Reply Last reply Reply Quote 0
          • Jared WiltshireJ
            Jared Wiltshire
            last edited by

            @christoffv said in Java json/python error:

            Invalid input: JSON Pointer expression must start with '/': "

            There's your answer there. It looks like there is a comma in the "JSON point for value" field. Click the blue help icon for more information on JSON pointers.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • C
              christoffv
              last edited by

              Thanks a million, It works now, This is why you need that extra pair of eyes.

              Thanks everyboy

              1 Reply Last reply Reply Quote 0
              • F
                Fabier
                last edited by

                @christoffv, you can conect to mosquito broker is using data source mqtt client, with the configuration in the data sourse don't neccesary create a file json, I can publish information if you create a data point, you can asignate a topic and public information.

                1 Reply Last reply Reply Quote 0
                • C
                  christoffv
                  last edited by

                  I know this is really a very dumb question, but hy do I see the history point values and not the value in the Data Point block. I have played with my setting of the data point but no luck.

                  0_1520583421218_dffa79ef-286b-4c7b-8f34-9992ae6a1506-image.png

                  1 Reply Last reply Reply Quote 0
                  • phildunlapP
                    phildunlap
                    last edited by

                    That is weird. It looks like it was receiving updates while the page was open, even. Are you experiencing that with other types of data points? Are you on the latest versions of things?

                    1 Reply Last reply Reply Quote 0
                    • C
                      christoffv
                      last edited by

                      I have created a new data point, plain subscribe to /motor1/temp1 and I get the value to show. The only difference is that the value that I can't see is a json value.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post