Comments (6)
/cc @r00t-
from libsml.
@ckohrt:
i'm not sure if this within the scope of libsml...
sml_server
is a simple program intended to demonstrate the use of the library (it lives in an "examples" directory).
sml_server
uses some simple i/o utility functions that libsml provides in sml_trasport.[ch]
,
which use blocking i/o and do not support timeouts.
i'd say, you are very welcome to write your own program using libsml that implements more advanced semantics.
by replacing sml_transport_listen()
and sml_transport_read()
with your own code, and passing the data to sml_transport_receiver()
.
we might want to offer a more flexible variant of sml_transport_read() that can be used with non-blocking io, or otherwise provide the scanning for start sequence and reading of a datagram in a more generic interface.
but as stated above, now sure if this is within scope,
it would also mean an ABI change.
why are you not using vzlogger?
it can read multiple meters in a single process and forward the data to your processing of choice.
as an alternative, if you insist on scripting around sml_server
, have you considered simply wrapping sml_server in https://www.gnu.org/software/coreutils/timeout ?
from libsml.
hi @r00t-!
Thank you very much. I ended up with:
Z_1_182=$(timeout --foreground 10 /usr/bin/sml_server /dev/zaehler_1 | head -n10 | grep -oP '1\.8\.2\*255#\K.*(?=#)')
which works. Of course vzlogger is a better alternative, but I didn't want to get vzlogger running on my raspberry as I already have a working solution. It's just the time invest.... and with the timeout solution it works nearly without any time invest!
Big thanks!
Christian
from libsml.
@ckohrt:
--foreground
should not be necessary.
from libsml.
@ckohrt:
--foreground
should not be necessary.
Thanks!
from libsml.
Solution:
Z_1_182=$(timeout 10 /usr/bin/sml_server /dev/zaehler_1 | head -n10 | grep -oP '1\.8\.2\*255#\K.*(?=#)')
from libsml.
Related Issues (20)
- Unsigned current Power Value HOT 9
- 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
- hexdump() compatibility issue with newest Arduino / ESP8266 libraries HOT 8
- libsml debian package still points to dailab repo HOT 3
- Cannot Build on Raspberry Debian 11 with gcc version 10.2.1 HOT 2
- sml_server does not decode data from device DZMeteringGmbH_WS_7412.1 (negative values) HOT 15
- sml_server not part of libsml1 debian package HOT 7
- Odd readings from DWSB20.2TH: Display shows power -195W, vzlogger reports 460W HOT 15
- List of projects using libsml HOT 3
- How to use libsml in ESPhome? HOT 3
- deprecate / replace `sml_transport` API
- support arduino?
- 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.