Hacky integration for M-Bus

@the78mole, hi Daniel,

your response has given me the knowledge I did not have and inspired to search deeper for the reasons behind my problems.

In short - I got it working, huge thanks! :slight_smile:

The details of my journey:
/1. I checked the voltage on the capacitor as you suggested and got 28V there:

/2. Your text “If this is not the case, the step-up converter is not starting. You should find a datasheet for the IC and look out for enable signal, measure it and find the root cause, if it is deactivated.” has made me do the RTFM and I paid attention to this item in the specs of my MBUS-TTL module:

6, TTLVCC: TTL level voltage input, can not be left floating, you must input TTL level voltage

I have to say I had previously connected ONLY GND and VIN terminals to 14V, leaving others ‘floating’.
Needless to say, connecting all terminals (TTLVCC, RXD, TXD) has solved my problem and I started getting 27.5V on MBUS terminals!

/3. Then I installed libmbus as per instructions on your blog.
Scanning for connected devices gave some response, which gave hope that some communication is happening, but no meaningful results - i.e. no physical or secondary addresses:

paulius:~/libmbus$ mbus-serial-scan -b 2400 /dev/ttyUSB0
Collision at address 162
Collision at address 168
Collision at address 173
paulius:~/libmbus$ mbus-serial-scan -b 2400 /dev/ttyUSB0
Collision at address 55
paulius:~/libmbus$ mbus-serial-scan -b 2400 /dev/ttyUSB0
Collision at address 0
paulius:~/libmbus$ mbus-serial-scan-secondary -b 2400 /dev/ttyUSB0

I then did RTFM again - I checked the the specs of my heating meter Ista sensonic II mbus:

It gave me two pointers:
a. by long-pressing the button I can go to the third display loop and find out the M-bus address:

b. detailed info regarding baud rates:

This brought me to the function call:
paulius:~/libmbus$ mbus-serial-request-data -b 300 /dev/ttyUSB0 85

And soon thereafter came the response:

<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>

    <SlaveInformation>
        <Id>16</Id>
        <Manufacturer>RKE</Manufacturer>
        <Version>105</Version>
        <ProductName>Ista sensonic II mbus</ProductName>
        <Medium>Heat: Outlet</Medium>
        <AccessNumber>226</AccessNumber>
        <Status>02</Status>
        <Signature>0000</Signature>
    </SlaveInformation>

[...]

Scanning for addresses with 300 baud rate gives results:

paulius:~/libmbus$ mbus-serial-scan -b 300 /dev/ttyUSB0
Found a M-Bus device at address 85


So now - the “only” thing left is to bring libmbus libraries to ESPHome? :smiley:

Once again big thanks for the guidance and hoping you can find some time for that new endeavor.

2 Likes