Skip to end of metadata
Go to start of metadata



Min. LB Version


Description Modbus TCP to Modbus RTU Gateway
 Version History...

Version 0.0.8

  • Problem with conf creation

Version 0.0.7

  • possibility to select DEV source
  • Spanish translation - thanks to Madito

Version 0.0.6

  • Problem with cfg removing

Version 0.0.5

  • Loglevel control

Version 0.0.4

  • German language added - many thanks to AlexAn
  • separated logfile according to services
  • gateway configuration can not be removed if service is active
  • Link to wiki according to language

Version 0.0.3

Version 0.0.2

  • Autoupdate possibility added

Version 0.0.1

  • First pre-release



The current release can be found here:

All releases are listed here:


The plugin can be installed as zip file into Loxberry. Similar to all other plugins. Min. version of the LoxBerry have to be!

Configuration options

You will need at least one USB to RS485 converter. On aliexpress it costs from 1$.

If you need more gateways with different settings, you need one separate one USB to RS485 converter for each settings.

First click at the "New gateway" button. In the list of the serial devices click at one, that correspond to your new USB to RS485 device.

Default configuration for that device is automatically done and redirect you back. New device should be selected and below should be detail configuration (if it's not, click at gateway).

Change the details according to your requirements and Save it. Now you can run the service. Click at "Start service" button. If you need more gateways, click at the "New gateway" button ...

Gateways must not have the same port!

Functionality of the plugin

The Modbus Gateway is the sw Modbus TCP to Modbus RTU Gateway, that can be used instead of the Modbus Extension. It convert Modbus RTU to Modbus TCP, which is supported by the Miniserver.

This plugin uses mbusd.

Setup in the Loxone Config Software

click at Miniserver Comunication in the Miniserver tree. Then click at Modbus Server icon.

Server is inserted. Change parameters according to Gateway in LoxBerry.

Next it's same as with Modbus Extension. Click at icon "Sensors and Actuators" and select corresponding device tamplate, or create device manualy. It's necessary to check checkbox "Order of registers"!


Separate log for each Gateway service - released in v0.0.4

Asking questions and reporting problems

Questions about the plugin will be answered in this wiki page. Please report your errors here. English or Czech language, please.

  • No labels


  1. Hi, I need use 2 or mode USB serial converter but it not work. I use PL2303 usb converter. First USB work fine, when I plug second USB converter, both stop working. Please help me. Thank you.

  2. Hi, can you specify type of your USB to RS485 converter? URL, ....

    If you speak Czech, we can switch to and than translate important things into the english.

  3. Cauko,

    Je to konkretne tento prevodnik:

    V plugine ho vidim, pridam mu profil a funguje perfektne, ale akonahle vlozim do 2. usb dalsi takyto prevodnik plugin mi uz neponukne pridat dalsi profil pre dalsie zariadenie a 1. usb prevodnik prestane fungovat. V linuxe som si overoval usb adresy prevodnikov a kazdy ma v systeme svoju jedinecnu usb adresu.

    Myslim ze bude nejaky problem s parsovanim usb adries pri pridavani zariadeni do pluginu. Dakujem za pomoc.

  4. Koukni se do /dev/serial/by-id/

    Tam je namapován usb prevodnik. Zkus jeden a pak druhej. Kazdy by mel mit jedinecny nazev. Pokud ne, tak se spolu perou.

  5. Takze ked pozriem do /dev/serial/by-id tak vidim iba jeden (usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0) - ale by path vidim oba (platform-3f980000.usb-usb-0:1.2:1.0-port0 a platform-3f980000.usb-usb-0:1.4:1.0-port0). Evidentne maju rovnake id. Viem nejako prepnut v plugine aby identifikoval prevodniky na zaklade cesty ? Je mi jasne ze to bude mat za nasledok citlivost na pouzity USB port ale aspon to viem pouzit s rovnakymi prevodnikmi.

  6. V tuto chvili ne. Pripravim novou verzi s moznosti prepnuti.

    Tento tyden mi to ale asi nevyjde. Spis pristi ... nebo mozna v noci, kdyz budu mit jeste naladu.

    Jeste je otazka, jestli se v by-path nemuze po restartu nazev zmenit. Pripravim a uvidime.

  7. Ano to napadlo aj mna, ze ci sa cesta nemude menit. Presne, uvidime. Zatial dakujem (wink) Este jedna drobnost, ked USB prevodnik vytiahnem a nasledne zasuniem tak sluzba prestane pracovat, rozbehne sa to az po znovuulozeni konfigu. Da sa nejako cyklicky povedzme raz za hodinu sluzba resetnenut alebo nejako inak osetrit aby to fungovalo ? Ja totizto v loxone nezistim ze sluzba nefunguje. Nacitane hodnoty zostanu v poslednom nacitanom stave.

  8. Nainstaluj si verzi 0.0.8

    V /opt/loxberry/config/plugins/modbusgateway/mbusd.cfg si zmen by-id na by-path.

    Melo by to chodit.

    Dej prosim vedet, jestli se ti meni nazev

    Sluzba se startuje prikazem systemctl, takze muzes treba cronem kazdou hodinu.

    Nicmene me loxone hlasi, kdyz ztrati spojeni na gateway - musis v loxone u definica gateway v "Online status ..." zakliknout "Pouzit pro systemove chyby"

    Jeste mi nikdy nespadla. Jen kdyz restartuju loxberry.

  9. Hi!

    I need some help with your plugin.

    I have installed it, log says it works OK. In Loxone i dont receive any data. Port and IP are the same in Plugin/Loxone, modbus adress is correct.

    What about the settings in the plugin? Modus 8n1? TRX? Are this settings correct?



  10. Hi,

    settings in the plugin have to be coresponding to settings in loxone and modbus device (powermeter).

    Log says that loxone can connect to gateway.

    So problem is probably in setting of speed or mode or both. That have to be same in gateway and device.


  11. Hi, 

    After a restart of the loxberry, the plugin is stopped and I have to restart it in the webinterface.

    Is there an option that the pluging automatic restart after loxberry reboot?


  12. I have the the same problem as bernhard with the automatic restart after reboot.

    But I have another Problem too. The Modbus gateway works fine at the Miniserver. I want to use a modbus relaycard at the gateway. If I send something to the relaycard, the LED blinks. But no relay is working. With a TCP Modbus tool on my computer I can change the state of the relays. The String for relay 1 is:

    01 06 00 01 01 00 D9 9A

    1. Slave ID
    2. Function (06)
    3. and 4. Adress (relaynumber)
    4. s.a.
    5. Command (01 is on and 02 is off)
    6. Delay
    7. CRC
    8. CRC

    I can enter the values 1 to 4 in the Modbus device and the actor. But how can I pass the 256 (0100) or 512 (0200) to the actuator?

    Thank you very much for your help. To my excuse, I have only been working with Loxone for 1 week.

  13. Hello again,

    now the relais actor works. Last problem is how to auto start the modbus plugin after reboot.

    Thanks a lot

    1. Hi Niels,

      could you explain me how you get the relay work?

  14. Hello, there is problem, that there isn't serials mapped into /dev/serial/by-id/ at the moment of Gateway service starts.

    I need to find service, that start mapping of the serials and set Gateway service starts after that.

  15. Hello,

    I've found solution. Change "RestartSec" in file /lib/systemd/system/mbusd@.service from 1 to 10.

    I use Loxberry on the virtual, so I can't check, if 10 is enough for RPi.

    Can anybody test it on RPi and let me know, please?

    Then I'll prepare new version with correction.

  16. Hello Tomas, thank you very much for your very quick help. With this change the MODBUS Gateway now starts by itself. Only the status of the USB to MODBUS converter is not updated in the web interface. It is at START although the device is working.

    But that is not so important. Thanks again for your help.

  17. Hello!

    Also thanks very much for quick help.

    Same at my rpi, plugin start automatic after reboot, but webinterface is not updated.

  18. Hello,

    it's because service is not started at the moment of the webpage load. If you try to reload page, it should be during 10 s  OK.

  19. Hello!

    First of all: Tomas thank you for spending time in creating this plugin :)

    I am a N00B in modbus and have a few questions:

    I have a special requirement hope you can tell me if that works with your plugin or you maybe have another solution.

    I have an inverter with a modbus card which requests every 2 seconds a specific value from the Modbus energy meter.

    Now I want that not the energy meter responds to the request but the plugin or loxone using a specific value I want.

    Is this possible with your plugin ?

    Thank you!!



  20. Hello,

    I don't think so. Loxone has minimal cikle 5s.



  21. Hi, I'm still in the process of purchasing the Loxone Miniserver, but I already know that I probably have to use the modbus protocol for communicating with a ventilation system. What is the difference between the Loxone Modbus extension and this Modbus gateway (except that working with Loxberry looks much cheaper)? Any pro's and cons regarding whether to choose either of the two options?

    Kind regards, Herbert

  22. Hi, at the moment it's not possible write registers with Modbus Gateway, because Loxone don't support changing of Order of registers in writing. So if you need read registers from ventilation system. You can use Modbus Gateway. But if you also need to write registers to ventilation system you need to use another solution.

    1. Thank you for your reply Tomas. My ventilation systems supports the change of values in the registers by Modbus. Can you tell me if this would be possible with the Loxone Modbus extention?

  23. Yes, it should be.

  24. Hi Tomas, I have a problem that the Gateway stops working, the log is not there and it will start again OK. It seems to coincide with an event in the Loxberry system/datetime log "setting timezone to'Europe/London'

    It stops many times a day. I also see the following error but I don't know if this is normal. (10:57:00 is when the service stopped).

    [Fri Mar 22 10:57:00.033518 2019] [mpm_prefork:notice] [pid 757] AH00163: Apache/2.4.25 (Raspbian) configured -- resuming normal operations
    [Fri Mar 22 10:57:00.033752 2019] [core:notice] [pid 757] AH00094: Command line: '/usr/sbin/apache2'
    [Fri Mar 22 11:13:07.229417 2019] [mpm_prefork:notice] [pid 757] AH00171: Graceful restart requested, doing restart

  25. Hi Tomas,

    I've a problem with your plugin. It's described here:

    Maybe you can help me.

    Thanks in advance!

  26. I have the same problem like Niels at Dez 07, 2018:

    The Modbus gateway works fine at the Miniserver. I want to use a modbus relaycard at the gateway. If I send something to the relaycard, the LED blinks. But no relay is working. With a TCP Modbus tool on my computer I can change the state of the relays. The String for relay 1 is:

    01 06 00 01 01 00 D9 9A

    1. Slave ID
    2. Function (06)
    3. and 4. Adress (relaynumber)
    4. s.a.
    5. Command (01 is on and 02 is off)
    6. Delay
    7. CRC
    8. CRC

    I can enter the values 1 to 4 in the Modbus device and the actor. But how can I pass the 256 (0100) or 512 (0200) to the actuator?

  27. It works. Here is my solution in German.

  28. Tomas Zmatlik Hi Tomas, in the plugin wishlist is an entry for a modbus→udp converter:

    Modbus zu UDPModbus Register einlesen und bei Veränderungen UDP Mitteillung an den Miniserver, um Modbus Geräte wieder in vernünftiger Geschwindichkeit zu nutzen

    ("read register and send changed values via udp")

    With msudp_send_mem sending via udp including change detection would be very easy. 

    Is this something you are interested on to have it on your plugin roadmap?

    Regards, Christian

  29. Hi,

    i'm using your plugin for my installation to read my moisture sensors in my garden. My installation has grown now to quite a few sensors in the meantime and i've experienced strange requests like this:

    03 Sep 2019 21:11:21 conn[]: state now is CONN_HEADER
    03 Sep 2019 21:11:21 conn[]: state now is CONN_RQST_FUNC
    03 Sep 2019 21:11:21 conn[]: state now is CONN_RQST_TAIL
    03 Sep 2019 21:11:21 conn[]: request: [04][04][00][01][00][01][00][09][00][00][00][06][05][04][00][00][00][01][00][0a][00][00][00][06][05][04][00][01][00][01][00][0b][00][00][00][06][06][04][00][00][00][01]

    The request as such is valid, but mbusd is reading multiple request at the same time and it's mixing it up.

    I've checked the source code of mbusd and it seems they fixed this in their last release (0.4.0). Building this manually, fixed my problem.

    Tomas Zmatlik as you are providing mbusd as .deb package and i couldn't find any other source for this, i guess you are building this on you own. I think it would be great if you could upgrade to the latest version and provide an updated version to fix this problem.

    thx in advance