OTGW keeps resetting with reason 'stuck in a loop'
Posted: Mon May 23, 2022 10:02 pm
I connected the OTGW to my AWB boiler, without thermostat. Almost everytime after sending MessageID 57 to the boiler, the communication stops. When the watchdog resets the gateway, the last reset reason is 'stuck in a loop'. The logging is shown below.
By looking at the LED's (LED C configured as B and LED D configured as T), there seems to be a message which is sent to the thermostat after transmitting and receiving MessageID 57, while there isn't a thermostat connected.
The issue seems to be in the code below. When I edit the the line "movlw 'T'" to "movlw 'M'", the LED doens't blink any more, while the maintenance LED starts blinking, so I'm pretty sure the issue appears in this part of code. For some reason the MsgResponse bit seams to be cleared somewhere.
Please let me know if I can do some additional testing for clearing up this issue.
By looking at the LED's (LED C configured as B and LED D configured as T), there seems to be a message which is sent to the thermostat after transmitting and receiving MessageID 57, while there isn't a thermostat connected.
Code: Select all
21:26:19.592816 OpenTherm Gateway 5.3
21:26:19.634884 Thermostat disconnected
21:26:20.563054 R00000000 Read-Data Status: 00000000 00000000
21:26:20.658087 BC0000000 Read-Ack Status: 00000000 00000000
21:26:21.581012 R80190000 Read-Data Boiler water temperature: 0.00
21:26:22.571315 R80190000 Read-Data Boiler water temperature: 0.00
21:26:22.681723 B40191700 Read-Ack Boiler water temperature: 23.00
21:26:23.596453 R10010000 Write-Data Control setpoint: 0.00
21:26:23.691569 BD0010000 Write-Ack Control setpoint: 0.00
21:26:24.615230 R00060000 Read-Data Remote parameter flags: 00000000 00000000
21:26:25.603912 R00060000 Read-Data Remote parameter flags: 00000000 00000000
21:26:25.712486 B40060301 Read-Ack Remote parameter flags: 00000011 00000001
21:26:26.619393 R00110000 Read-Data Relative modulation level: 0.00
21:26:26.720131 BC0110000 Read-Ack Relative modulation level: 0.00
21:26:27.650908 R001B0000 Read-Data Outside temperature: 0.00
21:26:28.640688 R001B0000 Read-Data Outside temperature: 0.00
21:26:28.735172 B601B0000 Data-Inv Outside temperature: 0.00
21:26:29.652226 R801C0000 Read-Data Return water temperature: 0.00
21:26:29.763061 B401C1800 Read-Ack Return water temperature: 24.00
21:26:30.679113 R900E6400 Write-Data Maximum relative modulation level: 100.00
21:26:30.774015 B500E6400 Write-Ack Maximum relative modulation level: 100.00
21:26:31.706056 R00300000 Read-Data DHW setpoint boundaries: 0 0
21:26:31.799355 B40303F26 Read-Ack DHW setpoint boundaries: 63 38
21:26:32.714280 R00000000 Read-Data Status: 00000000 00000000
21:26:32.825221 BC0000000 Read-Ack Status: 00000000 00000000
21:26:33.737059 R80190000 Read-Data Boiler water temperature: 0.00
21:26:34.736530 R80190000 Read-Data Boiler water temperature: 0.00
21:26:34.830195 B40191700 Read-Ack Boiler water temperature: 23.00
21:26:35.745545 R10010000 Write-Data Control setpoint: 0.00
21:26:35.854108 BD0010000 Write-Ack Control setpoint: 0.00
21:26:36.769659 R80380000 Read-Data DHW setpoint: 0.00
21:26:37.762926 R80380000 Read-Data DHW setpoint: 0.00
21:26:37.873063 BE0383F00 Data-Inv DHW setpoint: 63.00
21:26:38.786700 R00390000 Read-Data Max CH water setpoint: 0.00
21:26:38.882324 B40394900 Read-Ack Max CH water setpoint: 73.00
21:26:57.286287 Command: PR=Q
21:26:57.343862 PR: Q=L
Code: Select all
SendMessage movlw 1
movwf quarter ;Initialize the state counter
bsf NextBit ;Start bit is 1
bsf Transmit ;Starting to transmit a message
movlw 'X' ;Transmit function
pagesel Message
call SwitchOnLED ;Switch on the transmit LED
movlw 'T' ;Thermostat function
btfss MsgResponse
SendBoiler movlw 'B' ;Boiler function
; In package Message
call SwitchOnLED ;Switch on the boiler or thermostat LED
movlw SlaveMask ;Transmitting to the boiler
btfsc MsgResponse ;Check message direction
movlw MasterMask ;Transmitting to the thermostat
movwf outputmask
movlw 34 ;A message is 32 bits + start & stop bit
movwf bitcount ;Load the counter
bsf STATUS,RP0
bsf PIE1,TMR2IE ;Enable timer 2 interrupts
bcf STATUS,RP0
movlw PERIOD
movwf TMR2 ;Prepare timer 2 to overflow asap
bsf T2CON,TMR2ON ;Start timer 2