<commit_before># Java Serial MQTT Bridge

**Java application which forwards messages from serial ports to MQTT broker and vice-versa.**

The intention of this bridge is making data received over serial interfaces (such as UART, RS232) available to MQTT brokers for general usage - and the other way around.

I created this little application when I wanted to forward serial messages of the [MySensors](https://www.mysensors.org) home sensor/automation system to a general purpose MQTT broker to process these messages with multiple controllers (MyController and OpenHAB) for evaluation and for having a nice way of logging/debugging.

A special feature of SerialMqttBridge is a simple plugin system to modify messages before forwarding them via MQTT or UART. Sometimes it is necessary to adapt the content between both worlds. For example MySensors messages on the serial bus have to be reformatted for MQTT needs:

`12;6;1;0;0;36.5\n` (serial) <-> `Topic: <topicPrefix>/12/6/1/0/0 with content: 36.5` (MQTT)

In the source code you find a class doing this conversion in the _de.reitho.serialMqttBridge.plugins_ package. Taking this one as reference you can write your own adapters.


## Function

SerialMqttBridge gets configured with a text file called ___config.properties___. This file has to be in the application root folder.

The file contains the following parameters:
<table class="tg">
  <tr>
    <th>Config parameter</th>
    <th>Example values</th>
    <th>Note</th>
  </tr>
  <tr>
  <td colspan="3"><b>Serial connection properties</b></td>
  </tr>
  <tr>
    <td>serial.port</td>
    <td>___COM5___ (Windows), ___/dev/ttyS1___ (Linux)</td>
    <td><br></td>
  </tr>
  <tr>
    <td>serial.baudRate<br></td>
    <td>115200</td>
    <td></td>
  </tr>
  <tr>
    <td>serial.dataBits</td>
    <td>8</td>
    <td></td>
  </tr>
  <tr>
    <td>serial.stopBits</td>
    <td>1</td>
    <td></td>
  </tr><commit_msg>Solved README file text formatting issue<commit_after># Java Serial MQTT Bridge

**Java application which forwards messages from serial ports to MQTT broker and vice-versa.**

The intention of this bridge is making data received over serial interfaces (such as UART, RS232) available to MQTT brokers for general usage - and the other way around.

I created this little application when I wanted to forward serial messages of the [MySensors](https://www.mysensors.org) home sensor/automation system to a general purpose MQTT broker to process these messages with multiple controllers (MyController and OpenHAB) for evaluation and for having a nice way of logging/debugging.

A special feature of SerialMqttBridge is a simple plugin system to modify messages before forwarding them via MQTT or UART. Sometimes it is necessary to adapt the content between both worlds. For example MySensors messages on the serial bus have to be reformatted for MQTT needs:

`12;6;1;0;0;36.5\n` (serial) <-> `Topic: <topicPrefix>/12/6/1/0/0 with content: 36.5` (MQTT)

In the source code you find a class doing this conversion in the _de.reitho.serialMqttBridge.plugins_ package. Taking this one as reference you can write your own adapters.


## Function

SerialMqttBridge gets configured with a text file called ___config.properties___. This file has to be in the application root folder.

The file contains the following parameters:
<table class="tg">
  <tr>
    <th>Config parameter</th>
    <th>Example values</th>
    <th>Note</th>
  </tr>
  <tr>
  <td colspan="3"><b>Serial connection properties</b></td>
  </tr>
  <tr>
    <td>serial.port</td>
    <td>COM5 (Windows), /dev/ttyS1 (Linux)</td>
    <td><br></td>
  </tr>
  <tr>
    <td>serial.baudRate<br></td>
    <td>115200</td>
    <td></td>
  </tr>
  <tr>
    <td>serial.dataBits</td>
    <td>8</td>
    <td></td>
  </tr>
  <tr>
    <td>serial.stopBits</td>
    <td>1</td>
    <td></td>
  </tr>
{'fraction_non_alphanumeric': 0.10854323552324072, 'fraction_numerical': 0.01661905998441963, 'mean_word_length': 3.8883248730964466, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 105, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5945638', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1200, 'n_words': 472}