I am experimenting with a homemade microcontroller GPS tracker.
it sends out JSON through MQTT in following format:

{
  "ident": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "timestamp": "1639932300761",
  "position.altitude": "12",
  "position.hdop": "1.6",
  "position.latitude": "50.863423",
  "position.longitude": "3.27"
}

I made a channel, that identifies the "ident" ok, and passes through to my device.
In the channel I created message parameters:
position.hdop
position.altitude
position.latitude
position.longitude

hdop and altitude work fine, but once i add latitude or longitude message parameter, it stops receiving hdop and altitude.
When i rename position.latitude and position.longitude in the json, to for example just latitude and longitude, it receives them ok when i add them as message parameters in the channels, but it passes latitude to the device, instead of the needed position.latitude.

I don't realy understand the problem here.
is there someone who gets what is going wrong here? or better, what i'm doing wrong?

thanks in advance.

    olivierwambacq changed the title to Beginner Question. - MQTT not receiving position.latitude, just latitude works..
      • Edited

      Please try sending numbers instead of strings for these parameters. And timestamp in seconds.

      {
        "ident": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "timestamp": 1639932300,
        "position.altitude": 12,
        "position.hdop": 1.6,
        "position.latitude": 50.863423,
        "position.longitude": 3.27
      }

        This still doesn't work.

        situation one: just position.altitude in message parameters works ok

        situation 2: when adding latitude, (as numbers), both latitude and altitude stop getting through.

          dexif
          thanks, ok, so position.latitude and longitude is not in the list for mqtt, altough it says 'any custom parameter' in the utils.. but i guess it's maybe some kind of "reserved" parameter?
          that would explain why it works ok when i rename it to just latitude and longitude, and not position.x

          but my device i mapped this channel to with the ident, needs position.longitude and position.latitude.
          can i somehow translate latitude to position.latitude after parsing it en before injecting it to the device?

          thx for the replies.

          • shal replied to this.

            Please configure both fields position.latitude and position.longitude for the channel

            you did it. it works,

            so i learned today to be realy specific and complete. not test with half configs. :)

            thank you so much.

              You are welcome ;)

                olivierwambacq position.latitude and position.longitude are specific parameters (coordinates). flespi checks their type and value is in valid range and if not - removes some other position-related parameters.

                If you send whole correct JSON in MQTT you do not need any extra channel configuration (message parameters). Everything will be mapped by flespi into the channel message "as is".

                  Write a Reply...