# Problem with reading the temperature from the device via RS485 Modbus

**URL:** <https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648>\
**Category:** General Guidance\
**Created:** [March 3, 2026, 6:06pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648 "2026-03-03T18:06:09Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![brendy32530](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brendy32530/32/703658_2.png) [@brendy32530](https://forum.arduino.cc/u/brendy32530)\
**Post date:** [March 3, 2026, 6:06pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/1 "2026-03-03T18:06:09Z")

</div>

Hi everyone

I've tried various methods, but I still get a reading error. I've switched the A/B cables, but nothing helps.

There's a diagram on the device. I'm not sure if I understand correctly, but I connected A and B to the top pins, then swapped them around, and nothing helped.

![pic](https://europe1.discourse-cdn.com/arduino/original/4X/f/0/b/f0b5500185d379400fcf968a3b8d4e385a5221d3.png)

In the documentation it says that register 30001 is the temperature value and I set the device to mode "1" RS485.

I have **ERROR: E2**

 ![pic2](https://europe1.discourse-cdn.com/arduino/original/4X/8/8/0/880daf821bce3a1dc8515f64a43bb58021f936a7.png)

```arduino
/*
RS485 ESP
vcc vcc
gnd gnd
TX D1
RX D2

*/

#define SSERIAL_RX_PIN 4
#define SSERIAL_TX_PIN 5

#include <ModbusMaster.h>
#include <SoftwareSerial.h>
SoftwareSerial RS485Serial(SSERIAL_RX_PIN, SSERIAL_TX_PIN);
ModbusMaster node;

void Read_Sensor() {
  static uint32_t timestamp = 0;

  if (millis() - timestamp >= 1000) {
    timestamp = millis();  

    // Request 2 registers starting at 0x0001
     uint8_t result = node.readInputRegisters(0x0000, 1);
    //uint8_t result = node.readHoldingRegisters(0x0000, 3);

    if (result == node.ku8MBSuccess) {
      // Get response data from sensor
      Serial.print("Read Success !!!: ");
      Serial.println(float(node.getResponseBuffer(0) / 10.00F));

    } else {
      Serial.print("ERROR: ");
      Serial.println(result, HEX);  
    }
  }
}

void setup() {

  Serial.begin(115200);
  RS485Serial.begin(9600);

  // Modbus slave ID 1
  node.begin(1, RS485Serial);
}
void loop() {

  Read_Sensor();
}

```

```arduino

```

Only the TX LED on the RS converter flashes. The RX LED only flashes once upon connection or reset. If the RX LED flashes once, does that mean the wiring is OK?

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [March 3, 2026, 6:18pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/2 "2026-03-03T18:18:04Z")

</div>

> [@brendy32530](#):
>
> to the top pins

Why the top pins? Why not the bottom pins or one of the top and one of the bottom?

How do you know it's RS485 and not prokey?

---

<div class="post-metadata">

**Author:** ![brendy32530](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brendy32530/32/703658_2.png) [@brendy32530](https://forum.arduino.cc/u/brendy32530)\
**Post date:** [March 3, 2026, 6:40pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/3 "2026-03-03T18:40:21Z")

</div>

> [@jim-p](#):
>
> Why the top pins? Why not the bottom pins or one of the top and one of the bottom?
> 
> How do you know it's RS485 and not prokey?

I don't understand the manufacturer markings on the housing.  
I thought that the RS485 markings at the top meant the top pins.  
I don't know what strategy to use?

**[Tłumacz rozmowy](https://www.google.com/search?q=translator&sca_esv=d71bc1ae2c716a3c&sxsrf=ANbL-n6E_PWD9zbly26LEwCLpivqomotAQ%3A1772559056319&source=hp&ei=0BqnacKWEcyH7NYPj6eYqQc&biw=433&bih=822&oq=&gs_lp=EhFtb2JpbGUtZ3dzLXdpei1ocCIAKgIIADIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHEC4YJxjqAjINECMY8AUYJxjqAhieBjINECMY8AUYJxjqAhieBjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHEC4YJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjINECMY8AUYJxjJAhjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjINECMY8AUYJxjqAhieBjINECMY8AUYJxjqAhieBjINECMY8AUYJxjJAhjqAjIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEC4YAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEC4YAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEC4YAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBAUiDClAAWABwAXgAkAEAmAEAoAEAqgEAuAEByAEAmAIBoAIhqAItmAMh4gMFEgExIEDxBYyd9CCA9HWVugYECAEYCpIHATGgBwCyBwC4BwDCBwM0LTHIByCACAA&sclient=mobile-gws-wiz-hp#)**

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [March 3, 2026, 6:40pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/4 "2026-03-03T18:40:49Z")

</div>

> [@brendy32530](#):
>
> `SoftwareSerial RS485Serial(SSERIAL_RX_PIN, SSERIAL_TX_PIN);`

SoftwareSerial cannot send and receive at the same time.  
This can (and often will) give problems in reliability.

Have you tried to use a HardwareSerial for the RS485.  
If this doesn't work either, it reduces the number of possible causes.

---

<div class="post-metadata">

**Author:** ![brendy32530](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brendy32530/32/703658_2.png) [@brendy32530](https://forum.arduino.cc/u/brendy32530)\
**Post date:** [March 3, 2026, 6:44pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/5 "2026-03-03T18:44:27Z")

</div>

> [@robtillaart](#):
>
> SoftwareSerial cannot send and receive at the same time.  
> This can (and often will) give problems in reliability.
> 
> Have you tried to use a HardwareSerial for the RS485.  
> If this doesn't work either, it reduces the number of possible causes.

I have other RS485 sensors that I use with an ESP8266 with software serial, and they work fine, sending and receiving requests.  
Yes, I tried with an ESP32 on hardware Serial 2, and the same thing happens.  
I have no idea, I keep getting an error​😔

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [March 3, 2026, 6:58pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/6 "2026-03-03T18:58:29Z")

</div>

> [@brendy32530](#):
>
> I have other RS485 sensors that I use with an ESP8266 with software serial, and they work fine, sending and receiving requests.  
> Yes, I tried with an ESP32 on hardware Serial 2, and the same thing happens.

Note you mention 2 different devices.  
Have you got the other RS485 sensors working on the ESP32?

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [March 3, 2026, 7:04pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/7 "2026-03-03T19:04:16Z")

</div>

Error E2 is a timeout IIRC

- double check the pins and wiring

I wrote a simple rs485 sniffer long ago, which might be useful to see if and what data is on the line. Just try to grab the raw bytes that go over the lines.  
You might need an additional board.

[RS485/examples/RS485\_sniffer at master · RobTillaart/RS485 · GitHub](https://github.com/RobTillaart/RS485/tree/master/examples/RS485_sniffer).

---

<div class="post-metadata">

**Author:** ![brendy32530](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brendy32530/32/703658_2.png) [@brendy32530](https://forum.arduino.cc/u/brendy32530)\
**Post date:** [March 3, 2026, 7:36pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/8 "2026-03-03T19:36:45Z")

</div>

> [@robtillaart](#):
>
> Note you mention 2 different devices.  
> Have you got the other RS485 sensors working on the ESP32?

Yes the same sensors work on esp8266 wemos d1 mini and d1 mini esp32.

---

<div class="post-metadata">

**Author:** ![brendy32530](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brendy32530/32/703658_2.png) [@brendy32530](https://forum.arduino.cc/u/brendy32530)\
**Post date:** [March 3, 2026, 7:39pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/9 "2026-03-03T19:39:54Z")

</div>

> [@robtillaart](#):
>
> Error E2 is a timeout IIRC
> 
> - double check the pins and wiring
> 
> I wrote a simple rs485 sniffer long ago, which might be useful to see if and what data is on the line. Just try to grab the raw bytes that go over the lines.  
> You might need an additional board.

Thank you, I'll check the wiring again. I need to find another board and test your code.

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [March 3, 2026, 8:01pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/10 "2026-03-03T20:01:46Z")

</div>

> [@brendy32530](#):
>
> > [@jim-p](#):
> >
> > Why the top pins? Why not the bottom pins or one of the top and one of the bottom?
> > 
> > How do you know it's RS485 and not prokey?
> 
> I don't understand the manufacturer markings on the housing.  
> I thought that the RS485 markings at the top meant the top pins.  
> I don't know what strategy to use?
> 
> **[Tłumacz rozmowy](https://www.google.com/search?q=translator&sca_esv=d71bc1ae2c716a3c&sxsrf=ANbL-n6E_PWD9zbly26LEwCLpivqomotAQ%3A1772559056319&source=hp&ei=0BqnacKWEcyH7NYPj6eYqQc&biw=433&bih=822&oq=&gs_lp=EhFtb2JpbGUtZ3dzLXdpei1ocCIAKgIIADIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHEC4YJxjqAjINECMY8AUYJxjqAhieBjINECMY8AUYJxjqAhieBjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHEC4YJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjINECMY8AUYJxjJAhjqAjIHECMYJxjqAjIHECMYJxjqAjIHECMYJxjqAjINECMY8AUYJxjqAhieBjINECMY8AUYJxjqAhieBjINECMY8AUYJxjJAhjqAjIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEC4YAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEC4YAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEC4YAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBATIQEAAYAxi0AhjqAhiPAdgBAUiDClAAWABwAXgAkAEAmAEAoAEAqgEAuAEByAEAmAIBoAIhqAItmAMh4gMFEgExIEDxBYyd9CCA9HWVugYECAEYCpIHATGgBwCyBwC4BwDCBwM0LTHIByCACAA&sclient=mobile-gws-wiz-hp#)**

Well you have 12 dififferent combinations you could try, some may damage you Arduino and/or RS485 device.  
You are shooting in the dark by not knowing the correct connections.

---

<div class="post-metadata">

**Author:** ![kmin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kmin/32/1147370_2.png) [@kmin](https://forum.arduino.cc/u/kmin)\
**Post date:** [March 3, 2026, 8:06pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/11 "2026-03-03T20:06:07Z")

</div>

> [@brendy32530](#):
>
> Yes the same sensors work on esp8266 wemos d1 mini and d1 mini esp32.

How should we read that?  
And what is this board exactly that doesn't work?

---

<div class="post-metadata">

**Author:** ![brendy32530](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brendy32530/32/703658_2.png) [@brendy32530](https://forum.arduino.cc/u/brendy32530)\
**Post date:** [March 3, 2026, 9:05pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/12 "2026-03-03T21:05:22Z")

</div>

> [@jim-p](#):
>
> Well you have 12 dififferent combinations you could try, some may damage you Arduino and/or RS485 device.  
> You are shooting in the dark by not knowing the correct connections.

```arduino

```

I tried all 12 combinations and nothing.  
When I switched the wires, I got errors E0 and E2.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 30, 2026, 9:05pm UTC](https://forum.arduino.cc/t/problem-with-reading-the-temperature-from-the-device-via-rs485-modbus/1433648/13 "2026-08-30T21:05:44Z")

</div>

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