Wemos D1 R32 connect to Modbus TCP device via router

Hello, I am trying to use the Wemos D1 R32, the Arduino Uno equivalent for ESP32, to connect to a router via WiFi and read registers from a slave(server) device connected to this router.

//#include <dummy.h>

#include <CoilData.h>
#include <Logging.h>
#include <ModbusBridgeEthernet.h>
#include <ModbusBridgeRTU.h>
#include <ModbusBridgeTemp.h>
#include <ModbusBridgeWiFi.h>
#include <ModbusClient.h>
#include <ModbusClientRTU.h>
#include <ModbusClientTCP.h>
#include <ModbusClientTCPasync.h>
#include <ModbusError.h>
#include <ModbusMessage.h>
#include <ModbusServer.h>
#include <ModbusServerEthernet.h>
#include <ModbusServerRTU.h>
#include <ModbusServerTCPasync.h>
#include <ModbusServerTCPtemp.h>
#include <ModbusServerWiFi.h>
#include <ModbusTypeDefs.h>
#include <options.h>
#include <RTUutils.h>

#include <MgsModbus.h>
#include <Ethernet.h>
#include <SPI.h>
#include <WiFi.h>


int HoldingR;
int HoldingR_old;
int InputR;
int InputR_old;

MgsModbus Mb;

int acc = 0; //Counter

byte mac[] = {0x3C, 0x61, 0x05, 0x12, 0x89, 0x38};
IPAddress ip(192, 168, 2, 128); //Microcontroller
IPAddress gateway(192, 168, 2, 1);
IPAddress subnet(255, 255, 255, 0);

void setup() {
  Serial.begin(115200);
  
  WiFi.begin("Process_Trainer_Internal", "92001329");
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi..");
  }
  Serial.println("Connected to the WiFi network");

  Ethernet.begin(mac, ip, gateway, subnet);

  //Server(device) IPAddress
  Mb.remSlaveIP[0] = 192;
  Mb.remSlaveIP[1] = 168;
  Mb.remSlaveIP[2] = 2;
  Mb.remSlaveIP[3] = 150;

  HoldingR = 0;
  HoldingR_old = 0;
  InputR = 0;
  InputR_old = 0;

  DisplayCurrentValues();
    
}

void loop() {

  Poller();
  Mb.MbmRun();
  
  CheckForDataChange();

}

void Poller(){

  delay(5000);
  acc = acc + 1;

  if (acc == 3000){
    Mb.Req(MB_FC_READ_INPUT_REGISTER,      103, 1, 0);
  }

  if (acc == 3200){
    InputR = Mb.MbData[0];
  }

  if (acc == 4000){
    Mb.Req(MB_FC_READ_REGISTERS,       135, 1, 0);
  }

  if (acc == 4200){
    HoldingR = Mb.MbData [0];
    acc = 0;
  }
}

void CheckForDataChange() {

  boolean data_has_changed = false;

  if (InputR_old != InputR) {
    data_has_changed = true;
    InputR_old = InputR;
  }

  if (HoldingR_old != HoldingR) {
    data_has_changed = true;
    HoldingR_old = HoldingR;
  }

  if (data_has_changed = true) {
    DisplayCurrentValues();
  }
}

void DisplayCurrentValues() {

  String readingstr;

  readingstr = "InRegst: " + String(InputR);
  readingstr = readingstr + " | HoldRegst: " + HoldingR;
  Serial.println(readingstr);
  
}

I am not getting any values with this code, which got me thinking if I have to attach an Ethernet module/shield in order for it to poll and read data from Modbus TCP. I am a beginner in the Arduino IDE, and only have a basic knowledge of microcontrollers. Can anyone help?

Libraries:
Modbus ESP8266/ESP32
MgsModbus