Conversion error: meters-centimeters


#1

First post! :clap:

I’m sending the following measurement, taken from the sample code for ESP8266:
Cayenne.virtualWrite(3, 50, TYPE_PROXIMITY, UNIT_CENTIMETER);

When I view it in my web dashboard (Chrome Version 58.0.3029.110 (64-bit) on Macbook), it shows 50cm as expected. However, when I change the display to show meters, it shows 5000.00, rather than 0.50. Seems that the conversion is going the wrong way.


#2

Hi @beerreason, and welcome to the Cayenne Community. A first post, and a good one, as this was easily reproduced. Clearly an error in our conversion. I’ll write up a bug to get that fixed, in the meantime, you can pass the correct value directly in meters using UNIT_METER to work around this.


#3

Thanks; no real need for the conversion on my end; I just got started with Cayenne and was exploring the capabilities with dummy data and sample code. Might be some flaky behavior on degC/degF conversions, too, but I’ll narrow it down and post it separately if confirmed.