bieli / IoText-arduino

Arduino IoT library for IoText data protocol. You can build messages with any measuremens to use with MQTT or other data channels.
Apache License 2.0
0 stars 1 forks source link

Decoding values issue for all metric data types #6

Open bieli opened 8 months ago

bieli commented 8 months ago

Result after running decode example on device (ESP32):

Encoded payload: 
t|2900267526042,d|devie_id_x3,m|val=t:txt,m|metric_boolean1=b:1,m|metric_integer9=i:3333
---------

Decoded items:

type: item.kind │ name: 2900267526042

type: item.kind │ name: devie_id_x3

type: item.kind │ name: val
        ╘═══ metric -> type: t, value: 

type: item.kind │ name: metric_boolean1
        ╘═══ metric -> type: b, value: 0

type: item.kind │ name: metric_integer9
        ╘═══ metric -> type: i, value: 0

As you can see, values are empty, what is wrong in comparison to encoded payload (method get_value_as_str).

bieli commented 8 months ago

After merge https://github.com/bieli/IoText-arduino/issues/6 we have one value issue with decimal values (with correct precission):

Current report after decoding (decimal 1234567890.123 instead of 0.000000):

Decoded items:

type: t │ name: 2900267526042

type: d │ name: devie_id_x3

type: m │ name: val
        ╘═══ metric -> type: t, value: txt

type: m │ name: metric_name
        ╘═══ metric -> type: d, value: 0.000000            <----- HERE IS BUG !

type: m │ name: metric_boolean1
        ╘═══ metric -> type: b, value: 1

type: m │ name: metric_integer9
        ╘═══ metric -> type: i, value: 3333