You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is present in master and 3.16.2, I do not know if master is the latest release
I have searched the issues of this repository and believe that this is not a duplicate.
What happened?
When a gateway has an altitude of 0m, its other coordinates are not updated, even if they are not zeroes.
It looks logical from the code:
in chirpstack-network-server/internal/storage/gateway.go
around line 366
// UpdateGatewayState updates the location of the gateway and last seen ts.funcUpdateGatewayState(ctx context.Context, db sqlx.Execer, id lorawan.EUI64, lat, lon, altfloat64) error {
varloc*GPSPointvaraltt*float64iflat!=0&&lon!=0&&alt!=0 {
loc=&GPSPoint{
Latitude: lat,
Longitude: lon,
}
altt=&alt
}
now:=time.Now()
// * only update first_seen_at when the current value is NULL// * only update the location when the given value is not NULL// * only update the altitude when the given value is not NULL
What did you expect?
I expect that an altitude of 0m does not prevent a gateway gps coordinates to be updated.
So I expect to have OR and not AND in the test:
iflat!=0||lon!=0||alt!=0 {
since I would expect that only the default coordinates (0,0,0) will cause coordinates not to be updated [poor ships cruising the Gulf of Guinea by the way ...]
And as altitude is coded as an integer (if I read correctly the packet_forwarder protocol) it might even be the case for a gateway 40cm above sea level (a buoy for instance).
Steps to reproduce this issue
Steps:
Make a gateway publish stats like that: {"stat":{"time":"2022-06-13 12:46:27 GMT","lati":48.5777965,"long":7.7497201,"alti":0,"rxnb":0,"rxok":0,"rxfw":0,"ackr":0,"dwnb":3,"txnb":0}}
gateway latitude and longitude won't be updated.
Your Environment
Component
Version
Application Server
v3.15.0
Network Server
v3.13.0
Gateway Bridge
v3.11.0
Chirpstack API
Geolocation
Not installed
Concentratord
Not installed
The text was updated successfully, but these errors were encountered:
What happened?
When a gateway has an altitude of 0m, its other coordinates are not updated, even if they are not zeroes.
It looks logical from the code:
in chirpstack-network-server/internal/storage/gateway.go
around line 366
What did you expect?
I expect that an altitude of 0m does not prevent a gateway gps coordinates to be updated.
So I expect to have OR and not AND in the test:
since I would expect that only the default coordinates (0,0,0) will cause coordinates not to be updated [poor ships cruising the Gulf of Guinea by the way ...]
And as altitude is coded as an integer (if I read correctly the packet_forwarder protocol) it might even be the case for a gateway 40cm above sea level (a buoy for instance).
Steps to reproduce this issue
Steps:
Your Environment
The text was updated successfully, but these errors were encountered: