HA unreachable in cloud and lan

Hello,

I have HA on RBPI3B with Raspberrymatic add-on, and every 10-15 min. HA is losing the internet connection for a few seconds and then it gets back online, but sometimes, say once a day it doesn’t come back online, just becomes unreachable and needs a power cycle, then works well for a few hours and then again becomes unreachable. I have changed the power cable, the power supply, the lan cable, the router… and no results and to be honest is driving me crazy…

These are the errors in the log.

Error fetching yamaha_musiccast data:
10:21:25 – (ERROR) MusicCast - mesajul a apărut prima dată pe 10:01:09 și apare de 4 ori
check_connection failed: No clients exist. Trying to create clients for server RaspberryMatic
09:59:39 – (WARNING) runner.py - mesajul a apărut prima dată pe 09:58:42 și apare de 9 ori
_do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}
09:59:24 – (WARNING) runner.py - mesajul a apărut prima dată pe 09:58:55 și apare de 24 ori
_create_clients failed: Interface: BidCos-RF is not available for backend.
09:58:42 – (WARNING) Homematic(IP) Local (custom integration)
_do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}
09:58:42 – (WARNING) Homematic(IP) Local (custom integration) - mesajul a apărut prima dată pe 09:58:42 și apare de 4 ori
Config entry ‘Twinkly_9B28CD’ for twinkly integration not ready yet; Retrying in background
09:58:42 – (WARNING) config_entries.py - mesajul a apărut prima dată pe 09:58:29 și apare de 3 ori
Setup of media_player platform dlna_dmr is taking over 10 seconds.
09:58:42 – (WARNING) Media Player
create_clients failed: Unable to create client for central [(‘Unable to connect (<ProtocolError for de838cd8-raspberrymatic:2010/RPC2: 503 Service Unavailable>,).’,)]. Check logs.
09:58:34 – (WARNING) /usr/local/lib/python3.10/site-packages/hahomematic/central_unit.py - mesajul a apărut prima dată pe 09:58:34 și apare de 2 ori
Fetched https://alexa-api.nabucasa.com/access_token (400)
09:57:55 – (WARNING) components/cloud/alexa_config.py
[548212448448] Disconnected: Did not receive auth message within 10 seconds
09:57:55 – (WARNING) Home Assistant WebSocket API
Setup of hassio is taking over 10 seconds.
09:57:44 – (WARNING) runner.py
Ended unfinished session (id=87 from 2022-11-07 21:51:00.488792)
09:57:21 – (WARNING) Recorder
The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
09:57:19 – (WARNING) Recorder

Full log:

2022-11-08 12:27:08.808 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2022-11-08 12:27:08.815 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ytube_music_player which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2022-11-08 12:27:08.822 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration homematicip_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2022-11-08 12:27:08.828 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dwains_dashboard which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2022-11-08 12:27:08.833 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hikconnect which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2022-11-08 12:27:26.808 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

2022-11-08 12:27:27.510 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=88 from 2022-11-08 07:57:19.595316)

2022-11-08 12:27:36.700 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.

2022-11-08 12:27:49.735 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds.

2022-11-08 12:28:00.419 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)

2022-11-08 12:28:32.838 WARNING (MainThread) [hahomematic.central_unit] create_clients failed: Unable to create client for central [(‘Unable to connect (<ProtocolError for de838cd8-raspberrymatic:9292/groups: 503 Service Unavailable>,).’,)]. Check logs.

2022-11-08 12:28:33.416 WARNING (MainThread) [hahomematic.central_unit] create_clients failed: Unable to create client for central [(‘Unable to connect (<ProtocolError for de838cd8-raspberrymatic:2010/RPC2: 503 Service Unavailable>,).’,)]. Check logs.

2022-11-08 12:28:37.711 WARNING (MainThread) [homeassistant.config_entries] Config entry ‘Canon G6000 series’ for ipp integration not ready yet: Invalid response from API: Error occurred while communicating with IPP server.; Retrying in background

