tripplet / vbus-collector

Collects serial data from the Resol BS+ controller
GNU General Public License v3.0
5 stars 4 forks source link

Segmentation fault #3

Closed jolas-rui closed 6 months ago

jolas-rui commented 6 months ago

Hello,

Great job geting this going. I went through all the steps but when I run he command to check if the collector is working, I get this:

/srv/vbus/collector/vbus-collector --delay 1 /dev/tty_resol vbus-collector v1.4.1-5-g3e53b16

System time:1088:00, Sensor1 temp:45.6C, Sensor2 temp:47.1C, Sensor3 temp:47.3C, Sensor4 temp:888.8C, Pump speed1:0%, Pump speed2:255%, Hours1:267, Hours2:65535 Segmentation fault

Then, when I try to run the service at systemd, I get this:

pi@raspberrypi:/var/log $ sudo systemctl status monitor-vbus × monitor-vbus.service - Monitor resol vbus temperatures Loaded: loaded (/etc/systemd/system/monitor-vbus.service; linked; preset: enabled) Active: failed (Result: signal) since Mon 2024-03-04 16:58:00 WET; 8s ago Duration: 42.754s Process: 1857 ExecStart=/srv/vbus/collector/vbus-collector --config /srv/vbus/collector/options.json (code=killed, signal=SEGV) Main PID: 1857 (code=killed, signal=SEGV) CPU: 51ms

Mar 04 16:57:17 raspberrypi systemd[1]: Started monitor-vbus.service - Monitor resol vbus temperatures. Mar 04 16:57:18 raspberrypi vbus-collector[1857]: vbus-collector v1.4.1-5-g3e53b16 Mar 04 16:58:00 raspberrypi systemd[1]: monitor-vbus.service: Main process exited, code=killed, status=11/SEGV Mar 04 16:58:00 raspberrypi systemd[1]: monitor-vbus.service: Failed with result 'signal'.

Something wrong?

tripplet commented 6 months ago

Hmm the data looks strange, System time should be HH:MM in 24 hour format and 1088 looks like some data is not correctly parsed. But the line is only printed if the CRC checks indicate a valid packet. It might be that your Resol devices send a different formatted packet, can you try:

/srv/vbus/collector/vbus-collector --verbose --delay 1 /dev/tty_resol

to give a more detailed output.

You can see the assumed packet format here: https://github.com/tripplet/vbus-collector/blob/master/datatypes.h

It might be not correct for your Resol device, which one are you using?

jolas-rui commented 6 months ago

Hey Tobias,

Thanks for the quick reply. Here is the result of what you asked me to try:

pi@raspberrypi:~ $ /srv/vbus/collector/vbus-collector --verbose --delay 1 /dev/tty_resol
vbus-collector v1.4.1-5-g3e53b16
Setting baudrate...
Collecting data...

aa New packet
15 00 7b 42 10 00 01 0a 12 01 08 00 00 00 76 1e
00 7f 7f 0c 57 02 0a 00 00 00 73 0a 01 50 01 17

aa New packet
15 00 7b 42 10 00 01 0a 12 01 08 00 00 00 76 1e
00 7f 7f 0c 57 02 0a 00 00 00 73 35 01 73 01 01
54 00 00 00 00 00 7f 01 0b 00 00 00 73 00 00 00
00 00 7f 02 01 00 0b 00 71 35 01 73 01 01 54 32
02 38 22 04 6d

Packet size: 70. Source: 0x427b, Destination: 0x0015, Command: 0x0100, #Frames: 10, CRC: 0x12(ok)
Ignoring unkown packet!

aa New packet
00 00 7b 42 20 00 05 00 00 00 00 00 00 00 1d

aa New packet
10 00 7b 42 10 00 01 09 18 35 01 73 01 01 54 32
02 38 22 04 6d 1e 7f 49 10 06 03 00 7f 00 00 02
7e 0b 01 7f 7f 0c 69 00 00 77 04 00 04 00 00 00
00 00 7f 00 00 00 00 00 7f 68 00 00 00 00 17

