Giter VIP home page Giter VIP logo

Comments (10)

weetmuts avatar weetmuts commented on June 28, 2024

The HEX is the actual bytes sent/received and what you see being transmitted over the serial lines.
And (w)mbus always sends with the least significant byte first.

The value presented to the right is the HEX bytes properly decoded. I.e. the dataformat specifier DIF is applied to the raw data bytes and the value is then scaled using the VIF.

So, this is as it should be. :-)

from wmbusmeters.

weetmuts avatar weetmuts commented on June 28, 2024

By the way, you should not build new drivers in source. Check these out:
https://github.com/wmbusmeters/wmbusmeters-drivers/tree/main/wmbusmeters.drivers.d

Create your own mydriver.xmq and run
wmbusmeters 1244112233445566...... MyWater mydriver.xmq ANYID NOKEY

from wmbusmeters.

kzajac83 avatar kzajac83 commented on June 28, 2024

Thx Fredrik, I will close the issue but before do this will continiu regarding the driver - there are some documentation how build xmq ?

BTW - there are bug, if you use [TAB] in xmq file then get below error, if use one or many [SPACE] then pass, no error.

root@wyse:/etc/wmbusmeters.drivers.d# wmbusmeters --debug --pollinterval=60s --ppjson --format=json /dev/ttyUSB0:mbus:2400 counter atna01.xmq 00051728 NOKEY
(drivers) added builtin driver elster
(drivers) added builtin driver iperl
(driver) error loading wmbusmeters driver file atna01.xmq
atna01.xmq:7:1: error: unexpected tab character (remember tabs must be quoted)
        mvt = APA,03,07

Additional seems you need pass full path to the xmq driver or be in /etc/wmbusmeters/wmbusmeters.drivers.d/ directory if use just driver_name.xmq

from wmbusmeters.

kzajac83 avatar kzajac83 commented on June 28, 2024

PS. And seems xmq is not working with real devices because below working and give some answer and correct values:

wmbusmeters --debug "6856566808017228170500010603073CFA00000C7828170500046D012E123304134D020000023B00004413F9010000426C01330227E80B03FD171E030004FF0A0404010002FF0B975B03FF0C0800C30F0001121BFF00020201000B16" licznik atna01.xmq 00051728 NOKEY

but this now work:

wmbusmeters --debug --pollinterval=60s /dev/ttyUSB0:mbus:2400 licznik atna01.xmq 00051728 NOKEY

because log is: (due to no answer after more than 30s put ctrl+c)

(drivers) added builtin driver elster
(drivers) added builtin driver iperl
(driver) loading driver atna01 from file atna01.xmq
(driver) register detection atna01.xmq APA  7 03
(driver) register detection atna01.xmq APA  3 07
(drivers) newly loaded driver atna01.xmq overrides builtin driver
(wmbusmeters) version: 1.16.1-12-g1f2cd10
(config) using device: /dev/ttyUSB0:mbus:2400
(config) number of meters: 1
(config) template licznik 00051728 atna01
(lookup) with file/hex "/dev/ttyUSB0" mbus
(lookup) driver: mbus
(main) opening /dev/ttyUSB0:mbus:2400
Started config mbus on /dev/ttyUSB0
(mbus) on /dev/ttyUSB0
(serial) EVENT thread interrupted
(serial) before config: /dev/ttyUSB0 speed(B2400) input() output() control(CLOCAL|CREAD|CSIZE|PARENB) local() special_chars() modem(DTR|RTS)
(serial) after config:  /dev/ttyUSB0 speed(B2400) input() output() control(CLOCAL|CREAD|CSIZE|PARENB) local() special_chars() modem(DTR|RTS)
(serialtty) opened /dev/ttyUSB0 fd 3 (mbus)
Sending NKE to mbus
(serial /dev/ttyUSB0) sent "1040004016"
(serial) EVENT thread interrupted
(serial) received binary "E5"
(mbus) checkMBUSFrame
 "E5"
