Trouble Communicating with MaxiMet GMX600 via RS485 and Arduino (Modbus)

I'm trying to communicate with a MaxiMet GMX600 weather station using RS485 and an Arduino Uno with an RS485 Click module. My goal is to read sensor data using Modbus RTU, but I'm encountering issues.

Setup:

  • Arduino Uno
  • RS485 Click module (connected via SoftwareSerial)
  • MaxiMet GMX600 weather station
  • Baud rate: 19200
  • Modbus slave address: 20 (0x14)

Wiring:

The station has the following RS485 pinout:

  • TXD+ and RXD+ → A
  • TXD- and RXD- → B
  • Signal Ground → GND

I'm unsure if my wiring is correct, as the MaxiMet datasheet suggests bridging TXD+ with RXD+ and TXD- with RXD- before connecting to the RS485 module.

Arduino Code:

#include <ModbusMaster.h>
#include <SoftwareSerial.h>

#define RX_PIN 10
#define TX_PIN 11
#define DE_RE_PIN 2

SoftwareSerial RS485Serial(RX_PIN, TX_PIN);
ModbusMaster node;

void preTransmission() {
digitalWrite(DE_RE_PIN, HIGH); // Enable transmission
}

void postTransmission() {
digitalWrite(DE_RE_PIN, LOW); // Enable reception
}

void setup() {
Serial.begin(9600);
RS485Serial.begin(19200);
pinMode(DE_RE_PIN, OUTPUT);
digitalWrite(DE_RE_PIN, LOW);

node.begin(20, RS485Serial);
node.preTransmission(preTransmission);
node.postTransmission(postTransmission);
}

void loop() {
uint8_t result = node.readHoldingRegisters(40005, 2);

if (result == node.ku8MBSuccess) {
Serial.print("Register read: ");
Serial.println(node.getResponseBuffer(0));
} else {
Serial.print("Read error, code: ");
Serial.println(result, HEX);

Serial.print("Bytes in RS485 buffer: ");
Serial.println(RS485Serial.available());

while (RS485Serial.available()) {
  byte b = RS485Serial.read();
  Serial.print("0x");
  if (b < 16) Serial.print("0");
  Serial.print(b, HEX);
  Serial.print(" ");
}
Serial.println();

}

delay(2000);
}

Issue:

  • I always get the error code: 0xE0.
  • The RS485 buffer sometimes contains 11 bytes, but I don’t know if it’s a valid response or garbage data.
  • I'm unsure whether the wiring is correct or if I need to send an initialization command.
  • Could SoftwareSerial be affecting the Modbus communication?

Questions:

  1. Has anyone successfully connected a MaxiMet GMX600 via RS485 and Modbus?
  2. Is my wiring correct (bridging TXD+ with RXD+ and TXD- with RXD-)?
  3. Do I need to configure any specific Modbus function code for this station?
  4. Should I use a USB-RS485 adapter to debug the communication first?

I moved your topic to an appropriate forum category @fabiangv .

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

I'm not a modbus guru by any means but I think the above line isn't quite correct. Instead of 40005, I think you need 5 (or is it 4 as there's a subtract 1 sometimes!!!).

The 40000 part is, I think, taken care of because you are calling the readHoldingRegisters function.

Hopefully a modbus guru will comment....

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.