Packet size: 64. Source: 0x427b, Destination: 0x0010, Command: 0x0100, #Frames: 9, CRC: 0x18(ok)
Bytes: 35017301, Septett: 01, crc: 54(ok)
Bytes: 32023822, Septett: 04, crc: 6d(ok)
Bytes: 1e7f4910, Septett: 06, crc: 03(ok)
Bytes: 007f0000, Septett: 02, crc: 7e(ok)
Bytes: 0b017f7f, Septett: 0c, crc: 69(ok)
Bytes: 00007704, Septett: 00, crc: 04(ok)
Bytes: 00000000, Septett: 00, crc: 7f(ok)
Bytes: 00000000, Septett: 00, crc: 7f(ok)
Bytes: 68000000, Septett: 00, crc: 17(ok)

System time:1088:00, Sensor1 temp:43.7C, Sensor2 temp:37.1C, Sensor3 temp:56.2C, Sensor4 temp:888.8C, Pump speed1:30%, Pump speed2:255%, Hours1:267, Hours2:65535
Segmentation fault

As for the Resol device I am using, it is a USB DL2. This is what I got from from "lsusb", which is the same VID and PID that you had, I believe:

pi@raspberrypi:/srv/vbus/collector $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1fef:2018
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Regarding the RESOL device that I am connecting to, when I connected through windows, I got this information:

VBus #0: DeltaSol BS 2009 (0x427B)                                                                              VBus #0: DeltaSol BS 2009 (0x427B) => Standard-Infos (0x0015)                                       
Date    Temperature sensor 1 [ °C]  Temperature sensor 2 [ °C]  Temperature sensor 3 [ °C]  Temperature sensor 4 [ °C]  Pump speed relay 1 [%]  Pump speed relay 2 [%]  Operating hours relay 1 [ h]    Operating hours relay 2 [ h]    UnitType [] System []   ErrorMask []    System time []  Sensor 1 defective []   Sensor 2 defective []   Sensor 3 defective []   Sensor 4 defective []   Status mask []  Heat quantity [ Wh] SW Version []   Variant []  *** PUMP SPEED *** []   R1 [ %] R2 [ %] *** SMART DISPLAY *** []    S1 [ °C]    S2 [ °C]    Heat [ Wh]  *** ERROR MASK *** []   ErrorMask1 []   *** TEMPERATURE *** []  
2/mar/2024 17:28:00 16,9    28,0    43,5    888,8   0   0   4289    0   11  1   0   02:29   0   0   0   0   0   0   1,04    0   ------------    0   0   ------------    16.9    28.0    0   ------------    0 (0x00000000)  To implement    
2/mar/2024 17:29:00 16,8    27,9    43,5    888,8   0   0   4289    0   11  1   0   02:30   0   0   0   0   0   0   1,04    0   ------------    0   0   ------------    16.8    27.9    0   ------------    0 (0x00000000)  To implement    
2/mar/2024 17:30:00 16,8    27,9    43,5    888,8   0   0   4289    0   11  1   0   02:31   0   0   0   0   0   0   1,04    0   ------------    0   0   ------------    16.8    27.9    0   ------------    0 (0x00000000)  To implement    
2/mar/2024 17:32:14 16,8    27,9    43,5    888,8   0   0   4289    0   11  1   0   02:31   0   0   0   0   0   0   1,04    0   ------------    0   0   ------------    16.8    27.9    0   ------------    0 (0x00000000)  To implement    
2/mar/2024 17:33:00 16,8    27,9    43,5    888,8   0   0   4289    0   11  1   0   02:31   0   0   0   0   0   0   1,04    0   ------------    0   0   ------------    16.8    27.9    0   ------------    0 (0x00000000)  To implement    
2/mar/2024 17:34:00 16,8    27,9    43,5    888,8   0   0   4289    0   11  1   0   02:31   0   0   0   0   0   0   1,04    0   ------------    0   0   ------------    16.8    27.9    0   ------------    0 (0x00000000)  To implement    

Looking forward to hear from you! Thanks!

tripplet commented 6 months ago

Thanks for the detailed log data, I added support for the DeltaSol BS 2009 data format based on your log data. Can you update and try again?

jolas-rui commented 6 months ago

Worked like a charm. Thanks for you support!