Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. QModbusServer on Raspberry Pi: Connection Refused by Server
QtWS25 Last Chance

QModbusServer on Raspberry Pi: Connection Refused by Server

Scheduled Pinned Locked Moved Solved QtonPi
2 Posts 1 Posters 642 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • aniketRoxyA Offline
    aniketRoxyA Offline
    aniketRoxy
    wrote on last edited by
    #1

    Hi,
    I have created QModbusServer (TCP) in my application on windows 10 laptop.
    Following code is for create tcp modbus server.

    const QUrl url = QUrl::fromUserInput("127.0.0.1:1502");
    modbusDevice->setConnectionParameter(QModbusDevice::NetworkAddressParameter, url.host());```
    modbusDevice->setConnectionParameter(QModbusDevice::NetworkPortParameter, url.port());
    modbusDevice->setServerAddress(1);
    

    Server is running well. I can connect my LabVIEW Modbus Client application from same Laptop.
    Now I started server application on raspberry pi.
    During connect request from laptop, LabVIEW modbus client shows following error.

    LabVIEW: Serial buffer overflow, Connection refused by server & terminated.
    

    Aniket Gadekar

    1 Reply Last reply
    0
    • aniketRoxyA Offline
      aniketRoxyA Offline
      aniketRoxy
      wrote on last edited by
      #2

      I changed code as following, now working fine.

      //const QUrl url = QUrl::fromUserInput("127.0.0.1:1502");
      modbusDevice->setConnectionParameter(QModbusDevice::NetworkAddressParameter, "localhost");
      modbusDevice->setConnectionParameter(QModbusDevice::NetworkPortParameter, 1502);
      modbusDevice->setServerAddress(1);
      

      "127.0.0.1" is loopback address, which refuses remote connection.

      Aniket Gadekar

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved