Modbus comunication loss

I have a v5 gateway running firmware 7.31 and a Temp/humidity probe connected, use the modbus protocol to retrieve temp and humidity for a status report. But it seams that every now and then the gateway losses the modbus functionality.
When looking at the seeings page it seams to be enabled, but not functioning. When re enable the modbus everything works again for a period.

Has anybody seen this?
and is there a workaround other then when it fails to do a manual re enable.?
Maybe a new firmware where this works?

I was about to buy multiple setups to run throughout our production facilities but if modbus is so unstable this is not a viable option.



  • At first I thought that this bug was provoked by mains fail but we have now verified that it loses Modbus communication even without mains fail aka. running idle....

  • Hi Tim

    No we do not know how many minutes/hours it takes for the modbus interface to crash, i will try to reflash the firmaware. But in a live environment the work around with restart is a not an option.
    That is simply not good enough for a service that must be reliable.
    Also the internal clock is reset on every reboot..... this is why we know that the modbus service stops to work in ideal mode.


  • kthkth
    edited January 2017
    Hi Tim,

    A reflash of the firmware did not solve the problem.

    The setup is only a gateway stand alone with the temp/humidity sensor connected.
    There are no other sensors connected.

    We are using a Ruby script to fetch the data from the gateway, here we are using the rmodbus library.
    This script and library are 100% functioning when the gateway is running and modbus is enabled. But when the modbus fails on the gateway, we are not able to communicate over modbus with the script or modbus poll.

    We are connecting and disconnecting on every request from the script... hence no poll rate
    the script is run every time a test of our equipment is done approx 50-100 times a day. The temp and humidity is then written into a database to prove the environment for which the test was carried out.

    When the modbus fails i have to reboot the device to re-enable it. The enable modbus from the webinterface does not work, when the service is down.

    Below is a small example of the interface we use to communicate with the gateway, nothing fancy in that.

    def initialize(ip ='', slaveID='1', port='502')
    ip = ip
    slaveID = slaveID
    port = port
    modbus = nil
    # create the modbus connection
    modbus =, port)

    # create a slave instance
    slave = modbus.with_slave(slaveID)
    rescue Exception => e
    puts e
    end #end initialize

    # Description::
    # This method reads the modbus address of the internal temperature of the sensor gateway
    # The internal modbus address is 30200 q4 on a PLC base 1
    # This is the same as 0 based add 199
    def read_internal_temp
    value = 0.0
    # Read input reg address 199 (0 based) quantity of two, convert to float and round with 1 decimal
    value = slave.read_input_registers(199, 2).to_32f[0].round(1)
    rescue Exception => e
    puts e
    return value
    end #end read_internal_temp

  • kthkth
    edited January 2017
    Hi Tim

    The rmodbus is the ruby modbus communication library and it works on all the other products we have running modbus..... i would say in that setup alone we are running ~25 modbus clients all responding except your tool. Yes i have already used "Modbus Poll" due to the fact that i work together with the author of the tool Brian Witte... here in Skive Denmark.
    And when your service stops responding modbus poll also does not work,

    The problem is not my implementation but the fact that your product ends up in a state where your modbus service stops communicating.

    I would gladly help to recreate the problem and provide data, but the fact is that the service stops responding for some reason, and only a power cycle of the product works to bring it back.

  • Hi Tim,
    I think you misunderstand this completely.
    I am not talking about timeout in the service, we work with modbus all the time we know how it works.
    I am talking about the modbus not responding for hours and hours not just 500ms, and we have tried to use different poll rates.

    When the service fails it really fails...... not talking about timeouts.... and only power cycle works!
Sign In or Register to comment.