Electronics > Projects, Designs, and Technical Stuff

Figuring out an RS485 protocol?

<< < (6/8) > >>

jsouto:
Hi,

Here are my advance:

110568d8ff4353
110568d84002c23e00003f0c03420019080a0d0965de0a000ce983
110568d82d7fff3d00040c002437019a3803b63b02ba3c0048358000bc19
110568d8 – Living room thermostat
40 – Id SetPoint temperature
02c2 – Value
2d7ff – Id real temperature
02ba – Value

Which model of thermostat do you have??



dimmu311:
Hi,
i have also Uponor Device. I want to repace the original uponor room thermostat and use home automation system that has rs485 interface.

With the Infos form here and with the log of one of my thermostat, i think i have some more idea of the protocol, but it is still something missing.

i also have a set nearly looks like the other ones postet here.

10   4   21   77   FF   D3   49                                                                     
10   4   21   77   40   3   4   3E   0   0   3F   0C   8   3B   2   B3   53   D0                                    
10   4   21   77   2D   7F   FF   3D   0   0   0C   0   24   37   1   9A   38   3   B6   3B   2   B3   3C   0   48   35   80   0   4A   31

see this set for example.

i think the first byte is something like device type. i use t145, wich is more basic one then yours.
i think uponor uses diffrent values for diffrent thermostat types.

i also think that this is a poll message form the controller to get the the values from the connectet thermostats.
10   4   21   77   FF   D3   49   

in my case the termostat answers with this to packets.
i think i have found something intressting.
see this messages. i have removed the header at the beginning and the crc at the end
I think the message follows a simple rule. 1 byte messege code, 2 bytes value.
using this rules i think about that:

40   3   4   3E   0   0   3F   0C   8   3B   2   B3                                    
2D   7F   FF   3D   0   0   0C   0   24   37   1   9A   38   3   B6   3B   2   B3   3C   0   48   35   80   0

40 = actual temp = x03x04 -> 772 -> (772-320)/18 = 25,1°C
3E = ?
3F = ?
3B = set Point temp = x2x3B -> 571 -> (571-320)/18 = 20,6°

and the second packet
2D = ? not sure, maybe a value in twos complement. in KNX 7fff is reserved for not available value.
3D = ?
0c = humidity? -> sure about this. the value could be posible, but i dont know if this thermostat is able to messure humidity.
37 = Min possible Set Point Temp (5°C)
38 = Max possible Set Point Temp (35°C)
3B = again the setpont temp
3C = ?

after i study the modbus document i think ther should be some values for:
heating/cooling mode,
day/night mode,
diffrent setpoint temp in cooling mode
diffrent setpoint temp in night mode  (maybe after the 2D) could be -2K or something
actual humidity
setpoint humidity.

so now the problem is: on my thermostat i can only change the setpoint temp. When i change the setpoint temp i can see diffrent value after 3B. When i use hairdryer i can see higher value after 40.

could maybe one of you check if my theory could be bossible? Or mybe somone of you have thermostat wher you can see humidity, or something else to double check if i have found right messeg code.

i have attached excel sheet. you can put your message there and it calculates the thinks i found out.

Thank you

TBuyukkilic:
Hi guys,
This topic really helped me out on my quest. I'm a bit stuck and I don't really know what to do, hopefully you can help out.

So I have a Uponor Smatrix Base X-245 base station with the Uponor Smatrix Base T-146 Bus thermostats. I have 8 of them hooked up, and this is the output I can read using a Raspberry Pi 3B+ and a MAX485 device:

--- Code: ---110c1bcaffbdb4
110c1bca40027d3e00003f0c023c00483b026042b300c856
110c1bca2d7fff3d00000c002437019a3803b63b02603c00483580002928
110c28beff6abb
110c28be4002753e00003f0c0242b3003f71
110c28be2d7fff3d00000c002437019a3803b63b02073c004835800077e1
110c0566ffa0b2
110c05664002753e00003f0c0242b3003285
110c05662d7fff3d00000c002437019a3803b63b02073c00483580008c01
110c04c9ff8c82
110c04c94002d23e00003f0c0242b30011b2
110c04c92d7fff3d00000c002437019a3803b63b02c33c0048358000f596
110c04eaff95b2
110c04ea4002c13e00003f0c0242b3009a8b
110c04ea2d7fff3d00400c002437019a3803b63b02c43c0048358000c2b8
110c04c5ff8982
110c04c54002a03e00003f0c0242b300a39f
110c04c52d7fff3d00000c002437019a3803b63b027c3c00483580004432
110c04dbff8022
110c04db4002c43e00003f0c0242b300c9ea
110c04db2d7fff3d00000c002437019a3803b63b02c33c00483580000ab1
110c055dffb382
110c055d4002873e00003f0c0242b300cdf7
110c055d2d7fff3d00000c002437019a3803b63b027c3c00
--- End code ---