(mbus) received E5 single byte frame.
(mbus) checkMBUSFrame
 ""
(mbus) less than 6 bytes, partial frame
(main) regular reset of mbus  on /dev/ttyUSB0 will happen every 82800 seconds
(wmbus) no alarm (expected activity) for mbus
(serial) registered regular callback HOT_PLUG_DETECTOR(0) every 2 seconds
(serial) waiting for stop
^C(serial) stopping manager
(serial) MAIN thread interrupted
(serial) closing 1 devices
(serial) TIMER thread interrupted
(serial) EVENT thread interrupted
(serial) event loop stopped!
(wmbus) disconnected /dev/ttyUSB0 mbus
(serialtty) closed /dev/ttyUSB0 (mbus)
(wmbus) deleted mbus
(serial) closing 1 devices

When use build-in driver then the same command give me answer from water counter

wmbusmeters --debug  --pollinterval=60s --ppjson --format=json /dev/ttyUSB0:mbus:2400 licznik atna01 00051728 NOKEY
(drivers) added builtin driver elster
(drivers) added builtin driver iperl
(wmbusmeters) version: 1.16.1-12-g1f2cd10
(config) using device: /dev/ttyUSB0:mbus:2400
(config) number of meters: 1
(config) template licznik 00051728 atna01
(meter) created licznik atna01 00051728 encrypted
(lookup) with file/hex "/dev/ttyUSB0" mbus
(lookup) driver: mbus
(main) opening /dev/ttyUSB0:mbus:2400
Started config mbus on /dev/ttyUSB0
(mbus) on /dev/ttyUSB0
(serial) EVENT thread interrupted
(serial) before config: /dev/ttyUSB0 speed(B2400) input() output() control(CLOCAL|CREAD|CSIZE|PARENB) local() special_chars() modem(DTR|RTS)
(serial) after config:  /dev/ttyUSB0 speed(B2400) input() output() control(CLOCAL|CREAD|CSIZE|PARENB) local() special_chars() modem(DTR|RTS)
(serialtty) opened /dev/ttyUSB0 fd 3 (mbus)
Sending NKE to mbus
(serial /dev/ttyUSB0) sent "1040004016"
(serial) EVENT thread interrupted
(serial) received binary "E5"
(mbus) checkMBUSFrame
 "E5"
(mbus) received E5 single byte frame.
(mbus) checkMBUSFrame
 ""
(mbus) less than 6 bytes, partial frame
(main) regular reset of mbus  on /dev/ttyUSB0 will happen every 82800 seconds
(wmbus) no alarm (expected activity) for mbus
(serial) registered regular callback HOT_PLUG_DETECTOR(0) every 2 seconds
(serial) waiting for stop
(meter) secondary addressing bus  to address 00051728
(serial /dev/ttyUSB0) sent "680B0B6873FD5228170500FFFFFFFF0216"
(serial) EVENT thread interrupted
(serial) received binary "E5"
(mbus) checkMBUSFrame
 "E5"
(mbus) received E5 single byte frame.
(mbus) checkMBUSFrame
 ""
(mbus) less than 6 bytes, partial frame
(meter) polling licznik 00051728 (secondary) with req ud2 bus
(serial /dev/ttyUSB0) sent "105BFD5816"
(serial) EVENT thread interrupted
(serial) received binary "68"
(mbus) checkMBUSFrame
 "68"
(mbus) less than 6 bytes, partial frame
(serial) received binary "56"
(mbus) checkMBUSFrame
 "6856"
(mbus) less than 6 bytes, partial frame
(serial) received binary "56"
(mbus) checkMBUSFrame
 "685656"
(mbus) less than 6 bytes, partial frame
(serial) received binary "68"
(mbus) checkMBUSFrame
 "68565668"
(mbus) less than 6 bytes, partial frame
(serial) received binary "08"
(mbus) checkMBUSFrame
 "6856566808"
