logo elektroda
logo elektroda
X
logo elektroda

W-MBUS protocol reading in APATOR water meters - encryption and documentation

mks 48300 70
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16292625
    mks
    Level 11  
    Hi,

    Has anyone of you ever played with reading the MBUS protocol (W-MBUS / Wireless MBUS)? I would be particularly interested in reading water meters of Polish manufacturers with the emphasis on APATOR water meters.

    So far I have looked at the frames sent by 2 different water meter manufacturers and I can see significant differences in their length.

    And the second question - using W-MBUS/MBUS and supporting the standard, can the manufacturers encrypt the transmission? And what is the issue with manufacturers sharing documentation? Do you have any experience on this topic?

    Edit: After a quick reconnaissance I see that:
    - Apator encrypts part/all of the frame with AES-128.
    - Manufacturers are reluctant to share information.

    Therefore, let me ask an additional question:
    - does anyone know of a manufacturer who is willing to share information about what and how their water meter sends?
    - Do any of you have any information on any manufacturer's frames?

    Edit2: I might save someone time and money:
    - the proxy on the radio overlay is read-protected. This was to be expected, but I wanted to check anyway (year ~2015).
    - Most likely (99.9%) the encryption and decryption is done on the hardware (overlay/reader device). The software is only for data collection.
    - older version of software written in .NET and not protected against decryption (year ~2009).
    - of the unencrypted information in the box is the overlay number
    - reportedly... (completely unverified information and not really sure what it refers to) something/someone/somewhere/somehow used only zeros as the AES-128 key....
  • ADVERTISEMENT
  • #2 16322385
    retrofood
    VIP Meritorious for electroda.pl
    mks wrote:
    .
    - Manufacturers reluctant to share information.
    .
    I do not know what the situation is with water meters, but the subject of electricity meters does not encourage optimism. Energy suppliers are reluctant to share even the information necessary for the user, and knowledge of the full capabilities of the meters is more secret than military weapons. Few employees of the supplier have access to it and that's the end of it. The monopoly cannot be broken.
  • #3 16323207
    mks
    Level 11  
    However, one can understand the fear of tampering with the readout....
    The desire to make money from the readout software and hardware also remains.
    In any case, if anyone would like to see what the electronics from the radio overlay look like then the pictures are attached ;)
  • #4 16323304
    TvWidget
    Level 38  
    Why do you need this information?
    External solutions are available for most meters to duplicate the radio chip inside.
  • #5 16323307
    mks
    Level 11  
    To write software to read water meters. Unfortunately I am reliant on apator and tenn does not want to share data.
  • #6 16425970
    ShEvU_elektro
    Level 25  
    The manufacturer declares that you can change the AES key when you know the previous one.
    In that case, the new overlay, which costs 93 net, has an AES key that is reset to zero.

    I wonder if there is the possibility of some kind of key reset when you have physical access to the overlay.... Have you asked the manufacturer ?

    P.S I myself am trying to master remote reading.

    P.S 2 - can you write the symbol of the radio chip ? Looks to me like some CC11xx

    P.S 3 - don't you have more of these working overlays ? I would be happy to buy back for a small amount of money :)
  • #7 16426033
    mks
    Level 11  
    ShEvU_elektro wrote:
    I wonder if there is the possibility of some kind of key reset when you have physical access to the overlay.... Have you asked the manufacturer ?
    .
    No, I have not asked.

    ShEvU_elektro wrote:
    P.S I am trying to master remote reading myself.
    .
    I see it poorly from my experience unfortunately.... But I hope you will share the information, whatever it may be :)

    ShEvU_elektro wrote:
    P.S 2 - can you write the radio chip symbol ? Looks to me like some CC11xx
    .
    I have it somewhere, I asked on the ST forum myself.

    ShEvU_elektro wrote:
    P.S 3 - don't you have more of these working overlays ? I would be happy to repurchase for very little money :)
    .
    The one I bought for myself was "uceglified" (I reset the program with the ST-Link programmer). I bought it on the most well-known auction portal for circa 50zł + shipping including water meter.

    The current situation is that I have (and will have) access to both the reading/programming device and the programmes. If you're patient I'll write something about it when I find the time to test it. More likely it will be after May.

    To be honest I don't think the default overlay key should be zeros alone. Of course I could be wrong, but I can provide you with example readings of several of the same overlays that differ only in date/time. If it was as you say then it would be possible to read these frames.

    If there is an opportunity to work out how it works then I will try to do it. I think then already with a piece of my own software.
  • #8 16426272
    ShEvU_elektro
    Level 25  
    As far as I can see it is the SPIRIT1 chip from ST.

    I have already ordered two counters. I'm looking for one more to use the overlay as a dev-board.
  • #9 16426302
    mks
    Level 11  
    ShEvU_elektro wrote:
    From what I can see this is the SPIRIT1 chip from ST.
    .
    Yes, that's the one. At least that's what they told me on the ST forum.

    Edit:
    ShEvU_elektro wrote:
    In that case, the new overlay, which costs 93 net, has an AES key that is reset.

    Actually, the new overlay has by default an AES key consisting of only zeros.
  • ADVERTISEMENT
  • #10 16432683
    ShEvU_elektro
    Level 25  
    mks wrote:
    I honestly don't think the default overlay key should be zeros alone. Of course I could be wrong, but I can provide you with example readings of several of the same overlays that differ only in date/time. If it was as you say then it would be possible to read these frames.
    .
    I would be very happy to look at this data.
  • #12 16432776
    ShEvU_elektro
    Level 25  
    Super. Thanks.
    Did you get hold of any wm-bus documentation yet ?

    Can you provide the ID of the overlay whose frames are in this file ?

    My meters will arrive in the days, so I will also fight :-)
  • #13 16432824
    mks
    Level 11  
    So off the top of my head I won't tell you. On another example I can, but when I get home.
    But generally it's that yellow A-Field.
    As you have the value: 53 83 07 01 05 07 it generally reads "backwards". Something like 50 10 70 38 53. You have the overlay number on the overlay itself and on the PCB (where the QR code is).

    As for the documentation, all of it is on the internet, but trying to decipher it without knowing what is being sent is a breakneck thing. There is a lot of this stuff in Apator.
  • #14 16432851
    ShEvU_elektro
    Level 25  
    Ok I understand. What did you use to collect the frames ?
  • #15 16432853
    mks
    Level 11  
    ADEUNIS DONGLE USB WMBUS AMR + software from the same company (free of charge, after prior e-mail contact).
    You might as well use any terminal (e.g. Termite), because everything goes over COM.
  • #16 16852759
    nyczz
    Level 2  
    Request to "mks" - is it possible to contact privately? i have some questions on the subject.
  • #17 16852920
    mks
    Level 11  
    nyczz wrote:
    Request to "mks". - is it possible to contact privately? i have some questions on the subject.
    .
    Privately you can, but if it's public then maybe someone else will benefit. I leave the decision to you.
  • #18 16853966
    pol102
    VIP Meritorious for electroda.pl
    I'm just sitting on the topic, but this can probably be worked out quicker. Knowing that a regular overlay needs a converter to rs232.... you can force read.... I don't think the radio version is significantly(anyhow) different from the one on the cable.
  • ADVERTISEMENT
  • #19 16854044
    mks
    Level 11  
    pol102 wrote:
    I'm just sitting on the topic, but this can probably be worked out quicker. Knowing that a regular overlay needs a converter to rs232.... It is possible to force read ... I don't think the radio version is significantly(anyhow) different from the one on the cable.


    Will you elaborate on your thought? Because I don't quite understand two things - how can you force read? AND how is it supposed to be faster?
  • #20 16854293
    ShEvU_elektro
    Level 25  
    pol102 wrote:
    I'm just sitting on the topic, but this can probably be worked out quicker. Knowing that a regular overlay needs a converter to rs232.... It is possible to force read ... I don't think the radio version is significantly(anyhow) different from the one on the cable.

    The colleague is a bit mistaken. The protocol itself is a bit similar to M-BUS, but only a bit. WM-BUS is governed by slightly different rules when it comes to communication.
  • ADVERTISEMENT
  • #21 16854306
    mks
    Level 11  
    And I still have no idea what knowledge of RS232/M-BUS/WM-BUS has to do with real reading (not to mention communication)? Knowing the protocol is not the same as being able to interpret the data.

    First you need to know what the frame looks like and what is contained in it. And this is unknown, because the frame can vary depending on the configuration of the overlay.

    In my opinion, you can:
    - try to decipher the framework by changing the configuration of the overlay (and for that you need their tools)
    - decompile their software (basically an Android app) and try to see what it looks like in code.

    Or both. Either way, even with access to the device, overlay and software, it's not going to be that quick to sit down in one evening and figure out what's what.

    Am I wrong somewhere in my reasoning?
  • #22 16857215
    nyczz
    Level 2  
    Request to "mks" - please contact me at "a.polak18@onet.pl".
  • #23 16857443
    mks
    Level 11  
    nyczz wrote:
    Proposal to "mks" - please contact me at "a.polak18@onet.pl".
    .

    Use private message.
  • #24 16994688
    tmf
    VIP Meritorious for electroda.pl
    The topic seems to have died a little, but maybe it is worth refreshing. I have an overlay on a water meter from Apator, I would like to read current water consumption from it precisely for HA purposes and detection of possible problems (leaking installation, anomalies in water consumption). Is this part of the meter information transmitted unencrypted or is it encrypted with AES?
    Any progress on decoding the frame and receiving it? Will radio modules on 868 MHz receive such a frame? I am thinking, for example, of a simple RFM22 or related?
    Assuming the pessimistic variant - the whole thing is encrypted. Has anyone processed getting an AES key from the water supplier? Overall, the water meter belongs to the property owner, from which it would follow that they have to share the key as it's my device.
  • #25 16996548
    ShEvU_elektro
    Level 25  
    tmf wrote:
    Is this part of the counter information transmitted unencrypted or is it AES encrypted?
    .
    Overlays always have AES CBC encryption enabled. The new overlay has the key set to 16 zeros.
    All data is encrypted - obviously this does not apply to the frame header and CRC fields.
    tmf wrote:
    Assuming the pessimistic variant - all is encrypted. Has anyone processed getting an AES key from the water supplier?
    .
    The supplier or operator will not give you the key because then you could change the overlay configurations - delete alarms too (e.g. magnetic field detection).
    P.S. The key can be extracted - however, interference with the overlay is required.

    tmf wrote:
    Will radio modules on 868 MHz receive such a frame? I am thinking for example of the simple RFM22 or related ones?
    .
    I intend to attempt to fire up WMBUS on RFM69 in the near future.
  • #26 16996562
    tmf
    VIP Meritorious for electroda.pl
    ShEvU_elektro wrote:
    tmf wrote:
    Assuming the pessimistic option - the whole thing is encrypted. Has anyone processed getting an AES key from the water supplier?

    The supplier or operator will not give you the key, because then you could change the overlay configurations - delete alarms too (e.g. magnetic field detection).
    P.S. The key can be extracted - however, interference with the overlay is required. 27a4669bb .

    This is the supplier's problem. Legally the device belongs to me, so they have no right to refuse me, in particular I can buy such a module myself directly, put it on, and they will just put a seal on the meter for me. Of course, I can probably end up with a letter of claim from the law firm and only then will they give in, but of course I don't really want to fire a cannon at a fly.
    On the other hand, as I know life, probably nobody has changed the default key :) .

    ShEvU_elektro wrote:
    tmf wrote:
    Will radio modules on 868 MHz receive such a frame? I am thinking for example of a simple RFM22 or related?


    I intend to attempt to fire up WMBUS on RFM69 in the near future.27a4669bb

    Please brag about your progress. I'd be happy to join in and help if possible and time allows.
  • #27 16997272
    ShEvU_elektro
    Level 25  
    tmf wrote:
    Brag about your progress. I'll be happy to join in and help if possible and time allows.


    Confidence. I'll try to get the configuration right for RFM69, as that's what I'd ultimately like to run this on.
    I want to finish the API for their frames first.

    BTW. unlike Apator, the WMBUS overlays from BMeters I see are OMS compliant, so you can easily interpret the data from them :)
  • #28 16997304
    tmf
    VIP Meritorious for electroda.pl
    On which MCU are you writing the service?
  • #29 16997602
    mks
    Level 11  
    ShEvU_elektro wrote:
    P.S. The key can be extracted - however, interference with the overlay is required.
    .

    How?
  • #30 16998615
    ShEvU_elektro
    Level 25  
    tmf wrote:
    What MCU are you writing support on?
    .
    For the moment, the API is being written in Python on the PC - while I 'play' with the overlays.
    Once I've got everything done, I'll then rewrite it in C to add it to my device I'm working on :) It's based on STM32.