2022-11-08 12:28:37.736 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:28:37.800 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:28:39.706 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:28:39.710 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:28:39.716 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: BidCos-RF is not available for backend.

2022-11-08 12:28:40.347 WARNING (MainThread) [hahomematic.central_unit] check_connection failed: No clients exist. Trying to create clients for server RaspberryMatic

2022-11-08 12:28:41.196 WARNING (MainThread) [homeassistant.config_entries] Config entry ‘Twinkly_9B28CD’ for twinkly integration not ready yet; Retrying in background

2022-11-08 12:28:41.263 WARNING (MainThread) [hahomematic.central_unit] create_clients failed: Unable to create client for central [(‘Unable to connect (<ProtocolError for de838cd8-raspberrymatic:9292/groups: 503 Service Unavailable>,).’,)]. Check logs.

2022-11-08 12:28:47.597 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform dlna_dmr is taking over 10 seconds.

2022-11-08 12:28:47.738 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.88.165 for yamaha_musiccast

Traceback (most recent call last):

File “/usr/local/lib/python3.10/site-packages/aiomusiccast/pyamaha.py”, line 248, in request_json

response = await self.get(args[0])

File “/usr/local/lib/python3.10/site-packages/aiomusiccast/pyamaha.py”, line 268, in get

return await self.client.get(uri.format(host=self.ip), headers=self._headers, timeout=ClientTimeout(total=5))

File “/usr/local/lib/python3.10/site-packages/aiohttp/client.py”, line 559, in _request

await resp.start(conn)

File “/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py”, line 898, in start

message, payload = await protocol.read() # type: ignore[union-attr]

File “/usr/local/lib/python3.10/site-packages/aiohttp/streams.py”, line 616, in read

await self._waiter

aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 365, in async_setup

result = await component.async_setup_entry(hass, self)

File “/usr/src/homeassistant/homeassistant/components/yamaha_musiccast/init.py”, line 81, in async_setup_entry

await coordinator.musiccast.device.enable_polling()

File “/usr/local/lib/python3.10/site-packages/aiomusiccast/pyamaha.py”, line 194, in enable_polling

await self.request_json(System.get_device_info())

File “/usr/local/lib/python3.10/site-packages/aiomusiccast/pyamaha.py”, line 256, in request_json

raise MusicCastConnectionException() from ce

aiomusiccast.exceptions.MusicCastConnectionException

2022-11-08 12:28:48.801 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:28:48.828 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:28:49.281 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:28:49.299 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:28:49.311 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: HmIP-RF is not available for backend.

2022-11-08 12:28:49.904 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:28:49.910 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:28:51.099 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:28:51.110 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:28:51.120 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: BidCos-RF is not available for backend.

2022-11-08 12:29:06.134 WARNING (MainThread) [hahomematic.central_unit] check_connection failed: No clients exist. Trying to create clients for server RaspberryMatic

2022-11-08 12:29:07.046 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:07.092 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:07.479 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:07.497 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:07.519 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: VirtualDevices is not available for backend.

2022-11-08 12:29:08.078 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:08.116 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:08.548 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:08.563 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:08.582 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: HmIP-RF is not available for backend.

2022-11-08 12:29:09.077 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:09.091 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:09.525 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:09.536 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:09.549 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: BidCos-RF is not available for backend.

2022-11-08 12:29:24.575 WARNING (MainThread) [hahomematic.central_unit] check_connection failed: No clients exist. Trying to create clients for server RaspberryMatic

2022-11-08 12:29:25.215 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:25.223 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:25.946 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:25.951 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:25.954 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: VirtualDevices is not available for backend.

2022-11-08 12:29:26.554 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:26.564 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:26.952 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:26.961 WARNING (MainThread) [hahomematic.json_rpc_client] _post failed: Error while logging in via JSON-RPC.

