Comments (1)
i suggest you check your code against sml_server
from the examples directory.
for example, sml_server removes the 8-byte preamble and suffix before passing the datagram to sml_file_parse()
:
https://github.com/volkszaehler/libsml/blob/master/examples/sml_server.c#L91
// the buffer contains the whole message, with transport escape sequences.
// these escape sequences are stripped here.
sml_file *file = sml_file_parse(buffer + 8, buffer_len - 16);
while your data is a whole message (which you try to pass to sml_file_parse
),
which sml_server reads just fine:
$ php -r 'echo hex2bin("1b1b1b1b01010101760700110bf402df620062007263010176010107001103c500f50b0901454d4800007514c401016375f300760700110bf402e0620062007263070177010b0901454d4800007514c4070100620affff7262016503c5853c7a77078181c78203ff0101010104454d480177070100000009ff010101010b0901454d4800007514c40177070100010800ff6401018201621e52ff5600051bdfde0177070100020800ff6401018201621e52ff5600000006070177070100010801ff0101621e52ff5600051bdfde0177070100020801ff0101621e52ff5600000006070177070100010802ff0101621e52ff5600000000000177070100020802ff0101621e52ff5600000000000177070100100700ff0101621b52ff55000014f40177078181c78205ff010101018302957c486aaf8c92a257ec681e215fddeff32a2dbf2c8a88721777f5f01e5ed5ccaa694dd48c14dc5589d28e0c5b9ce88e01010163b4c800760700110bf402e362006200726302017101634e85001b1b1b1b1a000337");' | ./sml_server -
129-129:199.130.3*255#EMH#
1-0:0.0.9*255#09 01 45 4d 48 00 00 75 14 c4 #
1-0:1.8.0*255#8571286.2#Wh
1-0:2.8.0*255#154.3#Wh
1-0:1.8.1*255#8571286.2#Wh
1-0:2.8.1*255#154.3#Wh
1-0:1.8.2*255#0.0#Wh
1-0:2.8.2*255#0.0#Wh
1-0:16.7.0*255#536.4#W
129-129:199.130.5*255#95 7c 48 6a af 8c 92 a2 57 ec 68 1e 21 5f dd ef f3 2a 2d bf 2c 8a 88 72 17 77 f5 f0 1e 5e d5 cc aa 69 4d d4 8c 14 dc 55 89 d2 8e 0c 5b 9c e8 8e #
from libsml.
Related Issues (20)
- Unsigned current Power Value HOT 9
- timeout HOT 6
- libsml crc enhancements ? HOT 10
- DZG workaround not necessary anymore HOT 20
- Add support for efr SGM-C4 meter
- sml_server does not decode testfile from eBZ DD3 2R06 HOT 2
- SML-Errors with Holley DTZ541 HOT 2
- warning: type of bit-field 'dzg_meter' is a GCC extension HOT 6
- debian "fork" ? HOT 37
- cherrypick 0003-use-nonblock.patch HOT 1
- [Holley DTZ541] Error while parsing SML message: Error: Wrong TL-Field 0x65 for Choice! HOT 10
- wrong results with EMH_eHZ-HW8E2A5L0EK2P_2.bin from testing repo HOT 5
- Consistently reformat sources?
- Checksum issue on Itron OpenWay 3Hz HOT 9
- Not builing on current gcc version 10 HOT 7
- fix gcc-10 build HOT 3
- DZG - libsml: error: unrecognized sequence HOT 8
- More Examples HOT 6
- Compile Error on Alpine: no member named '__jmpbuf' HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsml.