Hi,
I have a msg from TTN - I want to extract msg.payload_fields.latitudeDeg and msg.payload_fields.ongitudeDeg - but I get a error - "TypeError: Cannot set property 'latitude' of undefined"
My function node:
The msg
.
"app_id":"xxxxxxxx"
"dev_id":"xxxxxx"
"hardware_serial":"xxx"
"port":1
"counter":9
"payload_raw":[2xx,xx,x,xxx,xx,xx,xx,xx,xx,xx,xxx]
"payload_fields":
"batV":4.625
"fixFailed":false
"headingDeg":151.875
"inTrip":false
"latitudeDeg":xxxxxxx
"longitudeDeg":xxxxxx
"speedKmph":0
"type":"position"}
"metadata":
{"time":"2020-08-09T11:38:02.830354008Z","frequency":867.9,"modulation":"LORA","data_rate":"SF12BW125","airtime":1482752000,"coding_rate":"4/5","gateways":[{"gtw_id":"eui-xxxxxx","timestamp":443296308,"time":"2020-08-09T11:38:02.655561Z","channel":7,"rssi":-104,"snr":-19,"rf_chain":0},{"gtw_id":"eui-xxxxxxxxxxx","timestamp":2236258892,"time":"","channel":7,"rssi":-69,"snr":12.5,"rf_chain":0}]},"payload":"{"batV":4.625,"fixFailed":false,"headingDeg":151.875,"inTrip":false,"latitudeDeg":xxxxx,"longitudeDeg":xxxxxx,"speedKmph":0,"type":"position"}","_msgid":"c2ef0ca8.e2d5d"}
Your help will be greatly appriciated.