Liking cljdoc? Tell your friends :D

dvlopt.mbus

Thin clojure wrapper around JMbus for communicating with Meter-Bus slave devices.

Supports a (very) wide variety of platforms.

Installation

This library needs jRxTx for using serial ports. For instructions, refer to Clotty, our own clojure wrapper.

Then, simply add the following dependency to your project :

Clojars
Project

Usage

Read the full API.

In short :

(require '[dvlopt.mbus       :as mbus]
         '[dvlopt.mbus.wired :as mbus.wired])


;; Open a connection on the serial port.

(def connection
     (::mbus.wired/connection (mbus.wired/open-serial "/dev/ttyUSB0"
                                                      {::mbus/timeout   1000
                                                       ::mbus/baud-rate 2400})))


;; Request user data from slave 0

(mbus.wired/req-ud2 connection
                    0)

Status

If you need wireless M-Bus, you need to interop with JMbus. We will write a wrapper as soon as we have the relevant hardware to test it.

License

Copyright © 2017-2018 Adam Helinski

Distributed under the Mozilla Public License version 2.0.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close