Menu

Error in MQTT JSON

2021-02-20
2021-02-21
  • Franck RONDOT

    Franck RONDOT - 2021-02-20

    Hi,
    The JSON object send to MQTT looks wrong, it lacks the brace in the first character to form the JSON.
    The JSON send is :
    "lat":"00 00 00 N","lon":"000 00 00 W","alt":0,"ambient":20.000,"humidity":50.0,"dewpoint":9.269,"pressure":110000.00,"irambient":20.000,"irobject":20.000,"lux":1000.00000000,"sqm":5.08355,"nelm":-8.568,"windspd":0.00,"beaufort":0,"winddir":0,"raining":1,"rainhour":0.00,"rainday":0.00,"cloudcover":100.00,"wcf":0.00,"mac":"7C:9E:BD:F4:11:0C","rtcdate":"01/01/1900","rtctime":"00:00:00"}
    In place of :
    {"lat":"00 00 00 N","lon":"000 00 00 W","alt":0,"ambient":20.000,"humidity":50.0,"dewpoint":9.269,"pressure":110000.00,"irambient":20.000,"irobject":20.000,"lux":1000.00000000,"sqm":5.08355,"nelm":-8.568,"windspd":0.00,"beaufort":0,"winddir":0,"raining":1,"rainhour":0.00,"rainday":0.00,"cloudcover":100.00,"wcf":0.00,"mac":"7C:9E:BD:F4:11:0C","rtcdate":"01/01/1900","rtctime":"00:00:00"}
    I change the line 289 of mqttserver.h from :
    jsonstr = jsonstr + "\"lat\":\"" + mylatitude + "\",\"lon\":\"" + mylongitude + "\"";
    to
    jsonstr = jsonstr + "{\"lat\":\"" + mylatitude + "\",\"lon\":\"" + mylongitude + "\"";

    And now it's work fine in Node-Red.

    Regards,
    Franck

     
  • brownrb

    brownrb - 2021-02-21

    Hi Franck
    Well spotted. I have corrected this in the firmware as suggested and uploaded 115 with no other changes

    regards
    Robert

     
  • brownrb

    brownrb - 2021-02-21

    Hi Franck
    I would welcome a couple of screen shots of your Node-Red to go into the PDF is that is ok?

    The bug I traced back to changes made in v108. It was not noticed by either myself or the good chaps in the beta test group - so kudos belongs to you on that one!

    Regards
    Robert

     
  • Franck RONDOT

    Franck RONDOT - 2021-02-21

    Hi Robert,

    When i finish the Node-Red script i post the scripts ans screenshots.

    Regards,
    Franck

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.