A quick example of what the MBUS_Reader tool can do. After uploading to the Heatpump Monitor or Arduino with the M-Bus reader circuit, the following options should be presented:
Arduino M-Bus reader
- a: set mbus address to 100
- n: normalize
- r: request data
- c: application reset
- i: set id 1234
- b: set baudrate 4800
- p: select page eg: p1
Setting the M-Bus meter address
In the Arduino Serial Monitor enter character ‘a’ and press enter. If the meter receives the command it will reply with an acknowledgement (ACK). The MBUS address to set is hard coded in the MBUS_Reader firmware.
Command sent: set address 100
ACK
Normalise
Enter character ‘n’ and press enter. If the meter receives the command it will reply with an acknowledgement (ACK).
Command sent: normalize
ACK
Set page
Some M-Bus meters store multiple pages of results, to access pages other than 1 enter character ‘p’ with the page number immediately appended e.g: ‘p2’ and press enter. If the meter receives the command it will reply with an acknowledgement (ACK).
Command sent: page
Page: 3
ACK
Request data
To read a frame of data from the M-Bus meter, enter character ‘n’ and press enter. This is what the reply looks like from the third page of the Sontex 531 Heat Meter:
Command sent: request data
0 104 68 START
1 119 77 LEN
2 119 77 LEN
3 104 68 START
4 8 8 C FIELD
5 100 64 ADDRESS
6 114 72 CI FIELD
7 1 1 ID
8 2 2 ID
9 3 3 ID
10 4 4 ID
11 238 EE MID
12 77 4D MID
13 14 E Gen
14 4 4 Media
15 128 80 Access
16 0 0 Access
17 0 0 Signature
18 0 0 Signature
19 5 5 DIF 4
20 91 5B VIF Flow Temp C
21 128 80 DATA
22 24 18 DATA
23 191 BF DATA
24 65 41 DATA
25 5 5 DIF 4
26 95 5F VIF Return Temp C
27 0 0 DATA
28 103 67 DATA
29 194 C2 DATA
30 65 41 DATA
31 5 5 DIF 4
32 62 3E VIF Volume Flow m3/h
33 0 0 DATA
34 0 0 DATA
35 0 0 DATA
36 0 0 DATA
37 5 5 DIF 4
38 43 2B VIF Power W
39 0 0 DATA
40 0 0 DATA
41 0 0 DATA
42 0 0 DATA
43 1 1 DIF 1
44 255 FF VIF
45 7 7 VIFE
46 1 1 DATA
47 5 5 DIF 4
48 150 96 VIF
49 40 28 VIFE
50 153 99 DATA
51 147 93 DATA
52 133 85 DATA
53 56 38 DATA
54 5 5 DIF 4
55 255 FF VIF
56 1 1 VIFE
57 0 0 DATA
58 0 0 DATA
59 0 0 DATA
60 0 0 DATA
61 5 5 DIF 4
62 255 FF VIF
63 2 2 VIFE
64 0 0 DATA
65 0 0 DATA
66 0 0 DATA
67 0 0 DATA
68 1 1 DIF 1
69 255 FF VIF
70 4 4 VIFE
71 1 1 DATA
72 1 1 DIF 1
73 253 FD VIF
74 15 F VIFE
75 42 2A DATA
76 2 2 DIF 2
77 253 FD VIF
78 13 D VIFE
79 41 29 DATA
80 0 0 DATA
81 3 3 DIF 3
82 34 22 VIF Power 100 J/h
83 72 48 DATA
84 15 F DATA
85 0 0 DATA
86 1 1 DIF 1
87 112 70 VIF Duration seconds
88 3 3 DATA
89 130 82 DIF 2
90 137 89 DIFE
91 1 1 DIFE
92 253 FD VIF
93 37 25 VIFE
94 60 3C DATA
95 0 0 DATA
96 130 82 DIF 2
97 130 82 DIFE
98 3 3 DIFE
99 253 FD VIF
100 38 26 VIFE
101 24 18 DATA
102 0 0 DATA
103 2 2 DIF 2
104 236 EC VIF
105 126 7E VIFE
106 1 1 DATA
107 15 F DATA
108 194 C2 DIF 2
109 132 84 DIFE
110 1 1 DIFE
111 236 EC VIF
112 126 7E VIFE
113 1 1 DATA
114 7 7 DATA
115 130 82 DIF 2
116 133 85 DIFE
117 1 1 DIFE
118 236 EC VIF
119 126 7E VIFE
120 1 1 DATA
121 1 1 DATA
122 31 1F DIF 0
123 130 82 VIF CHECKSUM VALID
124 22 16 VIFEEND
Troubleshooting: If no acknowledgement is received make sure Arduino serial line ending is set to “Both NL & CR” and the serial monitor baudrate is set to 115200.
The reader currently implements a basic data packet decode. I’ve entered the vif codes for a small number of the potential variable types, see lines 201 to 215:
if (val==0x06) Serial.print("Energy kWh");
if (val==0x13) Serial.print("Volume 0.001m3");
if (val==0x14) Serial.print("Volume 0.01m3");
if (val==0x5b) Serial.print("Flow Temp C");
if (val==0x5f) Serial.print("Return Temp C");
if (val==0x3e) Serial.print("Volume Flow m3/h");
if (val==0x2b) Serial.print("Power W");
if (val==0x22) Serial.print("Power 100 J/h");
if (val==0x6D) Serial.print("TIME & DATE");
if (val==0x70) Serial.print("Duration seconds");
if (val==0x75) Serial.print("Duration minutes");
if (val==0x78) Serial.print("Fab No");
if (val==0x79) Serial.print("Enhanced");
If anyone finds the reader useful and would like to contribute further VIF details, I would welcome contributions.