1 Star 0 Fork 2

dgiot开源社区 / serial2mqtt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.adoc 2.93 KB
一键复制 编辑 原始数据 按行查看 历史
Jeeva Kandasamy 提交于 2021-06-13 08:31 . Update README.adoc

serial2mqtt

There is no maintainer for this repository. Please visit the alternate https://github.com/mycontroller-org/2mqtt

Forum

serial2mqtt is kind of adapter. This adapter receives Serial port data and sends to MQTT, vice versa

System Requirement

  • Disk : ~15 MB

  • Memory(RAM) : 4 MB

  • Java : 1.8 or later

Supported Platforms (tested)

  • Linux

  • Windows

  • Raspberry PI

Installation

Configuration

Extract downloaded bundle where exactly do you want to run. Configuration files located in serial2mqtt/conf

File: serial2mqtt.properties

Message queue size

serial2mqtt.message.queue.size=1000 #(1)
  1. Internal message queue size. Messages will be processed immediately. However, if the serial port or MQTT broker goes down in that time messages will be stored in the message queue.

Network type

serial2mqtt.network.type=MY_SENSORS #(1)
  1. For now, this adapter supports only for MySensors

Serial port settings

serial.driver=AUTO #(1)
serial.port=/dev/ttyUSB0 #(2)
serial.baud.rate=115200 #(3)
serial.connection.retry=60 #(4)
  1. This adapter uses a different type of internal driver to communicate with the serial port. Always goes with AUTO, if you do not have any specific requirement. Supported driver options: AUTO, JSERIALCOMM

  2. Serial port name/id

  3. Bud rate of the serial port

  4. When there is a connection failed on the serial port, after this delay will do retry to connect again. values in seconds

MQTT client settings

mqtt.qos=0 #(1)
mqtt.broker=tcp://localhost:1883 #(2)
mqtt.client.id=serial2mqtt-adapter #(3)
mqtt.topic.publish=mygateway-out #(4)
mqtt.topic.subscribe=mygateway-in #(5)
mqtt.username= #(6)
mqtt.password= #(7)
mqtt.connection.retry=60 #(8)
  1. QoS of this MQTT client

  2. broker host URL in the form of tcp://<ip>:<port>

  3. Client id, can be named without space

  4. where to publish serial port data on MQTT topic

  5. subscribe topic, do not include /# on the end. Received data will be published on Serial port

  6. Username of the MQTT broker, if Anonymous access disabled on MQTT broker

  7. Password of the MQTT broker

  8. When there is a failed on connection, retry after this seconds.

Logger configuration

Configuration File Name: logback.xml

Default log file location: logs/mycontroller.log

Start/Stop Server

Executable scripts are located in serial2mqtt/bin/

  • Linux

    • Start : ./start.sh

    • Stop : ./stop.sh

  • Windows

    • Start : Double click on start.bat

    • Stop : Ctrl+C

  • Other Platforms

java -Xms4m -Xmx4m -Dlogback.configurationFile=../conf/logback.xml -Dserial2mqtt.conf.file=../conf/serial2mqtt.properties -cp "../lib/*" org.mycontroller.serial2mqtt.StartService
1
https://gitee.com/dgiiot/serial2mqtt.git
git@gitee.com:dgiiot/serial2mqtt.git
dgiiot
serial2mqtt
serial2mqtt
master

搜索帮助