Coder Social home page Coder Social logo

tmu2mqtt's Introduction

TMU to MQTT

TMU USB thermometer (www.papouch.com) to MQTT bridge

Prerequisites

  1. logrotate daemon is installed
  2. systemd daemon is installed
  3. python >= 3.7 is installed
  4. python module manager pip is installed

Installation

Run sudo bash ./install.sh
Script will

  1. check prerequisites
  2. install tmu2mqtt to /opt/tmu2mqtt folder
  3. install default configuration
  4. install tmu2mqtt service and logrotate configuration
  5. start tmu2mqtt service

Configuration

Configuration is by default read from file /etc/tmu2mqtt.cfg File has ini-style structure. Required section is mqtt containing configuration needed for MQTT client. At least one section tmuN shall be present, where N is number from 1 to 99.

Collected data will be published to mqtt broker topic {mqtt.client_id}/{tmuNN.id}

Section [mqtt]

  • client_id - required mqtt client id - has to be unique within mqtt broker.
  • host - optional mqtt host name or ip address. Default is localhost
  • port - optional mqtt broker TCP port. Default is 1883
  • username - optional username. Default is none.
  • password - optional password. Default is none.

Section [tmuNNN]

  • port - required serial port device name, e.g. /dev/ttyUSB0
  • id - optional TMU device identifier. Default is section name.
  • qos - optional mqtt QOS level for data from this port. Default is 1.

Example (minimum)

[mqtt]
client_id=tmu2mqtt

[tmu1]
id=nas_temp
port=/dev/ttyUSB0

[tmu2]
id=server_temp
port=/dev/ttyUSB1

After installation

  1. modify tmu2mqtt bridge configuration
    sudo nano /etc/tmu2mqtt.cfg

    Do not forget to restart service daemon - see below

  2. modify tmu2mqtt logrotate configuration
    sudo nano /etc/logrotate.d/tmu2mqtt
  3. modify service startup sudo nano /etc/systemd/system/tmu2mqtt.service

Usage

  1. check tmu2mqtt service status sudo systemctl status tmu2mqtt
  2. restart tmu2mqtt service sudo systemctl restart tmu2mqtt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.