Hello,
This is my first attempt to work with LORA in generall so i hope i have not missunderstood to many things.
I am using the LMIC library on an ESP32 to send a two byte message to TTN (and from there to the MQTT service). I managed to get the OTA “registration” to work and I can see many received messages in the TTN Console. The problem is, that so far I was not able to get any of my data decoded.
I have configured a payload formatter with the following code:
function decodeUplink(input) {
return {
data: {
"temp": (((input.bytes[0] << 8) | input.bytes[1])-3000 ) / 100,
"byte0": input.bytes[0],
"byte1": input.bytes[1]
},
warnings: [],
errors: []
};
}
when I put my two hex bytes into the test input, it decodes it in an expected way.
now the problem is that when i send a message via my ESP32 the payload formatter seems to not recieve any data and just displays the following data:
"decoded_payload": {
"byte0": null,
"byte1": null,
"temp": -30
}
I will also attach the two JSON data “files” as it may allow someone more experienced to see where the problem originates.
{
"name": "as.up.data.forward",
"time": "2022-02-04T17:58:51.825417610Z",
"identifiers": [
{
"device_ids": {
"device_id": "eui-70b3d57ed004bfcd",
"application_ids": {
"application_id": "kili-test1"
}
}
},
{
"device_ids": {
"device_id": "eui-70b3d57ed004bfcd",
"application_ids": {
"application_id": "kili-test1"
},
"dev_eui": "70B3D57ED004BFCD",
"join_eui": "0000000000000000",
"dev_addr": "260B5243"
}
}
],
"data": {
"@type": "type.googleapis.com/ttn.lorawan.v3.ApplicationUp",
"end_device_ids": {
"device_id": "eui-70b3d57ed004bfcd",
"application_ids": {
"application_id": "kili-test1"
},
"dev_eui": "70B3D57ED004BFCD",
"join_eui": "0000000000000000",
"dev_addr": "260B5243"
},
"correlation_ids": [
"as:up:01FV2Y73NCD6EREBES99E73311",
"gs:conn:01FTR3WACTZCK2X3C97T1PM4G2",
"gs:up:host:01FTR3WADQXW9K254990S440FH",
"gs:uplink:01FV2Y73ES5J6J42MF93ZRJ6N4",
"ns:uplink:01FV2Y73EVKWB275MZGMMCB8XC",
"rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01FV2Y73EVVWNYFKA8Q07X6RTX",
"rpc:/ttn.lorawan.v3.NsAs/HandleUplink:01FV2Y73NB99H1RGCDYXQS0XTT"
],
"received_at": "2022-02-04T17:58:51.822273242Z",
"uplink_message": {
"session_key_id": "AX7F02RR2w16RlU5IQUOqQ==",
"f_port": 1,
"f_cnt": 30,
"decoded_payload": {
"byte0": null,
"byte1": null,
"temp": -30
},
"rx_metadata": [
{
"gateway_ids": {
"gateway_id": "cless79gw",
"eui": "AC1F09FFFE046567"
},
"time": "2022-02-04T17:58:51.583Z",
"timestamp": 565002771,
"rssi": -115,
"channel_rssi": -115,
"snr": -2.5,
"location": {
"latitude": 48.3031173,
"longitude": 16.4123684,
"altitude": 283,
"source": "SOURCE_REGISTRY"
},
"uplink_token": "ChcKFQoJY2xlc3M3OWd3EgisHwn//gRlZxCThLWNAhoMCNvS9Y8GEKHQv6ICILi0qOa4kVMqDAjb0vWPBhDAv/+VAg==",
"channel_index": 4
}
],
"settings": {
"data_rate": {
"lora": {
"bandwidth": 125000,
"spreading_factor": 7
}
},
"coding_rate": "4/5",
"frequency": "867300000",
"timestamp": 565002771,
"time": "2022-02-04T17:58:51.583Z"
},
"received_at": "2022-02-04T17:58:51.611239575Z",
"consumed_airtime": "0.046336s",
"network_ids": {
"net_id": "000013",
"tenant_id": "ttn",
"cluster_id": "ttn-eu1"
}
}
},
"correlation_ids": [
"as:up:01FV2Y73NCD6EREBES99E73311",
"gs:conn:01FTR3WACTZCK2X3C97T1PM4G2",
"gs:up:host:01FTR3WADQXW9K254990S440FH",
"gs:uplink:01FV2Y73ES5J6J42MF93ZRJ6N4",
"ns:uplink:01FV2Y73EVKWB275MZGMMCB8XC",
"rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01FV2Y73EVVWNYFKA8Q07X6RTX",
"rpc:/ttn.lorawan.v3.NsAs/HandleUplink:01FV2Y73NB99H1RGCDYXQS0XTT"
],
"origin": "ip-10-100-15-123.eu-west-1.compute.internal",
"context": {
"tenant-id": "CgN0dG4="
},
"visibility": {
"rights": [
"RIGHT_APPLICATION_TRAFFIC_READ",
"RIGHT_APPLICATION_TRAFFIC_READ"
]
},
"unique_id": "01FV2Y73NHT6T00H078Q7FXA11"
}
{
"name": "ns.up.data.process",
"time": "2022-02-04T17:58:51.819023715Z",
"identifiers": [
{
"device_ids": {
"device_id": "eui-70b3d57ed004bfcd",
"application_ids": {
"application_id": "kili-test1"
}
}
},
{
"device_ids": {
"device_id": "eui-70b3d57ed004bfcd",
"application_ids": {
"application_id": "kili-test1"
},
"dev_eui": "70B3D57ED004BFCD",
"join_eui": "0000000000000000",
"dev_addr": "260B5243"
}
}
],
"data": {
"@type": "type.googleapis.com/ttn.lorawan.v3.UplinkMessage",
"raw_payload": "QENSCyaAHgABbWp10w==",
"payload": {
"m_hdr": {
"m_type": "UNCONFIRMED_UP"
},
"mic": "bWp10w==",
"mac_payload": {
"f_hdr": {
"dev_addr": "260B5243",
"f_ctrl": {
"adr": true
},
"f_cnt": 30
},
"f_port": 1,
"full_f_cnt": 30
}
},
"settings": {
"data_rate": {
"lora": {
"bandwidth": 125000,
"spreading_factor": 7
}
},
"coding_rate": "4/5",
"frequency": "867300000",
"timestamp": 565002771,
"time": "2022-02-04T17:58:51.583Z"
},
"rx_metadata": [
{
"gateway_ids": {
"gateway_id": "cless79gw",
"eui": "AC1F09FFFE046567"
},
"time": "2022-02-04T17:58:51.583Z",
"timestamp": 565002771,
"rssi": -115,
"channel_rssi": -115,
"snr": -2.5,
"location": {
"latitude": 48.3031173,
"longitude": 16.4123684,
"altitude": 283,
"source": "SOURCE_REGISTRY"
},
"uplink_token": "ChcKFQoJY2xlc3M3OWd3EgisHwn//gRlZxCThLWNAhoMCNvS9Y8GEKHQv6ICILi0qOa4kVMqDAjb0vWPBhDAv/+VAg==",
"channel_index": 4
}
],
"received_at": "2022-02-04T17:58:51.611239575Z",
"correlation_ids": [
"gs:conn:01FTR3WACTZCK2X3C97T1PM4G2",
"gs:up:host:01FTR3WADQXW9K254990S440FH",
"gs:uplink:01FV2Y73ES5J6J42MF93ZRJ6N4",
"ns:uplink:01FV2Y73EVKWB275MZGMMCB8XC",
"rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01FV2Y73EVVWNYFKA8Q07X6RTX"
],
"device_channel_index": 4,
"consumed_airtime": "0.046336s"
},
"correlation_ids": [
"gs:conn:01FTR3WACTZCK2X3C97T1PM4G2",
"gs:up:host:01FTR3WADQXW9K254990S440FH",
"gs:uplink:01FV2Y73ES5J6J42MF93ZRJ6N4",
"ns:uplink:01FV2Y73EVKWB275MZGMMCB8XC",
"rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01FV2Y73EVVWNYFKA8Q07X6RTX"
],
"origin": "ip-10-100-7-32.eu-west-1.compute.internal",
"context": {
"tenant-id": "CgN0dG4="
},
"visibility": {
"rights": [
"RIGHT_APPLICATION_TRAFFIC_READ",
"RIGHT_APPLICATION_TRAFFIC_READ"
]
},
"unique_id": "01FV2Y73NBX6P9CKZMK64Q2N3C"
}
so my question is, does any data arrive at TTN and, if so, where does it get lost?
thank you very much in advance!
Kilian