re-enable data with no GPS position
This commit is contained in:
@@ -95,11 +95,7 @@ func DecodePayload(s string, deveui string) {
|
|||||||
|
|
||||||
mystring := fmt.Sprintf("measurement,deveui=%s lat=%.5f,lon=%.5f,vbat=%d,fw=%d %d\n", deveui, float32(pl.Latitude)/1000000.0, float32(pl.Longitude)/1000000.0, vbat, fw, (time.Now().Unix() * 1000 * 1000 * 1000))
|
mystring := fmt.Sprintf("measurement,deveui=%s lat=%.5f,lon=%.5f,vbat=%d,fw=%d %d\n", deveui, float32(pl.Latitude)/1000000.0, float32(pl.Longitude)/1000000.0, vbat, fw, (time.Now().Unix() * 1000 * 1000 * 1000))
|
||||||
|
|
||||||
if pl.Longitude == 0 {
|
|
||||||
fmt.Printf("Meaurement without GPS Position: %s", mystring)
|
|
||||||
} else {
|
|
||||||
WriteStringToFile(mystring, deveui)
|
WriteStringToFile(mystring, deveui)
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Payload is not >= 11 bytes (22 chars): %s", s)
|
log.Printf("Payload is not >= 11 bytes (22 chars): %s", s)
|
||||||
|
|||||||
Reference in New Issue
Block a user