Janus websocket closes every 300 seconds on pi 5

I have the exact same docker containers on a pi 4 and this doesnt happen, but on my pi 5 around every 300 seconds (not 300 seconds since connection is established between janode and janus, but 300 second intervals on the clock) the connection just dies. Here is a snippet of the janus logs:

[janus] [Thu Mar 20 17:33:56 2025] Got REMB bitrate 178374
[janus] [Thu Mar 20 17:33:57 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:57 2025] [WSS-0x7ffec0008320] Got 105 bytes:
[janus] [Thu Mar 20 17:33:57 2025] [WSS-0x7ffec0008320] First fragment: 105 bytes, 0 remaining
[janus] [Thu Mar 20 17:33:57 2025] {"janus":"keepalive","transaction":"1607239419230322","session_id":5861250162835599,"apisecret":"secret"}
[janus] [Thu Mar 20 17:33:57 2025] [WSS-0x7ffec0008320] Done, parsing message: 105 bytes
[janus] [Thu Mar 20 17:33:57 2025] [WSS-0x7ffec0008320] Parsed JSON message - consumed 105/105 bytes
[janus] [Thu Mar 20 17:33:57 2025] Got a Janus API request from janus.transport.websockets (0x7ffec00020b0)
[janus] [Thu Mar 20 17:33:57 2025] Got a keep-alive on session 5861250162835599
[janus] [Thu Mar 20 17:33:57 2025] Sending Janus API response to janus.transport.websockets (0x7ffec00020b0)
[janus] [Thu Mar 20 17:33:57 2025] [WSS-0x7ffec0008320] Sending WebSocket message (94 bytes)...
[janus] [Thu Mar 20 17:33:57 2025] [WSS-0x7ffec0008320]   -- First=1, Last=1, Requested=94 bytes, Sent=94 bytes, Missing=0 bytes
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:57 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:57 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:57 2025] jitter=183.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:57 2025] rtt=2
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:57 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:57 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:57 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:57 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:57 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:57 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:57 2025] jitter=217.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:57 2025] rtt=1
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:57 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:57 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:57 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:57 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:57 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:57 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:57 2025] jitter=219.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:57 2025] rtt=1
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:57 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:57 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:57 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:57 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:57 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:57 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:57 2025] jitter=265.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:57 2025] Out link quality=100, media link quality=100
[janus] [Thu Mar 20 17:33:57 2025] rtt=2
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:57 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:57 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:57 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:57 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:57 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:57 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:58 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:58 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:58 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:58 2025] jitter=253.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:58 2025] rtt=2
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:58 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:58 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:58 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:58 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:58 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:58 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:58 2025] jitter=321.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:58 2025] rtt=15
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:58 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:58 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:58 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:58 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:58 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:58 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:58 2025] jitter=240.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:58 2025] rtt=2
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:58 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:58 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:58 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:58 2025] No medium with a valid peer SSRC found for transport-wide CC feedback
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741]  Got an RTCP packet
[janus] [Thu Mar 20 17:33:58 2025]    Parsing compound packet (total of 56 bytes)
[janus] [Thu Mar 20 17:33:58 2025]      #1 RR (201)
[janus] [Thu Mar 20 17:33:58 2025] jitter=224.000000, fraction=0, loss=0
[janus] [Thu Mar 20 17:33:58 2025] rtt=3
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 201, length: 32 bytes
[janus] [Thu Mar 20 17:33:58 2025]      #2 REMB -- PSFB (206)
[janus] [Thu Mar 20 17:33:58 2025]        -- -- -- REMB: 179944 * 2^0 = 179944 (1 SSRCs, 2975504650)
[janus] [Thu Mar 20 17:33:58 2025]        RTCP PT 206, length: 24 bytes
[janus] [Thu Mar 20 17:33:58 2025] [5642846587899741] Got video RTCP (56 bytes)
[janus] [Thu Mar 20 17:33:58 2025] Got REMB bitrate 179944
[janus] [Thu Mar 20 17:33:58 2025] [WSS-0x7ffec0008320] 78 ((null))
[janus] [Thu Mar 20 17:33:58 2025] [WSS-0x7ffec0008320] WS connection down, closing
[janus] [Thu Mar 20 17:33:58 2025] [WSS-0x7ffec0008320] Destroying WebSocket client
[janus] [Thu Mar 20 17:33:58 2025] A janus.transport.websockets transport instance has gone away (0x7ffec00020b0)

It seems to always happen when that ((null)) occurs but I am unsure what that is.
Using janus v1.2.1

78 is LWS_CALLBACK_WS_SERVER_DROP_PROTOCOL which, according to the libwebsockets author, is just part of the close flow. This means that’s not the cause, but something that always appears when you close a connection. The fact it happens every 300s makes me think you have something somewhere (that machine, the machine network, your network in general) that’s killing the connection (maybe a firewall?).