here is the root cause… from a UDP debug session we can see that LG01 is transmitting the frequency in HZ not in MHz, if we compare to the Raspberry GW:
PACKET UDP - RASPBERRY GW
20:39:34.962077 IP raspberrypi.NET0000.34797 > LORAS2.NET0000.1700: UDP, length 244
E…@.@…d…’…3 .{“rxpk”:[{“tmst”:878095390,"**freq":902.3,"**chan":0,“rfch”:0,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“rssi”:-66,“lsnr”:9.0,“size”:56,“data”:“QH0UASYAcgYCuWWOagYcVVKPBVHAWYQRvZJwwPd+FEXqald54+nmTCkMI8Mcya1/i8VakOrwKZA=”}]}
20:39:34.963025 IP LORAS2.NET0000.1700 > raspberrypi.NET0000.34797: UDP, length 4
PACKET UDP - LG01 GW
20:39:35.400504 IP dragino-18c048.NET0000.46586 > LORAS2.NET0000.1700: UDP, length 285
E…9…@.@…~…%…n…@A…H…{“rxpk”:[{“tmst”:878533759,“time”:“2018-05-01T00:39:35.408693Z”,“chan”:7,“rfch”:0,"freq":902300000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“lsnr”:7.8,“rssi”:-86,“size”:56,“data”:“QH0UASYAcgYCuWWOagYcVVKPBVHAWYQRvZJwwPd+FEXqald54+nmTCkMI8Mcya1/i8VakOrwKZA=”}]}
20:39:35.401143 IP LORAS2.NET0000.1700 > dragino-18c048.NET0000.46586: UDP, length 4
According to Semtech:
RXPK:
freq | number | TX central frequency in MHz (unsigned float, Hz precision)
… in the source code:
**source code : lora-gateway-bridge / internal / gateway / pf_structs.go **
line 507…: Frequency: int(rxpk.Freq * 1000000),
line 554…: Freq: float64(txPacket.TXInfo.Frequency) / 1000000,
Source code for RXPK:
rxPacket := gw.RXPacketBytes{
PHYPayload: b,
RXInfo: gw.RXInfo{
MAC: mac,
Timestamp: rxpk.Tmst,
Frequency: int(rxpk.Freq * 1000000),
Channel: int(rxpk.Chan),
RFChain: int(rxpk.RFCh),
CRCStatus: int(rxpk.Stat),
DataRate: dataRate,
CodeRate: rxpk.CodR,
RSSI: int(rxpk.RSSI),
LoRaSNR: rxpk.LSNR,
Size: int(rxpk.Size),
Board: int(rxpk.Brd),
},
}
Frequency: int(rxpk.Freq * 1000000),
UDP from RASPBERRY GW…: freq = 902.3 * 1000000 = 902300000
UDP from LG01…: freq = 902300000 * 1000000 = 902300000000000
so we obtain the frequency that doesn’t look right, too many digits.
… what’s the solution now … ?