rscada / libmbus

Meter-bus library and utility programs
http://www.rscada.se/libmbus
BSD 3-Clause "New" or "Revised" License
217 stars 137 forks source link

Incorrect handling of extended value information fields (VIFEs) #82

Open delreich opened 9 years ago

delreich commented 9 years ago

Meter: Sensus PolluStat (3rd party provided mbus documentation here) libmbus version: built from 53d66c3dd551eed467876760f9b27d775442cea0

Extended VIB BE 50 is reported by mbus-serial-request-data as "Volume Flow ( m^3/h)" rather than "Duration of lower limit exceed for volume flow ( s)" (or however it would be phrased). Same issue for VIB BE 58 ("upper limit").

Trimmed XML output:

<MBusData>

    <SlaveInformation>
        <Id>11788</Id>
        <Manufacturer>SEN</Manufacturer>
        <Version>6</Version>
        <ProductName></ProductName>
        <Medium>Heat / Cooling load meter</Medium>
        <AccessNumber>61</AccessNumber>
        <Status>00</Status>
        <Signature>0000</Signature>
    </SlaveInformation>

    <!-- Data records 0-11 -->

    <DataRecord id="12">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Unit>Volume flow ( m^3/h)</Unit>
        <Value>11582321</Value>
        <Timestamp>2015-04-07T12:50:36</Timestamp>
    </DataRecord>

    <DataRecord id="13">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Unit>Volume flow ( m^3/h)</Unit>
        <Value>756</Value>
        <Timestamp>2015-04-07T12:50:36</Timestamp>
    </DataRecord>

    <!-- Data records 14-15 -->

</MBusData>

Debug output:

[2015-04-07 12:50:48] SEND (005): 10 40 FD 3D 16
[2015-04-07 12:50:49] SEND (005): 10 40 FD 3D 16
[2015-04-07 12:50:49] SEND (005): 10 5B 04 5F 16
[2015-04-07 12:50:49] RECV (119): 68 71 71 68 08 04 72 88 17 01 00 AE 4C 06 0D 3E 00 00 00 04 6D 3B 0E E7 14 34 6D 00 00 01 01 34 FD 17 00 00 00 04 04 20 92 22 F1 00 04 24 A4 1A E7 00 04 86 3B 97 9B 00 00 04 13 BE 09 5E 00 05 2E B1 D1 2E BE 05 3E F5 B8 4E 40 05 5B B8 2D F9 41 05 5F 78 8B F9 41 05 63 00 80 3B BD 04 BE 50 71 BB B0 00 04 BE 58 F4 02 00 00 0C 78 88 17 01 00 02 7F 10 B5 5D 16
lategoodbye commented 9 years ago

@delreich

Thanks for reporting this issue. Unfortunately libmbus isn't able to handle real VIFE (apart from $FB and $FD). At first we should report some kind of error.

Nevertheless i started working on this feature. If you are interested then i could commit my current state in a branch of my fork.