(mbus) less than 6 bytes, partial frame
(serial) received binary "01"
(mbus) checkMBUSFrame
 "685656680801"
(mbus) not enough bytes, partial frame 6 92
(serial) received binary "72"
(mbus) checkMBUSFrame
 "68565668080172"
(mbus) not enough bytes, partial frame 7 92
(serial) received binary "28"
(mbus) checkMBUSFrame
 "6856566808017228"
(mbus) not enough bytes, partial frame 8 92
(serial) received binary "17"
(mbus) checkMBUSFrame
 "685656680801722817"
(mbus) not enough bytes, partial frame 9 92
(serial) received binary "05"
(mbus) checkMBUSFrame
 "68565668080172281705"
(mbus) not enough bytes, partial frame 10 92
(serial) received binary "00"
(mbus) checkMBUSFrame
 "6856566808017228170500"
(mbus) not enough bytes, partial frame 11 92
(serial) received binary "01"
(mbus) checkMBUSFrame
 "685656680801722817050001"
(mbus) not enough bytes, partial frame 12 92
(serial) received binary "06"
(mbus) checkMBUSFrame
 "68565668080172281705000106"
(mbus) not enough bytes, partial frame 13 92
(serial) received binary "03"
(mbus) checkMBUSFrame
 "6856566808017228170500010603"
(mbus) not enough bytes, partial frame 14 92
(serial) received binary "07"
(mbus) checkMBUSFrame
 "685656680801722817050001060307"
(mbus) not enough bytes, partial frame 15 92
(serial) received binary "3E"
(mbus) checkMBUSFrame
 "6856566808017228170500010603073E"
(mbus) not enough bytes, partial frame 16 92
(serial) received binary "FA"
(mbus) checkMBUSFrame
......

BR, Krzysiek

from wmbusmeters.

weetmuts avatar weetmuts commented on June 28, 2024

Can you post your new xmq driver please? Then I can test what you have written.
The xmq format is documented here: https://libxmq.org

from wmbusmeters.

weetmuts avatar weetmuts commented on June 28, 2024

tna01.xmq:7:1: error: unexpected tab character (remember tabs must be quoted)

I have improved the error message in future releases of xmq:
case XMQ_ERROR_UNEXPECTED_TAB: return "unexpected tab character (remember tabs must be quoted)";
case XMQ_ERROR_UNEXPECTED_TAB: return "invalid tab character found, remember that tab is not allowed as a field separator, to store tab as content it must be quoted";

from wmbusmeters.

kzajac83 avatar kzajac83 commented on June 28, 2024

atna0x.zip

Thank you, now understood what is XMQ.

Because earlier working on cc driver in C++ (is need only somehow encode manufacturer specification fields) due to XMQ driver is not yet ready, but give some data for testing.

However there are a mentioned problem for XMQ, if give as argument HEX telegram then working fine but when use instead telegram -> device (in my cause wired /dev/ttyUSB0:2400) then no answer from device, probably LinkMode is hard coded into wmbus (T1, T2 etc) for XMQ driver or something like that.

from wmbusmeters.

kzajac83 avatar kzajac83 commented on June 28, 2024

PS. Regarding my question about XMQ documentation I have in mind XMQ driver structure this mean what fields/structures are mandatory, what optional, what available/possible to use in the driver, how decode not standard (w)m-bus fields, general asking about documentation regarding drivers under wmbusmeters.

from wmbusmeters.

weetmuts avatar weetmuts commented on June 28, 2024

The dynamic loadable driver code is being developed. So, there is no documentation yet.....

from wmbusmeters.

kzajac83 avatar kzajac83 commented on June 28, 2024

Underwood, is clear.

Only I just want to point out that XMQ / dynamic loadable driver at this moment not work with real device like my example /dev/ttyUSB0:2400 (no any read frame / telegram from slave devices, only received E5 single byte frame). For standard driver working.

from wmbusmeters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.