2022-11-08 12:29:26.971 WARNING (MainThread) [hahomematic.central_unit] _create_clients failed: Interface: HmIP-RF is not available for backend.

2022-11-08 12:29:27.517 WARNING (MainThread) [hahomematic.json_rpc_client] _do_login failed: Unable to open session: {‘name’: ‘JSONRPCError’, ‘code’: 503, ‘message’: ‘service not available’}

2022-11-08 12:29:27.523 WARNING (MainThread) [hahomematic.json_rpc_client] _post_script failed: Error while logging in via JSON-RPC.

2022-11-08 12:45:01.994 ERROR (MainThread) [homeassistant.components.bluetooth.scanner] hci0 (B8:27:EB:C6:F4:44): Error stopping scanner: [org.bluez.Error.InProgress] Operation already in progress

2022-11-08 12:47:01.970 ERROR (MainThread) [homeassistant.components.bluetooth.scanner] hci0 (B8:27:EB:C6:F4:44): Error stopping scanner: [org.bluez.Error.InProgress] Operation already in progress

It looks like you might have several issues.

First there is some media control that you need to check.
It looks like Yamaha MusicCast is trying to set up a client on the RaspberryMatic server. I do not know if this is intended, but look into the warnings and error and maybe ask a question here regarding that specific integration.

You might also have some issues with Media Player.
This looks like the Media Player is trying to connect to port 2010, but that port is probably controlled by the RaspberryMatic integration and have nothing to do with medias.

And you also have a mismatched setup between RaspberryMatic and Homematic Local.
I do not know RaspberryMatic, but you need to set up services for BidCosRF and JSONRPC among others in RaspberryMatic or disable the service calls in Homematic Local.
If you look at GitHub - danielperna84/custom_homematic: Custom Home Assistant Component for HomeMatic and find the Firewall section, then it lists the normal ports to have up and running between the two integrations. Opening up the ports might be easier than trying to shut them down, but again ask on the forums here.

Lastly it looks like you might have an access token issue with Nabu Casa and Alexa, so you need to check if that connection succeed later in the logs or if you might have to renew a token or something.

I will check the Raspberrymatic settigs, thanks.

I don’t use Alexa so I don’t have any tokens… I think.
About the Musiccast, it’s off because I swaped it for a Sonos DAC. Maybe because it’s off it’s causing the error.

This looks like you have something set up anyway.
I do not use Alexa myself, but (400) could be an error code.

Fetched https://alexa-api.nabucasa.com/access_token (400)
09:57:55 – (WARNING) components/cloud/alexa_config.py

I’ve lost my patience and I reinstalled everything fresh on another SD card and for the last 12h everything is working as is should. I’'ve had only one internet connection drop and no HA crashing. I will test for the next few days untill my new RPI4 8Gb will arrive and the I will install everyting again on the new RPI4 with SSD. I hope there will be no more problems in the future with the new hardware.
@WallyR, thanks for your time.

A pleasure and try to keep an eye on the logs for errors and warnings.
Discovering them early means that there is a chance for a common problem that will be fresh in the forum users memory and therefore quicker to fix. :slight_smile:
Good luck on the RPi4. It is much better, but it requires a good and stable power supply and also cooling, which might be passive.
You can use it without cooling, but it will only perform like 40% of its potential max then, before the safety features step in to lower the clock frequency on the chips.

Thanks for the hits. I already ordered a 3A power supply, passive coolers and a cooling fan just to be sure.

I think I found what the problem was/is…
For the last few days while I was swapping cards, etc. the RPI was on the stairs half opened case and as I said, it work very well after reinstalling the other SD card… but, today I wrapped everything up, closed the DIN railcase, mounted the system in wall box… and half hour ago… booom… offline again… restarted it and no errors… so my thoughts go to overheating, hence the closed case and closed wall box and no cooling, neither passive nor active.

That will for sure make it crash.
It needs to be able to get the heat away and a passive heatsink or an active fan will not make a difference if the case is closed off.