HTTP integration end point

Hello everyone,

I’m using this PHP file with my HTTP integration,

<?php header("Content-type: application/json"); $json = file_get_contents("php://input"); $var = json_decode($json, true); $var2 = implode("|",$var); $dr = $var['dr']; $fCnt =$var['fCnt']; foreach($var['rxInfo'] as $value) { $loRaSNR =$value['loRaSNR']; $server = "localhost:3306"; $username = "root"; $password = ""; $DB = "loraserver"; } $conn = new mysqli($server, $username, $password,$DB); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $insert = "INSERT INTO loratable(snr, dr, fCnt) VALUES ('$loRaSNR', '$dr', '$fCnt')"; $conn->query($insert); My problem is when I use two gateways, the LoRaSNR from the two gateways comes under the same name, so somebody can help me how I can take both values separately. Thank you

Hi @antoine1992,

Why don’t you upload your uplink message that you receive in the HTTP integration with more than one gateway?

Here it is one uplink of an example of mine with 4 gateways and SNR is inside the array of each gateway, it is not the same for all of them.

{
"applicationID":"5",
"applicationName":"xxx",
"deviceName":"xxx",
"devEUI":"xxx",
"rxInfo":[
	{"gatewayID":"qEBBG2xoQVA=",
	"time":"2021-02-12T00:00:53.077685Z",
	"timeSinceGPSEpoch":null,
	"rssi":-96,
	"loRaSNR":-6,
	"channel":0,
	"rfChain":1,
	"board":0,
	"antenna":0,
	"location":{},
	"fineTimestampType":"NONE",
	"context":"VGUm7w==",
	"uplinkID":"RWryGVoZRZWAgK91Bgh7fw==",
	"crcStatus":"CRC_OK"},
	{"gatewayID":"qEBBHbkkQVA=",
	"time":"2021-02-12T00:00:53.076824Z",
	"timeSinceGPSEpoch":null,
	"rssi":-99,
	"loRaSNR":-1,
	"channel":0,
	"rfChain":1,
	"board":0,
	"antenna":0,
	"location":{},
	"fineTimestampType":"NONE",
	"context":"VGUjmA==",
	"uplinkID":"ZJyZF4W/RHiu9A050MJtRw==",
	"crcStatus":"CRC_OK"},
	{"gatewayID":"qEBBG3poQVA=",
	"time":"2021-02-12T00:00:53.076145Z",
	"timeSinceGPSEpoch":null,
	"rssi":-65,
	"loRaSNR":9,
	"channel":0,
	"rfChain":1,
	"board":0,
	"antenna":0,
	"location":{},
	"fineTimestampType":"NONE",
	"context":"VGUg8A==",
	"uplinkID":"goNDKhn1RNCWNsbU6l3qGA==",
	"crcStatus":"CRC_OK"},
	{"gatewayID":"qEBBG3pEQVA=",
	"time":"2021-02-12T00:00:53.074845Z",
	"timeSinceGPSEpoch":null,
	"rssi":-91,
	"loRaSNR":-1,
	"channel":0,
	"rfChain":1,
	"board":0,
	"antenna":0,
	"location":{},
	"fineTimestampType":"NONE",
	"context":"VGUb0w==",
	"uplinkID":"f/ijKaeDQnOxUy2RlLN8MA==","crcStatus":"CRC_OK"}
	],
"txInfo":{
	"frequency":868300000,
	"modulation":"LORA",
	"loRaModulationInfo":{"bandwidth":125,"spreadingFactor":7,"codeRate":"4/5","polarizationInversion":false}},
"adr":false,
"dr":5,
"fCnt":32654,
"fPort":6,
"data":"DdkGAAAQAg==",
"objectJSON":"",
"tags":{},
"confirmedUplink":false,
"devAddr":"JgEfEw=="
}