Topic summary

The discussion focuses on reading W-MBUS (Wireless M-Bus) protocol data from Polish water meters, particularly those manufactured by APATOR. Users report significant variability in frame lengths and note that APATOR employs AES-128 encryption (AES CBC mode) on most or all data fields, except for frame headers and CRC. The AES key for new overlays is often set to 16 zero bytes by default, but suppliers typically do not share encryption keys or detailed protocol documentation, citing security and anti-tampering concerns. Physical access and interference with the overlay hardware may allow key extraction, but this is complex and legally sensitive. Some users have reverse-engineered parts of the frame structure, identifying standard W-MBUS fields (SOF, length, CField, MField, AField, CIField) and manufacturer-specific data blocks containing encrypted consumption and status information. Tools used include ADEUNIS USB WMBUS dongles, RTL-SDR receivers, and software such as Inkasent PC3 and open-source projects like wmbusmeters on GitHub. The SPIRIT1 and CC1101 radio chips are commonly found in overlays. Other manufacturers like BMeters provide OMS-compliant frames, which are easier to interpret. Attempts to read APATOR meters with alternative radio modules (e.g., RFM22, RFM69) and LoRaWAN networks are ongoing. Some users develop custom software APIs in Python and C for frame decoding. Overall, the community faces challenges due to encryption, proprietary data formats, and limited manufacturer cooperation, but progress is made through reverse engineering and open-source tools.
Summary generated by the language model.
ADVERTISEMENT