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:
- Has anyone successfully connected a MaxiMet GMX600 via RS485 and Modbus?
- Is my wiring correct (bridging TXD+ with RXD+ and TXD- with RXD-)?
- Do I need to configure any specific Modbus function code for this station?
- Should I use a USB-RS485 adapter to debug the communication first?