So I was really happen when I was able to read the actual and set temperature values from this response. Since the request/responses adhere to the CRC-16 (Modbus) check, I started an attempt to set the temperatures. So I've installed the Python package minimalmodbus and configured my instrument as follows:

--- Code: ---import minimalmodbus
from gpiozero import OutputDevice
de = OutputDevice(23)
re = OutputDevice(24)
de.off()
re.off()
instrument = minimalmodbus.Instrument('/dev/serial0', 1, minimalmodbus.MODE_RTU)
instrument.serial.timeout = None
instrument.debug = True

--- End code ---

But whatever command I try to send, e.g. instrument.read_register(40006,0,3,True) to read the value set for channel 6, I keep getting the "11 0C" response, which indicates that it's an functioncode 12 "Get Comm Event Log" response.

This is the error:

--- Code: --->>> instrument.read_register(40006,0,3,True)
MinimalModbus debug mode. Will write to instrument (expecting 7 bytes back): 01 03 9C 46 00 01 4B 8F (8 bytes)
MinimalModbus debug mode. Clearing serial buffers for port /dev/serial0
MinimalModbus debug mode. No sleep required before write. Time since previous read: 2965.81 ms, minimum silent period: 2.01 ms.
MinimalModbus debug mode. Response from instrument: 11 0C 1B CA FF BD B4 (7 bytes), roundtrip time: 7.0 ms. Timeout for reading: 0.0 ms.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/minimalmodbus.py", line 486, in read_register
    payloadformat=_Payloadformat.REGISTER,
  File "/usr/local/lib/python3.7/dist-packages/minimalmodbus.py", line 1245, in _generic_command
    payload_from_slave = self._perform_command(functioncode, payload_to_slave)
  File "/usr/local/lib/python3.7/dist-packages/minimalmodbus.py", line 1330, in _perform_command
    response, self.address, self.mode, functioncode
  File "/usr/local/lib/python3.7/dist-packages/minimalmodbus.py", line 1875, in _extract_payload
    responseaddress, slaveaddress, response
minimalmodbus.InvalidResponseError: Wrong return slave address: 17 instead of 1. The response is: '\x11\x0c\x1bÊÿ½´'
--- End code ---

Do you guys know what to do? Is it possible that the Uponor Smatrix Base X-245 only has a subset of the Modbus functions implemented? If so, what would my best shot be to write something back?

I tried to capture a possible request to change the temperature, but all I can see is the log where I went from 21,5°C (707°K, \x02\xc4) to 25,0°C (770°K, \x03\x02)

--- Code: ---110c04eaff95b2
110c04ea4002c43e00003f0c02 42b3008a9b
110c04ea2d7fff3d00000c002437019a3803b63b02c43c0048358000d777

110c04eaff95b2
110c04ea4002c43e00003f0c02 3c00483b030242b3004466
110c04ea2d7fff3d00000c002437019a3803b63b03023c0048358000b0b7

110c04eaff95b2
110c04ea4002c43e00003f0c023c00483b030242b3004466
110c04ea2d7fff3d00400c002437019a3803b63b03023c0048358000a578

110c04eaff95b2
110c04ea4002c43e00003f0c0242b3008a9b
110c04ea2d7fff3d00400c002437019a3803b63b03023c0048358000a578
--- End code ---

mitokondoria:

--- Quote from: dimmu311 on November 15, 2020, 09:32:10 pm ---
could maybe one of you check if my theory could be bossible? Or mybe somone of you have thermostat wher you can see humidity, or something else to double check if i have found right messeg code.


--- End quote ---

Hi dimmu311,

I own a SMatrix Wave with five T146 thermostats. Such thermostats doesn't have any humidity sensor, only a configurable remote temperature sensor.
My only available settings on the unit is modifying the ECO temperature and defining this remote sensor.

I'm working on completing a sketch for a Wemos D1 mini + MAX485 behaving as a sniffer and publishing to a MQTT topic (so homeassistant displays several climate entities). Will publish it as soon as it is "fine"


Edit: I have uploaded thee sketch at https://github.com/witokondoria/homeassistant_uponor

mitokondoria:
I would think that uponor is not following the Modbus protocol partially on each different product

My Smatrix base only uses the function code 0x05 (write single coil) maybe because all of my units are T146. On programmable thermostats (T148), other function codes might be used

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version