Skip to content

helins/mbus.clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MBus

Clojars Project

Cljdoc

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, you can also refer to helins/rxtx, our own clojure wrapper.

Usage

This is just a very brief overview.

The full API is available on Cljdoc.

In short :

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


(with-open [connection (mbus.wired/serial-connection "/dev/ttyUSB0"
                                                     {:mbus/timeout   1000
                                                      :mbus/baud-rate 2400})]
  
  ;; Request user data (ie. a variable data structure) from slave 0

  (mbus.wired/req-ud2 connection
                      0))

Status

For the time being, if you need wireless M-Bus, you need to interop with JMbus.

License

Copyright © 2018 Adam Helinski

Licensed under the term of the Mozilla Public License 2.0, see LICENSE.