Waziup / WaziGate

Waziup LoRa Edge gateway
21 stars 20 forks source link

wrong negative temperature values displayed in wazicloud project dashboard #143

Open SvenZeisberg opened 3 years ago

SvenZeisberg commented 3 years ago

waziup_wrong_negative_temp_values_dsiplay

In wazicloud project dashboard the negative temperature values of temp sensor are displayed wrong (see graph) --- Sensor was taken from Wazi-Starter-Kit, Wazidev was v1.3, Wazigate was v2.0.10. The error is easy to reproduce with any different devices ...so it is a systematic error. Probably it is a type conversion error either in wazidev or in wazigate ...hard to say, as there are no records of received numbers in wazigate.

SvenZeisberg commented 3 years ago

sorry WaziGate software version was v2.1.10

j-forster commented 3 years ago

Looks like a display error one the Wazicloud, @cdupont ? Should i move this issue to Waziup/WaziCloud?

cdupont commented 3 years ago

The bug is that the values "jumps"? Should it be continuous? Would be nice if you can copy the URL...

cdupont commented 3 years ago

The values seems to jump between negative integer positions: image For example in the graph aboveit jumps to -1, -2 and -3.

The values in the Cloud DB corresponds to the graph: image

So I don't think it's due to the Cloud UI.

cdupont commented 3 years ago

I did further tests with the WaziCloud, injecting fake data. Negative values seems to be handled well: Screenshot from 2021-03-16 15-25-35

So it's probably something at WaziGate level or WaziDev. @j-forster is there a way to retrieve the time series from the WaziGate of Sven? @Sven could you copy the WaziDev sketch?

cdupont commented 3 years ago

@j-forster can it be some encoding problem in XLPP? It looks like a float to int bit-shift conversion problem in XLPP :)

j-forster commented 3 years ago

Wazigate pushes data every few minutes as a bulk upload. Did you do your tests using the bulk values import or did you send the values one by one? Maybe there is a problem at that endpoint - maybe reverting the values or the timestamps somehow.

The bulk import has a timestamp for each value that is generated in Wazigate edge with each values when it's received. The value is uploaded together with that timestamp, so I don't see how this could result in reverted chunks.

j-forster commented 3 years ago

If it's a problem with XLPP (which was not in production when @SvenZeisberg received the first values on Feb. 13) the error would occur on a per-value basis, not on continuous chunks. So it is either a bug at the cloud-sync procedure at the wazigate-edge or it is on the cloud.

cdupont commented 3 years ago

The sensor is this one: http://dashboard.waziup.io/devices/6021c4477845240006d5d429/sensors/temperatureSensor_1

The jumps occurs every few hours, when crossing an integer value. So I don't think it's about the bulk upload.

j-forster commented 3 years ago

I see. Yes, the problem must be somewhere in the Wazigate or Wazidev.

Decoding LPP was handled by Chirpstack at that time.

What libraries are you using with the Wazidev @SvenZeisberg? Is it the XLPP library or the LPP library?

cdupont commented 3 years ago

Between two negative integers, the curves goes in the wrong direction (e.g. up instead of down), and then jumps back to the right integer. You can obtain the same behavior in your browser javascript console (just having fun):

x = -2.1; Math.floor(x) + Math.abs(x % 1)
-2.9

So I suspect something in XLPP... Maybe here??? https://github.com/Waziup/arduino-xlpp/blob/main/src/xlpp.cpp#L30