1

I have a Temperature and Humidity Sensor (R444A01) connected to a LogicMachine (LM5LP2) via MODBUS RTU (RS485 port).

Sensor R444A01 Datasheet (Please bear in mind we are talking about a non-expensive device, poorly documented and with no support, aside from some User Reviews and Vendor Specifications)

This is my (very simple) code:

{
  "manufacturer": "Embedded Systems",
  "description": "Sensor R444A01",
  "mapping": [
    {
      "name": "Temperature",
      "bus_datatype": "float16",
      "datatype": "int16",
      "type": "register",
      "address": 0,
      "value_multiplier": 0.1,
      "units": "C"
    },
    {
      "name": "Humidity",
      "bus_datatype": "float16",
      "datatype": "uint16",
      "type": "register",
      "address": 1,
      "value_multiplier": 0.1,
      "units": "%"
    }
  ]
} 

The issue that I'm facing is that, when mapping these 2 addresses to a KNX address, if I only map 1 address, then I can read it, but if I map both of them, then I can only read "Temperature" (which happens to be the first address in my code). Here's a picture of what I see: KNX address mapping for MODBUS addresses

Apparently, for Humidity value, the LogicMachine reads the lowest possible number an int16 can give (32768), even though the received data should be uint16 datatype as it's Humidity (a percentage value) that we are talking about.

Finally, here is what the Modbus Poll Log says (suggesting that I should be able to read both the Temperature and Humidity values):


[18/05/2021 21:51:32] Modbus Request (COM10)

Address: 1 Function: 3 (0x03) - Read Holding Registers Starting Address: 0 Quantity: 2

Checksum: 50187(OK)


[18/05/2021 21:51:32] Modbus Response (COM10)

Address: 1 Function: 3 (0x03) - Read Holding Registers

Byte Count: 4
Values: 00 f3 01 ea 
    Register0: 243
    Register1: 490

Checksum: 35359(OK)


Don't know if anybody has any idea why this could be happening, but I appreciate any responses.

Thank you very much.

David
  • 21
  • 6
  • 1
    It's really hard to say since your sensor is so poorly documented but this might actually be a limitation of its firmware: what if it can only read/write **one register** with each query? It would be surprising but not unheard of for such a *non-premium* quality device. If you want to be sure you can try Modpoll or [QModMaster](https://sourceforge.net/projects/qmodmaster/) if you have a serial port on your laptop or desktop. – Marcos G. May 18 '21 at 07:45
  • I've been thinking about that as a real possibility for the next 24 hours after not being able to solve this issue. I'll use the Modbus Poll software you are suggesting and will post any new findings. – David May 18 '21 at 09:50
  • 1
    Good luck then. I hope it's something else. It would make no sense to impose such a ridiculous limit but with these kind of products you never know. – Marcos G. May 18 '21 at 11:02
  • Hey there @MarcosG. I added the modbus poll log and, as far as I understand, it shows that I should be able to read both values (temp. and humidity) at the same time? Thanks a lot for helping out btw. – David May 18 '21 at 21:08
  • 1
    great, that's a relief... I guess the LogicMachine master is sending two separate queries too close to each other and the slave is not able to cope. You might need to tweak that somehow... or maybe read both registers on a single query. – Marcos G. May 19 '21 at 05:50
  • Hi @MarcosG. You were right all along, I'll put the solution on the answer to the question but wanted to say thank you and give credit to you for helping me out. I'm new to this forum so I don't know what's the way to adequately rate your response but, meanwhile, I'll make sure to make it clear in the Answer that you helped. – David May 19 '21 at 23:52
  • 1
    Hello David. Good to know you fixed it. As far as I'm concerned you acted the right way: I gave you some helpful pointers but you fixed the issue yourself hence you have the right to answer your own question. You can also add the tick to mark it solved, I think your question can be very helpful to others. See you around! – Marcos G. May 20 '21 at 05:12

1 Answers1

1

As @Marcos G. pointed out in the question's comments, it turns out that the only way to succesfully ask the Sensor R444A01 about the values of multiple registers is to read these registers on a single query, instead of 1 query per 1 register.

Therefore, I needed to make use of the following keys: "read_count" and "read_offset".

Here is the correct code in order to read both Temperature and Humidity values on a single query:

{
  "manufacturer": "Embedded Systems",
  "description": "Sensor R444A01",
  "mapping": [
    {
      "name": "Temperature",
      "bus_datatype": "float16",
      "type": "register",
      "address": 0,
      "read_offset": 0,
      "read_count": 2,
      "value_multiplier": 0.1,
      "units": "ºC"
    },
    {
      "name": "Humidity",
      "bus_datatype": "float16",
      "type": "register",
      "address": 0,
      "read_offset": 1,
      "read_count": 2,
      "value_multiplier": 0.1,
      "units": "%"
    }
  ]
}
David
  • 21
  • 6