Help needed with Modbus and HA - SOLVED

I’m really struggling with Modbus integration under HA. I have setup two VMs in a Win10 box. I started first with Oracle VirtualBox but pulling out data from a Modbus controller seems to be pain in the b**t. I posted about this problem in here.

I’m using Moxa NPORT tcpip-rs485 converter which works nicely with different Modbus softwares (e.g. Modbus Poll, Modbus Master). I even made a stress test with MB Poll and no problems with polling my Modbus controller.

Now I have installed VMware virtual machine on the same WIn10 box. Polling the Modbus controller works but serial port crashes after 1-2min. I get following error message and HA stops polling:

I’m using exactly the same configuration.yaml in both VMs:

modbus:
  - name: "Ouman EH686 autotalli"
    #   close_comm_on_error: false
    type: serial
    baudrate: 38400
    bytesize: 8
    method: rtu
    parity: N
    stopbits: 1
    port: /dev/ttyS1
    delay: 0
    timeout: 5
    #   retry_on_empty: true
    #   message_wait_milliseconds: 450

    sensors:
      - name: "Autotalli T (°C)"
        address: 64
        count: 1
        input_type: holding
        scan_interval: 5
        slave: 1
        unit_of_measurement: °C
        scale: 0.01
        precision: 1

I just tested this configuration in Virtualbox and polling worked OK but then I restarted VirtualBox and polling didn’t work any more. I didn’t change anything, just restarted VB and HA.

Setting up a serial port in VMware is very simple:

So you can’t change that many parameters.

I would need help from an expert and I know there are guys on this forum who are experts in Modbus.

Now when Modbus is not working properly in VMs it seems that virtual machines don’t seem to work in my case. I have ordered a NUC which I will get next week.

Big question is how to install HA in the NUC? So, is HA Container the only way to go?

1 Like

You can use Home Assistant OS on the NUC. See Generic x86-64 - Home Assistant

Modbus TCP?

No, Modbus RTU.

If you use Moxa, you dont need serial in HA

My controllers have Modbus RTU interface so therefore I have to use serial in the configuration.yaml.

Now I managed to connect one of my Mitsu air pumps with Procon A1M board to HA. This has also Modbus RTU.

I have noticed that I can get the serial ports disconnected very easily in VMware when making some changes in HA configuration. I have no ideas why the serial ports are disconnected.

I managed to solve this problem. I’m now confident that with Moxa NPORT converters you have to use Modbus RTU so serial in HA. I happened to have Moxa MGate3180 and this is a Modbus TCP converter. Now polling my Modbus controller works like charm.

@jlik Were you able ro use a Moxa NPort 5110A to send rs232 data across the network to a VM?