hackbus
所属分类:通讯编程
开发工具:Haskell
文件大小:0KB
下载次数:0
上传日期:2023-11-28 19:00:34
上 传 者:
sh-1993
说明: Modbus RTU的事务存储器桥
(Transactional memory bridge to Modbus RTU)
文件列表:
LICENSE (7651, 2023-11-28)
examples/ (0, 2023-11-28)
examples/HacklabJkl.hs (12714, 2023-11-28)
examples/JsonApiDemo.hs (829, 2023-11-28)
examples/PersistenceDemo.hs (445, 2023-11-28)
examples/SimpleAutomation.hs (1807, 2023-11-28)
examples/TaidacentPower.hs (786, 2023-11-28)
hackbus.cabal (1898, 2023-11-28)
interactive/ (0, 2023-11-28)
interactive/modbus/ (0, 2023-11-28)
interactive/modbus/.ghci (104, 2023-11-28)
interactive/modbus/Interactive.hs (784, 2023-11-28)
src/ (0, 2023-11-28)
src/Control/ (0, 2023-11-28)
src/Control/Hackbus/ (0, 2023-11-28)
src/Control/Hackbus/AlarmSystem.hs (2573, 2023-11-28)
src/Control/Hackbus/Exceptions.hs (469, 2023-11-28)
src/Control/Hackbus/JsonCommands.hs (1160, 2023-11-28)
src/Control/Hackbus/Logging.hs (2721, 2023-11-28)
src/Control/Hackbus/Math/ (0, 2023-11-28)
src/Control/Hackbus/Math/DewPoint.hs (622, 2023-11-28)
src/Control/Hackbus/Math/Sauna.hs (2306, 2023-11-28)
src/Control/Hackbus/ModuleUtils.hs (1143, 2023-11-28)
src/Control/Hackbus/Modules/ (0, 2023-11-28)
src/Control/Hackbus/Modules/HfEasy.hs (3574, 2023-11-28)
src/Control/Hackbus/PeekPoke.hs (2050, 2023-11-28)
src/Control/Hackbus/Persistence.hs (5209, 2023-11-28)
src/Control/Hackbus/Trinary.hs (981, 2023-11-28)
src/Control/Hackbus/UnixJsonInterface.hs (2698, 2023-11-28)
src/Control/Hackbus/UnixSocket.hs (2813, 2023-11-28)
src/Media/ (0, 2023-11-28)
src/Media/Streaming/ (0, 2023-11-28)
src/Media/Streaming/Vlc.hs (1145, 2023-11-28)
src/System/ (0, 2023-11-28)
src/System/Hardware/ (0, 2023-11-28)
src/System/Hardware/Modbus.hs (4233, 2023-11-28)
... ...
# HackBus
[![Matrix chat](https://img.shields.io/badge/chat-via%20matrix-brightgreen.svg)](https://matrix.to/#/#jkl:hacklab.fi)
Transactional memory bridge to Modbus RTU. Expandable to other buses
such as DMX.
Uses Haskell Software Transactional Memory to translate imperative
nature of field buses to declarative definition.
Still work in progress, but used in daily basis at Hacklab Jyvskyl
club room for controlling the alarm system, lighting, and power
sockets.
## Installation
If you have Debian or Ubuntu, I'd recommend installing all available
dependencies from their repositories to minimize package clutter.
Then, only curl-aeson and hacbus itself are installed user-wide.
```
sudo apt install \
cabal-install \
libghc-stm-dev \
libghc-text-dev \
libghc-aeson-dev \
libghc-network-dev \
libghc-readline-dev \
libghc-curl-dev \
libghc-utf8-string-dev \
libghc-monad-loops-dev \
libmodbus-dev
cabal v1-update
cabal v1-install
```
On other systems with Cabal, run
```
cabal update
cabal install
```
## Interactive usage
There is interactive GHCi shell available for testing and setting
module parameters such as addresses. Tab completion works in both
device file entry and in the shell.
Before it works, the cabal package needs to be installed, of course.
### Interactive Modbus
```
$ cd interactive/modubss
$ ghci
GHCi, version 8.4.4: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Interactive ( Interactive.hs, interpreted )
Ok, one module loaded.
Device file: /dev/ttyUSB0
Initialized, ModbusHandle in "h"
Loaded GHCi configuration from /home/user/hackbus/interactive/.ghci
*Interactive System.Hardware.Modbus> setSlave h 1 >> writeRegister h 0x40002 2
```
## License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
近期下载者:
相关文件:
收藏者: