Difference between revisions of "M-bus Linux"

From Teknologisk videncenter
Jump to: navigation, search
m
m (Beagleboard)
Line 1: Line 1:
=Beagleboard=
+
=Beagleboard Black=
 +
==Installing libmbus==
 +
Upgrade and install dev tools [[Beaglebone Black/Updating]]
 +
<source lang=bash>
 +
git clone https://github.com/rscada/libmbus.git
 +
./build.sh
 +
./configure
 +
make
 +
sudo make install
 +
</source>
 +
==Getting started==
 +
 
 
Wires:  
 
Wires:  
 
*P9-11 ([[BeagleBoard|BBB]]-RX) to [https://www.mikroe.com/m-bus-master-click MIKROE-3880 M-BUS MASTER CLICK] TX
 
*P9-11 ([[BeagleBoard|BBB]]-RX) to [https://www.mikroe.com/m-bus-master-click MIKROE-3880 M-BUS MASTER CLICK] TX

Revision as of 09:50, 6 January 2023

Beagleboard Black

Installing libmbus

Upgrade and install dev tools Beaglebone Black/Updating

git clone https://github.com/rscada/libmbus.git
./build.sh
./configure
make 
sudo make install

Getting started

Wires:

Configure BBB GPIO for UART - /dev/ttyS4

sudo  config-pin  P9_11 uart
sudo  config-pin  P9_13 uart

Install libmbus - notice: ln -s /usr/local/lib/libmbus.so.0 /usr/lib/



mbus-serial-request-data-multi-reply -d /dev/ttyS4 68
main: debug: sending init frame
[2023-01-05 09:24:46] SEND (005): 10 40 FF 3F 16
[2023-01-05 09:24:47] SEND (005): 10 7B 44 BF 16
[2023-01-05 09:24:47] RECV (205): 68 C7 C7 68 08 44 72 68 43 35 80 2D 2C 35 0C 07 10 00 00 04 06 00 00 00 00 04 FF 07 00 00 00 00 04 FF 08 00 00 00 00 04 14 00 00 00 00 84 40 14 00 00 00 00 84 80 40 14 00 00 00 00 04 22 DF 07 00 00 34 22 00 00 00 00 02 59 A2 08 02 5D 5E 08 02 61 44 00 04 2D 00 00 00 00 14 2D 00 00 00 00 04 3B 00 00 00 00 14 3B 00 00 00 00 04 FF 22 00 01 00 00 04 6D 19 2B E5 21 44 06 00 00 00 00 44 FF 07 00 00 00 00 44 FF 08 00 00 00 00 44 14 00 00 00 00 C4 40 14 00 00 00 00 C4 80 40 14 00 00 00 00 54 2D 00 00 00 00 54 3B 00 00 00 00 42 6C E1 21 02 FF 1A 01 1B 0C 78 68 43 35 80 04 FF 16 E6 84 1E 00 04 FF 17 C1 D5 B4 00 B1 16
mbus_frame_print: Dumping M-Bus frame [type 4, 205 bytes]: 68 C7 C7 68 08 44 72 68 43 35 80 2D 2C 35 0C 07 10 00 00 04 06 00 00 00 00 04 FF 07 00 00 00 00 04 FF 08 00 00 00 00 04 14 00 00 00 00 84 40 14 00 00 00 00 84 80 40 14 00 00 00 00 04 22 DF 07 00 00 34 22 00 00 00 00 02 59 A2 08 02 5D 5E 08 02 61 44 00 04 2D 00 00 00 00 14 2D 00 00 00 00 04 3B 00 00 00 00 14 3B 00 00 00 00 04 FF 22 00 01 00 00 04 6D 19 2B E5 21 44 06 00 00 00 00 44 FF 07 00 00 00 00 44 FF 08 00 00 00 00 44 14 00 00 00 00 C4 40 14 00 00 00 00 C4 80 40 14 00 00 00 00 54 2D 00 00 00 00 54 3B 00 00 00 00 42 6C E1 21 02 FF 1A 01 1B 0C 78 68 43 35 80 04 FF 16 E6 84 1E 00 04 FF 17 C1 D5 B4 00 B1 16
<MBusData>

    <SlaveInformation>
        <Id>80354368</Id>
        <Manufacturer>KAM</Manufacturer>
        <Version>53</Version>
        <ProductName></ProductName>
        <Medium>Heat: Inlet</Medium>
        <AccessNumber>7</AccessNumber>
        <Status>10</Status>
        <Signature>0000</Signature>
    </SlaveInformation>

    <DataRecord id="0">
        <Function>Instantaneous value</Function>
        <Unit>Energy (kWh)</Unit>
        <Value>0</Value>
        <Timestamp>2023-01-05T09:24:47</Timestamp>
    </DataRecord>

    <DataRecord id="1">
        <Function>Instantaneous value</Function>
        <Unit>Manufacturer specific</Unit>
        <Value>0</Value>
        <Timestamp>2023-01-05T09:24:47</Timestamp>
    </DataRecord>

..................................................... DATA REMOVED ..................................
    <DataRecord id="29">
        <Function>Instantaneous value</Function>
        <Unit>Manufacturer specific</Unit>
        <Value>11851201</Value>
        <Timestamp>2023-01-05T09:24:47</Timestamp>
    </DataRecord>

</MBusData>