Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version regression resolved nearly all problems - 2.14.0 #763

Open
CobraDunn opened this issue Jun 17, 2021 · 53 comments
Open

Version regression resolved nearly all problems - 2.14.0 #763

CobraDunn opened this issue Jun 17, 2021 · 53 comments

Comments

@CobraDunn
Copy link

Describe the bug
Versions later than 2.14.0 unstable in my environment - downgraded from 2.18.4 one version at a time until I found stability
I have encountered nearly every open issue on this forum. Nodes going unavailable after reintroducing BLE mobile app, Nodes randomly stop responding, HA add-on won't stay up for more than 24 hours without some type of failure, constant BLE service restarting, clusters won't maintain a leader, and random entities unavailable.

To reproduce
11 PIW0's and HA add-on on Pi4B with config shown
Relevant logs

Multiple service errors as documented in other posts. Will happily assist in troubleshooting with some direction.

Relevant configuration

*** HA add-on - local.yml
global:
instanceName: bar
integrations:
- bluetoothLowEnergy
- homeAssistant
cluster:
networkInterface: eth0
port: 6425
autoDiscovery: true
weight: 50
quorum: 7
peerAddresses:
- 192.168.7.211:6425 #Living Room
- 192.168.7.92:6425 #Cave
- 192.168.7.240:6425 #Garage
- 192.168.7.118:6425 #Bar
- 192.168.7.219:6425 #Kitchen
- 192.168.7.113:6425 #Foyer
- 192.168.7.242:6425 #Master Bedroom
- 192.168.7.247:6425 #Caden Room
- 192.168.7.213:6425 #Josh Room
- 192.168.7.212:6425 #Dining Room
- 192.168.7.218:6425 #Family Room
- 192.168.7.56:6425 #Spare Bedroom
bluetoothLowEnergy:
allowlist:
- XXXXXXXX-A8CB-4EBA-B223-2D3383395BA7 #Josh iPhone
- XXXXXXXX-D629-46F8-BE28-EAFE057ADA17 # Mindy iPhone
- XXXXXXXX-6E58-4007-A04C-74724C879BD4 # Eric iPhone
- XXXXXXXX-DC06-47EC-B351-94407CDD99A7 # Caden iPhone
- XXXXXXXX-D233-4AD9-8344-45560EBADD38 # Kena iPhone
tagOverrides:
XXXXXXXX-A8CB-4EBA-B223-2D3383395BA7:
name: Josh's BLE iPhone
XXXXXXXX-D629-46F8-BE28-EAFE057ADA17:
name: Mindy's BLE iPhone
XXXXXXXX-6E58-4007-A04C-74724C879BD4:
name: Eric's BLE iPhone
XXXXXXXX-DC06-47EC-B351-94407CDD99A7:
name: Caden's BLE iPhone
XXXXXXXX-D233-4AD9-8344-45560EBADD38:
name: Kena's BLE iPhone
timeout: 60
maxDistance: 2
updateFrequency: 1.5
instanceBeaconEnabled: true

*** Ansible hosts.yml **

all:
hosts:
#Caden's Room
'192.168.7.247':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 1.3
cluster:
weight: 1
#Master Bedroom
'192.168.7.242':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
global:
integrations:
- homeAssistant
- bluetoothLowEnergy
- gridEye
gridEye:
deltaThreshold: 2
heatmap:
enabled: false
minTemperature: 16
maxTemperature: 30
rotation: 180
bluetoothLowEnergy:
maxDistance: 2.3
cluster:
weight: 2
#Cave
'192.168.7.92':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 2
cluster:
weight: 3
#Dining Room
'192.168.7.212':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 2
cluster:
weight: 4
#Family Room
'192.168.7.218':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 1.2
cluster:
weight: 5
#Foyer
'192.168.7.113':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 1.5
cluster:
weight: 6
#Garage
'192.168.7.240':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 2.2
cluster:
weight: 7
#Josh's Room
'192.168.7.213':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 1.6
cluster:
weight: 8
#Kitchen
'192.168.7.219':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 1.8
cluster:
weight: 9
#Living Room
'192.168.7.211':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
global:
instanceName: livingroom
bluetoothLowEnergy:
maxDistance: 1.4
cluster:
weight: 10
#Spare Bedroom
'192.168.7.56':
ansible_user: blabla
ansible_password: blablapassword
room_assistant_config:
bluetoothLowEnergy:
maxDistance: 2.5
cluster:
weight: 11
vars:
room_assistant_version: latest
room_assistant_global_config:
global:
integrations:
- homeAssistant
- bluetoothLowEnergy
homeAssistant:
mqttUrl: 'mqtt://homeassistant.local:1883'
mqttOptions:
username: blabla
password: blablapassword
cluster:
networkInterface: wlan0
port: 6425
autoDiscovery: true
timeout: 60
quorum: 7
peerAddresses:
- 192.168.7.211:6425 #Living Room
- 192.168.7.118:6425 #Bar
- 192.168.7.92:6425 #Cave
- 192.168.7.240:6425 #Garage
- 192.168.7.219:6425 #Kitchen
- 192.168.7.113:6425 #Foyer
- 192.168.7.247:6425 #Caden Room
- 192.168.7.213:6425 #Josh Room
- 192.168.7.242:6425 #Master Bedroom
- 192.168.7.212:6425 #Dining Room
- 192.168.7.218:6425 #Family Room
- 192.168.7.56:6425 #Spare Bedroom
bluetoothLowEnergy:
allowlist:
- XXXXXXXX-6E58-4007-A04C-74724C879BD4 #Eric's iPhone
- XXXXXXXX-D629-46F8-BE28-EAFE057ADA17 #Mindy's iPhone
- XXXXXXXX-A8CB-4EBA-B223-2D3383395BA7 #Josh's iPhone
- XXXXXXXX-DC06-47EC-B351-94407CDD99A7 #Caden's iPhone
- XXXXXXXX-D233-4AD9-8344-45560EBADD38 #Kena iPhone
tagOverrides:
XXXXXXXX-A8CB-4EBA-B223-2D3383395BA7:
name: Josh's BLE iPhone
XXXXXXXX-D629-46F8-BE28-EAFE057ADA17:
name: Mindy's BLE iPhone
XXXXXXXX-6E58-4007-A04C-74724C879BD4:
name: Eric's BLE iPhone
XXXXXXXX-DC06-47EC-B351-94407CDD99A7:
name: Caden's BLE iPhone
XXXXXXXX-D233-4AD9-8344-45560EBADD38:
name: Kena's BLE iPhone
updateFrequency: 2
timeout: 60
instanceBeaconEnabled: true

Expected behavior
Service reliability - Need to isolate what instability was introduced.

Environment

  • room-assistant version: >2.14.0
  • installation type: NodeJS, Hass.io
  • hardware: [e.g. (11 Raspberry Pi Zero, HA add-on Pi4B]
  • OS: (Pi Zero's, - Raspberry Pi OS Lite w/updates) (Pi4B - Hassio - core-2021.6.5, supervisor-2021.06.3, Home Assistant OS 6.0)

Additional context

@CobraDunn CobraDunn added the bug label Jun 17, 2021
@Scott8586
Copy link

Scott8586 commented Jun 17, 2021

Update to this comment: after removing features not available in 2.14 in the config files, and reversing changes in the .service file, room-assistant seems to be working again. Old version of .services file for reference:

Unit]
Description=room-assistant service

[Service]
ExecStart=/opt/nodejs/bin/room-assistant
WorkingDirectory=/home/pi/room-assistant
Restart=always
RestartSec=10
User=pi

[Install]
WantedBy=multi-user.target

original content:
In the same context 2.14.0 on a Pi Zero, I cannot get room-assistant to start even with doubling the startup time. Do you have any magic?

Jun 17 10:53:37 raspi24 systemd[1]: Starting room-assistant service...
Jun 17 10:53:47 raspi24 room-assistant[18495]: *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
Jun 17 10:53:47 raspi24 room-assistant[18495]: *** WARNING *** Please fix your application to use the native API of Avahi!
Jun 17 10:53:47 raspi24 room-assistant[18495]: *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Jun 17 10:53:47 raspi24 room-assistant[18495]: *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
Jun 17 10:53:47 raspi24 room-assistant[18495]: *** WARNING *** Please fix your application to use the native API of Avahi!
Jun 17 10:53:47 raspi24 room-assistant[18495]: *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Jun 17 10:53:53 raspi24 room-assistant[18495]: 17/06/2021, 10:53:53 - info - IntegrationsModule: Loading integrations: home-assistant, bluetooth-low-energy, bluetooth-classic
Jun 17 10:53:58 raspi24 room-assistant[18495]: 17/06/2021, 10:53:58 - info - NestFactory: Starting Nest application...
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: AppModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: ConfigModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: NestEmitterModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: IntegrationsModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: HttpModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: DiscoveryModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: PrometheusModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: ClusterModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: TerminusModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: BluetoothModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: ScheduleModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: EntitiesModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: BluetoothLowEnergyModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: BluetoothClassicModule dependencies initialized
Jun 17 10:53:59 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: HomeAssistantModule dependencies initialized
Jun 17 10:54:00 raspi24 room-assistant[18495]: 17/06/2021, 10:53:59 - info - InstanceLoader: StatusModule dependencies initialized
Jun 17 10:54:02 raspi24 room-assistant[18495]: 17/06/2021, 10:54:02 - info - RoutesResolver: EntitiesController {/entities}:
Jun 17 10:54:02 raspi24 room-assistant[18495]: 17/06/2021, 10:54:02 - info - RouterExplorer: Mapped {/entities, GET} route
Jun 17 10:54:02 raspi24 room-assistant[18495]: 17/06/2021, 10:54:02 - info - RoutesResolver: StatusController {/status}:
Jun 17 10:54:02 raspi24 room-assistant[18495]: 17/06/2021, 10:54:02 - info - RouterExplorer: Mapped {/status, GET} route
Jun 17 10:54:02 raspi24 room-assistant[18495]: 17/06/2021, 10:54:02 - info - RoutesResolver: PrometheusController {/metrics}:
Jun 17 10:54:03 raspi24 room-assistant[18495]: 17/06/2021, 10:54:03 - info - RouterExplorer: Mapped {/metrics, GET} route
Jun 17 10:54:05 raspi24 room-assistant[18495]: 17/06/2021, 10:54:05 - info - HomeAssistantService: Successfully connected to MQTT broker at mqtt://192.168.35.161:1883
Jun 17 10:54:05 raspi24 room-assistant[18495]: 17/06/2021, 10:54:05 - info - ConfigService: Loading configuration from /opt/nodejs/lib/node_modules/room-assistant/dist/config/definitions/default.js, config/local.yaml
Jun 17 10:54:06 raspi24 room-assistant[18495]: 17/06/2021, 10:54:06 - info - ClusterService: Starting mDNS advertisements and discovery
Jun 17 10:54:06 raspi24 room-assistant[18495]: 17/06/2021, 10:54:06 - info - NestApplication: Nest application successfully started
Jun 17 10:55:37 raspi24 systemd[1]: room-assistant.service: Start operation timed out. Terminating.
Jun 17 10:55:37 raspi24 systemd[1]: room-assistant.service: Main process exited, code=killed, status=15/TERM
Jun 17 10:55:37 raspi24 systemd[1]: room-assistant.service: Failed with result 'timeout'.
Jun 17 10:55:37 raspi24 systemd[1]: Failed to start room-assistant service.
Jun 17 10:55:47 raspi24 systemd[1]: room-assistant.service: Service RestartSec=10s expired, scheduling restart.
Jun 17 10:55:48 raspi24 systemd[1]: room-assistant.service: Scheduled restart job, restart counter is at 2.

My service file looks like this:

[Unit]
Description=room-assistant service

[Service]
Type=notify
ExecStart=/opt/nodejs/bin/room-assistant
WorkingDirectory=/home/srp/room-assistant
TimeoutStartSec=420
TimeoutStopSec=30
Restart=always
RestartSec=10
WatchdogSec=60
User=srp

[Install]
WantedBy=multi-user.target

@Alfiegerner
Copy link
Contributor

Alfiegerner commented Jun 18, 2021

Thanks for this issue - I've been getting lots of Unavailables and flaky behaviour and was trying to troubleshoot but not getting anywhere. I also have quit a large collection of RA instances, (not quite as a many, only 10 :D ) so I wonder if that comes into play.

Downgrading to 2.14 and I'm stable again now.

Cheers!

@mKeRix
Copy link
Owner

mKeRix commented Jun 20, 2021

2.15.0 introduced the instance beacons for the iOS app auto-toggle feature. It's possible that the library used for this has some faults (or the Raspberry chips just can't deal with it anymore). It'd be awesome if someone of you could test if you see the same instability issues on newer versions of room-assistant when you add the following to your config:

bluetoothLowEnergy:
  instanceBeaconEnabled: false

If you observe that this makes it better I'll think about where to go from here - maybe I'll remove that functionality then (or at least disable it by default), but I'll have to figure out how to change the app functionality in that case.

@Scott8586 The watchdog functionality for the systemd service was only added quite recently, for the older versions you should remove the Type=notify line from your systemd unit file.

@Scott8586
Copy link

Thanks for the clues @mKeRix. Yes, I figured out the watchdog stuff along the way yesterday, trying the

bluetoothLowEnergy:
  instanceBeaconEnabled: false

configuration change on a pi 3B+ and a pi zero at 2.18.4 now.

@CobraDunn
Copy link
Author

I had seen the instanceBeaconEnabled: option in another message and disabled it. (I was seeing pairing requests as well) Unfortunately, it did not make a difference for me. If I recall, it did not solve that user's issue either. I have spent countless hours trying different config options without success. It feels like the largest recurring issue was getting all 12 instances to form a single cluster and play nice for any length of time. Within 24 hrs it would fragment into two or three clusters with a least one instance failing. 2.14.0 has been stable for over a week now. Also, I currently have the HA add-on disabled as I don't know how to roll the version back. Some guidance on how to do that would be great.

Of course, I'm willing to spin everything back up to 2.18.4. If there is some specific troubleshooting or log information I can offer.

It's important to say how much all of the development time put into this is appreciated. I loved the new features, especially the instance browser. Let me know how I can assist.

@CobraDunn
Copy link
Author

Reloaded 2.18.4 using the config from my original post. I deleted all the MQTT devices in HA to make sure they populated with the correct topic details for the current version. The only config change is instanceBeaconEnabled: false. The Foyer instance ran a couple of minutes before problems started at 22/06/2021, 01:34:11 in the attached.

It does appear that using the instance browser aggravates things. As soon as the errors began, instances and devices went unavailable, and all devices reestablished the leader with all the associated odd behavior. Foyer instance didn't report any BLE distance updates after.

Initially, I started with HA add-on enabled but it could not establish a leader among the 12 instances, even after multiple restarts of the add-on. There were always a couple of instances that would not join. As soon as I stopped the add-on all instances clustered up.

There might be a separate issue here but let's tackle one variable at a time.

foyer_log.txt

@Scott8586
Copy link

Scott8586 commented Jun 22, 2021

Part 1:
@CobraDunn has a much more sophisticated network, but perhaps I can provide a point of stability. I've gone back up to 2.18.4, and taken the one instance that needs to run BLE, reduced the configuration to what I consider minimal, and forced it not to cluster with the rest of the room-assistant instances. Configuration is below. it's been stable and sending distances for ~ 24hrs now. Operationally, It doesn't really need to join the main cluster, but I will allow that next and see if the behavior changes.

global:
  instanceName: garage-hv
  integrations:
    - homeAssistant
    - bluetoothLowEnergy
cluster:
  autoDiscovery: false
  port: 9999
homeAssistant:
  mqttUrl: 'mqtt://192.168.35.161:1883'
  mqttOptions:
    username: xxx
    password: yyy
bluetoothLowEnergy:
  hciDeviceId: 0
  instanceBeaconEnabled: false
  onlyIBeacon: true
  updateFrequency: 10
  allowlist:
    - '426c7565436861726d426561636f6e70-3838-4949'
    - '426c7565436861726d426561636f6e72-3838-4949'
    - '426c7565436861726d426561636f6e74-3838-4949'

@Scott8586
Copy link

Scott8586 commented Jun 22, 2021

Part 2:
As soon as I allowed the BLE instance to join the main cluster, it started misbehaving in the way I had described in (#754), debugging shows no measurements/distances. In case hci0 was left in an odd state after stopping room-assistant for the configurational change, I also rebooted the machine, and watched room-assistant after the reboot but observed the same behavior.

If I go back to isolating the BLE instance. It works again immediately, I will watch it for 24hrs and update if there is a change.

The other members of the cluster are a group of three running bluetoothClassic, and a mixture of the gpio, and Xiaomi integrations, all instances run the homeAssistant integration. two are pi zeros, one is a pi 3B, Im using the integrated bluetooth on all machines. The cluster of three seems to continue to operate correctly on 2.18.4. The BLE instance is a pi zero running 2.18.4.

Log file for non-working, clustered version of BLE instance:

Jun 22 07:09:46 raspi23 room-assistant[233]: 22/06/2021, 07:09:45 - info - IntegrationsModule: Loading integrations: home-assistant, bluetooth-low-energy
Jun 22 07:09:52 raspi23 room-assistant[233]: 22/06/2021, 07:09:52 - info - NestFactory: Starting Nest application...
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: AppModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: ConfigModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: NestEmitterModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: IntegrationsModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: HttpModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: DiscoveryModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: PrometheusModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: EventsModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: ClusterModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: TerminusModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: ScheduleModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: BluetoothModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: EntitiesModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: BluetoothLowEnergyModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: HomeAssistantModule dependencies initialized
Jun 22 07:09:54 raspi23 room-assistant[233]: 22/06/2021, 07:09:54 - info - InstanceLoader: StatusModule dependencies initialized
Jun 22 07:09:57 raspi23 room-assistant[233]: 22/06/2021, 07:09:57 - info - RoutesResolver: EntitiesController {/entities}:
Jun 22 07:09:57 raspi23 room-assistant[233]: 22/06/2021, 07:09:57 - info - RouterExplorer: Mapped {/entities, GET} route
Jun 22 07:09:57 raspi23 room-assistant[233]: 22/06/2021, 07:09:57 - info - RoutesResolver: StatusController {/status}:
Jun 22 07:09:57 raspi23 room-assistant[233]: 22/06/2021, 07:09:57 - info - RouterExplorer: Mapped {/status, GET} route
Jun 22 07:09:57 raspi23 room-assistant[233]: 22/06/2021, 07:09:57 - info - RoutesResolver: PrometheusController {/metrics}:
Jun 22 07:09:57 raspi23 room-assistant[233]: 22/06/2021, 07:09:57 - info - RouterExplorer: Mapped {/metrics, GET} route
Jun 22 07:10:00 raspi23 room-assistant[233]: 22/06/2021, 07:10:00 - debug - HomeAssistantService: Marking instance as online
Jun 22 07:10:00 raspi23 room-assistant[233]: 22/06/2021, 07:10:00 - info - HomeAssistantService: Successfully connected to MQTT broker at mqtt://192.168.35.161:1883
Jun 22 07:10:00 raspi23 room-assistant[233]: 22/06/2021, 07:10:00 - info - ConfigService: Loading configuration from /opt/nodejs/lib/node_modules/room-assistant/dist/config/definitions/default.js, config/local.yaml (Current: /home/srp/room-assistant)
Jun 22 07:10:01 raspi23 room-assistant[233]: 22/06/2021, 07:10:01 - debug - EntitiesService: Adding new entity status-cluster-size
Jun 22 07:10:01 raspi23 room-assistant[233]: 22/06/2021, 07:10:01 - debug - HomeAssistantService: Registering entity room-assistant-garage-hv-status-cluster-size under homeassistant/sensor/room-assistant/garage-hv-status-cluster-size/config
Jun 22 07:10:01 raspi23 room-assistant[233]: 22/06/2021, 07:10:01 - debug - HomeAssistantService: Marking room-assistant-garage-hv-status-cluster-size as online
Jun 22 07:10:01 raspi23 room-assistant[233]: 22/06/2021, 07:10:01 - debug - EntitiesService: Adding new entity status-cluster-leader
Jun 22 07:10:01 raspi23 room-assistant[233]: 22/06/2021, 07:10:01 - debug - HomeAssistantService: Registering entity room-assistant-garage-hv-status-cluster-leader under homeassistant/sensor/room-assistant/garage-hv-status-cluster-leader/config
Jun 22 07:10:01 raspi23 room-assistant[233]: 22/06/2021, 07:10:01 - debug - HomeAssistantService: Marking room-assistant-garage-hv-status-cluster-leader as online
Jun 22 07:10:02 raspi23 room-assistant[233]: 22/06/2021, 07:10:02 - info - ClusterService: Starting mDNS advertisements and discovery
Jun 22 07:10:02 raspi23 room-assistant[233]: 22/06/2021, 07:10:02 - info - NestApplication: Nest application successfully started
Jun 22 07:10:02 raspi23 systemd[1]: Started /etc/rc.local Compatibility.
Jun 22 07:10:02 raspi23 room-assistant[233]: 22/06/2021, 07:10:02 - debug - HomeAssistantService: Sending new state 4 for room-assistant-garage-hv-status-cluster-size
Jun 22 07:10:02 raspi23 systemd[1]: Starting Terminate Plymouth Boot Screen...
Jun 22 07:10:03 raspi23 room-assistant[233]: 22/06/2021, 07:10:03 - debug - HomeAssistantService: Sending new state livingroom-hv for room-assistant-garage-hv-status-cluster-leader
Jun 22 07:10:03 raspi23 room-assistant[233]: 22/06/2021, 07:10:03 - debug - HomeAssistantService: Sending new attributes {"nodes":["retreat-hv","livingroom-hv","gameroom-hv","garage-hv"]} for room-assistant-garage-hv-status-cluster-size
Jun 22 07:10:03 raspi23 room-assistant[233]: 22/06/2021, 07:10:03 - debug - HomeAssistantService: Sending new attributes {"quorumReached":true} for room-assistant-garage-hv-status-cluster-leader
Jun 22 07:10:04 raspi23 room-assistant[233]: 22/06/2021, 07:10:04 - debug - BluetoothService: Adapter 0 went into state poweredOn
Jun 22 07:10:04 raspi23 room-assistant[233]: 22/06/2021, 07:10:04 - debug - BluetoothService: Starting scanning for BLE peripherals on adapter 0
Jun 22 07:10:04 raspi23 room-assistant[233]: 22/06/2021, 07:10:04 - debug - BluetoothService: Adapter 0 went into state poweredOn
Jun 22 07:10:04 raspi23 room-assistant[233]: 22/06/2021, 07:10:04 - debug - BluetoothService: Started scanning for BLE peripherals on adapter 0
Jun 22 07:10:05 raspi23 room-assistant[233]: 22/06/2021, 07:10:05 - info - BluetoothLowEnergyService: Discovered new BLE peripheral RAV4
Jun 22 07:10:05 raspi23 room-assistant[233]:  with ID 426c7565436861726d426561636f6e74-3838-4949 and RSSI -58
Jun 22 07:10:30 raspi23 room-assistant[233]: 22/06/2021, 07:10:30 - debug - HomeAssistantService: Marking instance as online
Jun 22 07:10:30 raspi23 room-assistant[233]: 22/06/2021, 07:10:30 - debug - HomeAssistantService: Marking room-assistant-garage-hv-status-cluster-size as online
Jun 22 07:10:30 raspi23 room-assistant[233]: 22/06/2021, 07:10:30 - debug - HomeAssistantService: Marking room-assistant-garage-hv-status-cluster-leader as online
Jun 22 07:10:30 raspi23 room-assistant[233]: 22/06/2021, 07:10:30 - debug - HomeAssistantService: Marking room-assistant-ble-426c7565436861726d426561636f6e74-3838-4949-tracker as online
Jun 22 07:10:30 raspi23 room-assistant[233]: 22/06/2021, 07:10:30 - debug - HomeAssistantService: Marking room-assistant-ble-426c7565436861726d426561636f6e74-3838-4949 as online
Jun 22 07:11:00 raspi23 room-assistant[233]: 22/06/2021, 07:11:00 - debug - HomeAssistantService: Marking instance as online
Jun 22 07:11:00 raspi23 room-assistant[233]: 22/06/2021, 07:11:00 - debug - HomeAssistantService: Marking room-assistant-garage-hv-status-cluster-size as online
Jun 22 07:11:00 raspi23 room-assistant[233]: 22/06/2021, 07:11:00 - debug - HomeAssistantService: Marking room-assistant-garage-hv-status-cluster-leader as online
Jun 22 07:11:00 raspi23 room-assistant[233]: 22/06/2021, 07:11:00 - debug - HomeAssistantService: Marking room-assistant-ble-426c7565436861726d426561636f6e74-3838-4949-tracker as online
Jun 22 07:11:00 raspi23 room-assistant[233]: 22/06/2021, 07:11:00 - debug - HomeAssistantService: Marking room-assistant-ble-426c7565436861726d426561636f6e74-3838-4949 as online

@Scott8586
Copy link

Scott8586 commented Jun 22, 2021

Part 3:
I noticed that the cluster of three did not remove the BLE instance/garage-hv node from the cluster after the experiment in Part 2, and about 30 minutes after the experiment above of adding the BLE instance to the cluster, and then removing it, one of the the ClassicBluetooth instances started acting the fool, not finding distances (retreat-hv, not the cluster leader). A restart of room-assistant fixed this node. I'm not sure if this was causal or a coincidence, but the timing was suspicious.
The cluster of three ClassicBluetooth instances had been stable for 24hrs before that.

@CobraDunn
Copy link
Author

@Scott8586 Your help is super appreciated, but I'm just not sure where to go from here. I'm hoping @mKeRix can weigh in with some things we might have overlooked.

I keep coming back to clusters. If they can't form reliably, nothing good will follow. For me, cluster problems appear immediately on the newer versions, yet clusters lock in solidly on 2.14.0. It seems like a logical point to start hunting.

@Scott8586
Copy link

@CobraDunn - yes clustering is clearly part of the problem. I was hoping to get this down to a small test case. It seems that ClassicBluetooth only based clusters are/can be stable (I'm back to 24hrs of stability), but even joining a single BLE based node to the cluster causes failures of both the BLE node and the Classic nodes. The process seems stochastic - the failures are not always immediate - this might suggest a race condition, or deadlock, or some other kind of timing issue.

I get your point about going back to 2.14.0, this is an extremely important clue - we have to know when to look, but also what to look for.

@mKeRix
Copy link
Owner

mKeRix commented Jun 23, 2021

Hey all, sorry for the sparse responses from my side, my last weeks have all been very busy and I haven't found much time for this project unfortunately.

@CobraDunn

Also, I currently have the HA add-on disabled as I don't know how to roll the version back. Some guidance on how to do that would be great.

Only way to rollback atm is to restore the add-on from an old snapshot, see home-assistant/supervisor#1843 for more info. Alternatively, you could try pulling the add-on config from that version off the git repository and set that up as a local repository.

The Foyer instance ran a couple of minutes before problems started at 22/06/2021, 01:34:11 in the attached.

Hm, there is nothing specific that jumps out at me from a first review of the logs, but something is definitely off. :/ If you'd be down I'd try to provide you a custom room-assistant package here in the coming days, with some stuff that was added between 2.14.0 and the current version taken out. Hopefully that could bring us closer to the problem. I'll also take another look at your log file (thanks for providing it!) with a fresh set of eyes then.

@Scott8586

As soon as I allowed the BLE instance to join the main cluster, it started misbehaving

Am I understanding it correctly that you have 3 instances running BT Classic alongside some other stuff and then only that one Pi Zero with BLE? room-assistant actually has a limitation currently, where distributed integrations that need a leader (both the Bluetooth ones) need to all be enabled on the leader instance so that things can work. This would essentially mean that you'd have to turn BLE on in at least one of the BT Classic instances, which should then be configured to be a preferred leader. Alternatively you can do what you already tried and just run the BLE only instance outside your main cluster.

one of the the ClassicBluetooth instances started acting the fool, not finding distances

Did this instance report any errors for Bluetooth Classic at that time or was it just a case of the Bluetooth adapter not connecting (as if the device was simply not nearby)?

@CobraDunn
Copy link
Author

@mKeRix

Only way to rollback atm is to restore the add-on from an old snapshot, see home-assistant/supervisor#1843 for more info. Alternatively, you could try pulling the add-on config from that version off the git repository and set that up as a local repository.

Thanks for your response. Understood. The HA instance is the least important... although it is at the bar :)... plus, there's one less variable to deal with. Hopefully I end up running the latest version across all devices :)

Hm, there is nothing specific that jumps out at me from a first review of the logs, but something is definitely off. :/ If you'd be down I'd try to provide you a custom room-assistant package here in the coming days, with some stuff that was added between 2.14.0 and the current version taken out. Hopefully that could bring us closer to the problem. I'll also take another look at your log file (thanks for providing it!) with a fresh set of eyes then.

Absolutely! Just let me know when you have something. Thanks again.

@mKeRix
Copy link
Owner

mKeRix commented Jun 26, 2021

@CobraDunn I've compiled a package that contains room-assistant 2.18.4, but without any of the instance beacon code. Could you give this a shot on your setup and observe the behavior? See the iCloud link below to download the package.

https://www.icloud.com/iclouddrive/0jEylhPkpGvGAZ_RB5tQgKN4w#room-assistant-2.18

You can install it by uploading it to your Pis and running sudo npm i --global --unsafe-perm room-assistant-2.18.4.tgz - unfortunately there is no easy way to do this from Ansible yet, but you can always use Ansible to revert back to an official release version.

@CobraDunn
Copy link
Author

@mKeRix - Awesome! I'm on it.

@CobraDunn
Copy link
Author

@mKeRix - This looks really promising. Hopefully, it helps isolate the issue. All (11) instances clustered up immediately and all logs look clean. Let me know if there are any debug details you want to see. I'll monitor over the next 24 hours and keep you posted.

What features are impacted by the removed code?

Thanks for the responsiveness!

@mKeRix
Copy link
Owner

mKeRix commented Jun 26, 2021

Only the auto-toggling feature in the iOS companion app, if you don't have that turned on it shouldn't make a difference. That's something that could be replaced by some other mechanic as well, I'd just have to think about the best way to do it.

I'm not really looking for any specific details atm, just general feedback - so I appreciate you keeping me posted! :)

@CobraDunn
Copy link
Author

@mKeRix - 24 Hour Update - All instances were completely stable and the cluster leader remained solid the entire period. I think you've nailed it. I'll keep monitoring and advise of any changes.

@nagydavid
Copy link

@mKeRix I tested out as well, with the custom 2.18.4 performs with no errors for the last 2 day.

@CobraDunn
Copy link
Author

@mKeRix - Update - It's been rock solid since initial install. Tracking is working well, as is the Instance Browser. I was hoping a couple more people would jump in to comment on the behavior of the test version.

Being curious as I am, I have to ask the question. While the instanceBeaconEnabled: switch did take care of the BT pairing concern, it didn't seem to do anything for the overall instabilities. Did you find any clues to this behavior in the removed code?

@CobraDunn
Copy link
Author

@mKeRix I tested out as well, with the custom 2.18.4 performs with no errors for the last 2 day.

@nagydavid - I appreciate you validating the test version. I've been struggling with this for months! Thank you!

@tuday2
Copy link

tuday2 commented Jun 29, 2021

i'm having the same issues -- looking forward to getting the fix!

@CobraDunn
Copy link
Author

@CobraDunn I've compiled a package that contains room-assistant 2.18.4, but without any of the instance beacon code. Could you give this a shot on your setup and observe the behavior? See the iCloud link below to download the package.

https://www.icloud.com/iclouddrive/0jEylhPkpGvGAZ_RB5tQgKN4w#room-assistant-2.18

You can install it by uploading it to your Pis and running sudo npm i --global --unsafe-perm room-assistant-2.18.4.tgz - unfortunately there is no easy way to do this from Ansible yet, but you can always use Ansible to revert back to an official release version.

@tuday2 - If you have the time to try it, I'm sure your feedback on the on test version above would be appreciated by all

@BelgarionNL
Copy link

BelgarionNL commented Jul 1, 2021

please also create a docker version of this test version so I can roll it out too and report back.

edit: wow reverted back to 1.14 with docker and damn no more errors or warnings! this is great! instant improvement.

@mKeRix
Copy link
Owner

mKeRix commented Jul 1, 2021

As an outlook: I will publish the changes from above as an official version this weekend. Since it's a breaking change it will trigger the 3.0.0 release - I want to throw a few more breaking changes in this version bump, which is why I'll make this a beta release. The other changes will follow in future beta releases, but this way the Docker images and Home Assistant add-on can also be used again already.

@tuday2
Copy link

tuday2 commented Jul 2, 2021

Update : that package fixed 2 out of 3 of my Pi's ... I am going to try a reinstall on the one that isn't working

mKeRix added a commit that referenced this issue Jul 4, 2021
The instance beacons broadcasted via bleno seem to cause trouble
for
many users, so they were removed from the software again.

BREAKING CHANGE: instance beacons along with their configuration
options
and the companion app auto toggling feature are not available
anymore

Closes #763
@mKeRix
Copy link
Owner

mKeRix commented Jul 4, 2021

There is now a beta release with this fix available on npm (Docker image and Home Assistant add-on are building atm, will be available in ~30min). The version is 3.0.0-beta.2, since something mysteriously went wrong during the upload of 3.0.0-beta.1.

As noted above, I'll leave this beta track open for a while as I plan to fit some more breaking changes into that release.

@mKeRix mKeRix added the no_stale label Jul 4, 2021
@CobraDunn
Copy link
Author

CobraDunn commented Jul 4, 2021

@mKeRix - All Pi Zeros are running well, like the test version. However, this is something up with HA add-on version. It will not register a Cluster Leader or take the Leader role as specified in the config below. The Elected Leader messages normally seen in other logs also do not appear. It appears it's not realizing a quorum exits. HA Entity pics and log are below.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:16:26] INFO: Setting up Home Assistant configuration
[19:16:26] INFO: Copying room-assistant configuration from /config/room_assistant
[19:16:26] INFO: Starting room-assistant
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
7/4/2021, 7:16:30 PM - info - IntegrationsModule: Loading integrations: bluetooth-low-energy, home-assistant
7/4/2021, 7:16:31 PM - info - NestFactory: Starting Nest application...
7/4/2021, 7:16:31 PM - info - InstanceLoader: AppModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: ConfigModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: NestEmitterModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: IntegrationsModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: HttpModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: DiscoveryModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: PrometheusModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: EventsModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: ClusterModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: TerminusModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: ScheduleModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: BluetoothModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: EntitiesModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: BluetoothLowEnergyModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: HomeAssistantModule dependencies initialized
7/4/2021, 7:16:31 PM - info - InstanceLoader: StatusModule dependencies initialized
7/4/2021, 7:16:32 PM - info - RoutesResolver: EntitiesController {/entities}:
7/4/2021, 7:16:32 PM - info - RouterExplorer: Mapped {/entities, GET} route
7/4/2021, 7:16:32 PM - info - RoutesResolver: StatusController {/status}:
7/4/2021, 7:16:32 PM - info - RouterExplorer: Mapped {/status, GET} route
7/4/2021, 7:16:32 PM - info - RoutesResolver: PrometheusController {/metrics}:
7/4/2021, 7:16:32 PM - info - RouterExplorer: Mapped {/metrics, GET} route
7/4/2021, 7:16:32 PM - info - HomeAssistantService: Successfully connected to MQTT broker at mqtt://core-mosquitto:1883
7/4/2021, 7:16:32 PM - info - ConfigService: Loading configuration from /usr/lib/node_modules/room-assistant/dist/config/definitions/default.js, config/default.json, config/local.yml (Current: /room-assistant)
7/4/2021, 7:16:32 PM - error - ClusterService: Failed to start mdns discovery (dns service error: unknown)
7/4/2021, 7:16:32 PM - info - NestApplication: Nest application successfully started
7/4/2021, 7:16:32 PM - info - ClusterService: Added 192.168.7.211:6425 to the cluster with id livingroom
7/4/2021, 7:16:32 PM - info - ClusterService: Added 192.168.7.56:6425 to the cluster with id spare-bedroom
7/4/2021, 7:16:32 PM - info - ClusterService: Added 192.168.7.218:6425 to the cluster with id family-room
7/4/2021, 7:16:32 PM - info - ClusterService: Added 192.168.7.213:6425 to the cluster with id joshs-room
7/4/2021, 7:16:32 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral ihoment_H6199_CA63 with ID a4c138f3ca63 and RSSI -69
7/4/2021, 7:16:32 PM - info - ClusterService: Added 192.168.7.219:6425 to the cluster with id kitchen
7/4/2021, 7:16:32 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 6d105ee35ed9 with ID 6d105ee35ed9 and RSSI -62
7/4/2021, 7:16:32 PM - info - ClusterService: Added 192.168.7.242:6425 to the cluster with id master-bedroom
7/4/2021, 7:16:32 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 63cdd3a9f9b9 with ID 63cdd3a9f9b9 and RSSI -79
7/4/2021, 7:16:32 PM - info - ClusterService: Added 192.168.7.240:6425 to the cluster with id garage
7/4/2021, 7:16:32 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 18cf72212581 with ID 18cf72212581 and RSSI -63
7/4/2021, 7:16:33 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 766e3ee1fe49 with ID 766e3ee1fe49 and RSSI -81
7/4/2021, 7:16:33 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 75a313604ac6 with ID 75a313604ac6 and RSSI -85
7/4/2021, 7:16:33 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 4a6df61e2bd9
7/4/2021, 7:16:33 PM - info - ClusterService: Added 192.168.7.212:6425 to the cluster with id dining-room
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered companion app with ID B6747560-6E58-4007-A04C-74724C879BD4 for tag 4a6df61e2bd9
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral B6747560-6E58-4007-A04C-74724C879BD4 with ID B6747560-6E58-4007-A04C-74724C879BD4 and RSSI -41
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 431c48fa5908 with ID 431c48fa5908 and RSSI -72
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 56a3eecbe9b0 with ID 56a3eecbe9b0 and RSSI -67
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 4442cf89d068 with ID 4442cf89d068 and RSSI -78
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 528663c50299 with ID 528663c50299 and RSSI -80
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 74278bdab64445208f0c720eaf059935-256-63337 with ID 74278bdab64445208f0c720eaf059935-256-63337 and RSSI -83
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral c852ae714a85 with ID c852ae714a85 and RSSI -76
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 4cab4f9285ac with ID 4cab4f9285ac and RSSI -63
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral f4ecd035710e with ID f4ecd035710e and RSSI -66
7/4/2021, 7:16:34 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 766e3ee1fe49
7/4/2021, 7:16:40 PM - error - BluetoothService: Failed to connect to 76:6e:3e:e1:fe:49: Maximum retries reached while connecting to 76:6e:3e:e1:fe:49
7/4/2021, 7:16:40 PM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Maximum retries reached while connecting to 76:6e:3e:e1:fe:49
7/4/2021, 7:16:40 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 78ccb34cadc5
7/4/2021, 7:16:50 PM - error - BluetoothService: Failed to connect to 78:cc:b3:4c:ad:c5: timed out
7/4/2021, 7:16:50 PM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/4/2021, 7:16:50 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 78ccb34cadc5 with ID 78ccb34cadc5 and RSSI -89
7/4/2021, 7:16:50 PM - info - ClusterService: Added 192.168.7.247:6425 to the cluster with id cadens-room
7/4/2021, 7:16:50 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 6caa2121db72 with ID 6caa2121db72 and RSSI -74
7/4/2021, 7:16:57 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 766e3ee1fe49
7/4/2021, 7:17:03 PM - error - BluetoothService: Failed to connect to 76:6e:3e:e1:fe:49: Maximum retries reached while connecting to 76:6e:3e:e1:fe:49
7/4/2021, 7:17:03 PM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Maximum retries reached while connecting to 76:6e:3e:e1:fe:49
7/4/2021, 7:17:06 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 78ccb34cadc5
7/4/2021, 7:17:16 PM - error - BluetoothService: Failed to connect to 78:cc:b3:4c:ad:c5: timed out
7/4/2021, 7:17:16 PM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/4/2021, 7:17:42 PM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/4/2021, 7:17:43 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 78ccb34cadc5
7/4/2021, 7:17:53 PM - error - BluetoothService: Failed to connect to 78:cc:b3:4c:ad:c5: timed out
7/4/2021, 7:17:53 PM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/4/2021, 7:18:22 PM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/4/2021, 7:18:22 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 6be48dcecd03 with ID 6be48dcecd03 and RSSI -84
7/4/2021, 7:18:22 PM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 1ac61eff6a9b with ID 1ac61eff6a9b and RSSI -95
7/4/2021, 7:18:23 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6be48dcecd03
7/4/2021, 7:18:27 PM - error - BluetoothService: Failed to connect to 6b:e4:8d:ce:cd:03: Maximum retries reached while connecting to 6b:e4:8d:ce:cd:03
7/4/2021, 7:18:27 PM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Maximum retries reached while connecting to 6b:e4:8d:ce:cd:03
7/4/2021, 7:18:29 PM - info - BluetoothLowEnergyService: Attempting app discovery for tag 78ccb34cadc5

image

image

Config:

global:
instanceName: bar
integrations:
- bluetoothLowEnergy
- homeAssistant
cluster:
networkInterface: eth0
port: 6425
autoDiscovery: true
weight: 50
quorum: 7
timeout: 60
peerAddresses:
- 192.168.7.211:6425 #Living Room
- 192.168.7.92:6425 #Cave
- 192.168.7.240:6425 #Garage
- 192.168.7.118:6425 #Bar
- 192.168.7.219:6425 #Kitchen
- 192.168.7.113:6425 #Foyer
- 192.168.7.242:6425 #Master Bedroom
- 192.168.7.247:6425 #Caden Room
- 192.168.7.213:6425 #Josh Room
- 192.168.7.212:6425 #Dining Room
- 192.168.7.218:6425 #Family Room
- 192.168.7.56:6425 #Spare Bedroom
bluetoothLowEnergy:
allowlist:
- 38E31215-A8CB-4EBA-B223-2D3383395BA7 #Josh iPhone
- 2CA7AF99-D629-46F8-BE28-EAFE057ADA17 # Mindy iPhone
- B6747560-6E58-4007-A04C-74724C879BD4 # Eric iPhone
- 57B89805-DC06-47EC-B351-94407CDD99A7 # Caden iPhone
- 2FCF04F2-D233-4AD9-8344-45560EBADD38 # Kena iPhone
tagOverrides:
38E31215-A8CB-4EBA-B223-2D3383395BA7:
name: Josh's BLE iPhone
2CA7AF99-D629-46F8-BE28-EAFE057ADA17:
name: Mindy's BLE iPhone
B6747560-6E58-4007-A04C-74724C879BD4:
name: Eric's BLE iPhone
57B89805-DC06-47EC-B351-94407CDD99A7:
name: Caden's BLE iPhone
2FCF04F2-D233-4AD9-8344-45560EBADD38:
name: Kena's BLE iPhone
timeout: 60
maxDistance: 2

@CobraDunn
Copy link
Author

CobraDunn commented Jul 5, 2021

@mKeRix - Update:

HA add-on eventually picked up the active Cluster Leader although it still would not assume the Leader role. Something doesn't seem quite right with the cluster negotiation in the add-on.

One item of note if it helps. This is a Pi4B and the only instance connected via ethernet - networkInterface: eth0 is in the cofig.

More critically, after a short period (<24hrs) the log begins repeating with the below, and no allowlist: BLE devices are reported. This is one of the failure modes I was encountering in V2.18.4.

HA add-on log:

7/5/2021, 10:27:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:27:27 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:27:37 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:27:37 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:28:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:28:07 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 5d9b24d94658
7/5/2021, 10:28:17 AM - error - BluetoothService: Failed to connect to 5d:9b:24:d9:46:58: timed out
7/5/2021, 10:28:17 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:28:47 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:28:47 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:28:57 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:28:57 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:29:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:29:27 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 7c3912cc9f9b with ID 7c3912cc9f9b and RSSI -72
7/5/2021, 10:29:27 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 4d32d37ffc90 with ID 4d32d37ffc90 and RSSI -83
7/5/2021, 10:29:28 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 7b1c350620d1 with ID 7b1c350620d1 and RSSI -64
7/5/2021, 10:29:28 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 5d9b24d94658
7/5/2021, 10:29:38 AM - error - BluetoothService: Failed to connect to 5d:9b:24:d9:46:58: timed out
7/5/2021, 10:29:38 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:30:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:30:08 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:30:18 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:30:18 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:30:47 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:30:47 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 48a91c9d7c5e with ID 48a91c9d7c5e and RSSI -67
7/5/2021, 10:30:47 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 5d9b24d94658
7/5/2021, 10:30:57 AM - error - BluetoothService: Failed to connect to 5d:9b:24:d9:46:58: timed out
7/5/2021, 10:30:57 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:31:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:31:27 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:31:37 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:31:37 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:32:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:32:07 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:32:17 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:32:17 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:32:47 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:32:47 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral [LG] webOS TV UM8070PUA with ID 7b770fb2a832 and RSSI -83
7/5/2021, 10:32:47 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:32:57 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:32:57 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:33:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:33:27 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 5d9b24d94658
7/5/2021, 10:33:37 AM - error - BluetoothService: Failed to connect to 5d:9b:24:d9:46:58: timed out
7/5/2021, 10:33:37 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:34:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:34:08 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:34:18 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:34:18 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:34:47 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:34:47 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral ccf34baedd65 with ID ccf34baedd65 and RSSI -65
7/5/2021, 10:34:47 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:34:57 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:34:57 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:35:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:35:27 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:35:37 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:35:37 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:36:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:36:07 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:36:17 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:36:17 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:36:47 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:36:48 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 5d9b24d94658
7/5/2021, 10:36:58 AM - error - BluetoothService: Failed to connect to 5d:9b:24:d9:46:58: timed out
7/5/2021, 10:36:58 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:37:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:37:27 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:37:37 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:37:37 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:38:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:38:07 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:38:17 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:38:17 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:38:47 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:38:47 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:38:57 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:38:57 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:39:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:39:27 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:39:37 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:39:37 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:40:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:40:07 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 75b0e0577c21 with ID 75b0e0577c21 and RSSI -71
7/5/2021, 10:40:08 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 6db36a8c47d5
7/5/2021, 10:40:18 AM - error - BluetoothService: Failed to connect to 6d:b3:6a:8c:47:d5: timed out
7/5/2021, 10:40:18 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:40:47 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:40:47 AM - info - BluetoothLowEnergyService: Discovered new BLE peripheral 759eb6f76fdb with ID 759eb6f76fdb and RSSI -81
7/5/2021, 10:40:47 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 759eb6f76fdb
7/5/2021, 10:40:57 AM - error - BluetoothService: Failed to connect to 75:9e:b6:f7:6f:db: timed out
7/5/2021, 10:40:57 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:41:27 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:41:27 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 759eb6f76fdb
7/5/2021, 10:41:37 AM - error - BluetoothService: Failed to connect to 75:9e:b6:f7:6f:db: timed out
7/5/2021, 10:41:37 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
7/5/2021, 10:42:07 AM - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
7/5/2021, 10:42:07 AM - info - BluetoothLowEnergyService: Attempting app discovery for tag 759eb6f76fdb
7/5/2021, 10:42:17 AM - error - BluetoothService: Failed to connect to 75:9e:b6:f7:6f:db: timed out
7/5/2021, 10:42:17 AM - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out

@CobraDunn
Copy link
Author

@mKeRix - Update #2 - Approx. 20 hours after restarting the add-on, it appeared to have taken the Leader role. Unfortunately, when BLE devices began returning home, (3) of the Pi Zero instances immediately stopped responding and went "unavailable". The add-on instance also didn't report any devices. I have disabled the add-on until we can identify the issue.

@BelgarionNL
Copy link

I seem to have run into an stability issue with mosquitto mqtt on. Every night at 4 am my server makes a backup of all my dockers and auto updates the applications that have newer versions ready.

This turns out to be bad because once mqtt server is rebooted the devices dont reconnect to mqtt again and I have to restart room assistant on the rpi running as a docker and then it works again. (now I will set a auto reboot every day at 5 am to resolve this.

why typ this well I also have exactly the issue as described above with no cluster leader being chosen. when I add a docker room assistant instance that is running on my server with an asus bt5 dongle. it fails to assign clusterleader at times.

other then that it seems to be working ok.

@CobraDunn
Copy link
Author

@mKeRix - Can you provide an update on the path of the Beta. It has been some time since its release. Separate from the ad-on concerns, there are still random stability issues that I've found difficult to pin down. Let me know how I can help.

@RutgerDiehard
Copy link

To add another Beta test voice to this discussion, I've been using the Beta since release in the hope it would address some stability issues with my simple config;

  • 1 x RPi 4 running Home Assistant and no RA integration
  • 4 x RPi Zero W running RA on Raspberry Pi Lite OS,
  • 1 x RPi 2 running RA on Rasperry Pi Lite OS, bluetooth dongle and network connected

On 2.18.4 I also have experienced all of the issues as CobraDunn has - nodes going unavailable after reintroducing BLE mobile app, Nodes randomly stop responding, HA add-on won't stay up for more than 24 hours without some type of failure, constant BLE service restarting, clusters won't maintain a leader, and random entities unavailable.

All devices are fully up-to-date and with the latest firmware. I've set the cluster leader as the RPi 2 with LAN connection and that has resulted in a much more stable cluster configuration with no cluster leader switching. However, I still could not get a stable set of RPi Zero devices where they would drop from the cluster or temporarily disappear from the instance browser. I did suspect WiFi connectivity but have ensured their WiFi connections are stable through my Ubiquiti Unifi WiFi configuration.

The single biggest successful change so far for the RPi Zeros (apart from increasing the update frequency to 2) has been to disable on-board bluetooth and use a TP-Link bluetooth dongle with USB extension. This has eliminated node dropouts and general Instance browser weirdness.

However, I am still plagued by the problem of a node ignoring a BLE iOS device a random time after successfully tracking it before going out of range. Restarting the RA service will always resolve the issue and the node then starts to track again. I'd love to help if additional testing is required.

local.yml

global:
instanceName: Kitchen Diner
integrations:
- homeAssistant
- bluetoothLowEnergy

- bluetoothClassic

cluster:
autoDiscovery: false
weight: 20
timeout: 60
peerAddresses:
- 172.x.x.x:6425
- 172.x.x.x:6425
- 172.x.x.x:6425
- 172.x.x.x:6425
- 172.x.x.x:6425
homeAssistant:
mqttUrl: 'mqtt://homeassistant.local:1883'
mqttOptions:
username: #####
password: #####
bluetoothLowEnergy:
timeout: 240
updateFrequency: 2
allowlist:
- 55B84C83-0836-4A10-8896-26A5FCB9E55D
- 397D8CC9-A660-4FD6-9CD2-5CF06958BF0F
- CB10F47C-0112-4759-A7B6-93FDF2725E66
tagOverrides:
55B84C83-0836-4A10-8896-26A5FCB9E55D:
name: Name1
397D8CC9-A660-4FD6-9CD2-5CF06958BF0F:
name: Name2
CB10F47C-0112-4759-A7B6-93FDF2725E66:
name: Name3
maxDistance: 15

@mKeRix
Copy link
Owner

mKeRix commented Aug 5, 2021

Hey all - I haven't forgotten about this issue, I just haven't had the time/energy to continue the work on this. Some unsorted quick thoughts on your last few messages:

  • @CobraDunn The cluster election behaving weirdly on your add-on instance is strange, since it has no special code tied to the add-on. Does it change anything if you let room-assistant auto-detect the network interface by dropping that configuration line?
  • @BelgarionNL MQTT should automatically re-connect in RA, it's not a feature specific to our code but a thing in the underlying library. If you want you can try collecting some debug logs from the time that this issue occurs for you by launching room-assistant with the environment variable DEBUG set to mqttjs*.
  • @RutgerDiehard Do you see anything in the logs when this happens? What does <ra-ip>:6415/status report? Is it always just one iOS device being ignored while the others are still working fine on that node, or does it not track any iOS device anymore? (You can find out the last part by looking at the timestamps of the measured distances on the /entities endpoint.)

Overall, this stuff touches on some topics that I meant to improve for a long time: clustering and inter-instance communication was supposed to be re-done and for the Bluetooth stuff I wanted to try going through BlueZ APIs and dropping the current library due to quite a few issues we've been facing. Unfortunately, all of that touches pretty fundamental things in RA that have impact on the many moving parts, so switching isn't super easy.

@RutgerDiehard
Copy link

Many thanks for the reply @mKeRix - I fully understand time and energy constraints and thank you for your efforts thus far; RA really is awesome!

This time, the RA instance that ignored my iOS devices was the RPi 2 with Bluetooth dongle and LAN connection in the lounge. This is also the cluster leader, although other RA instances on the RPi Zero W are still tracking the two iOS devices successfully. Just to note, it is random which device will start ignoring iOS devices but this time it happened to be the one in the lounge.

It started ignoring my iOS device first based on the last timestamp:

 },
      "Lounge": {
        "lastUpdatedAt": "2021-08-05T06:29:29.735Z",
        "distance": 6.2,
        "outOfRange": false
      }

And the RA log:

Aug 05 06:33:37 lounge room-assistant[15788]: 05/08/2021, 06:33:37 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 4a94dedc6550 with ID 4a94dedc6550 and RSSI -98
Aug 05 06:33:26 lounge room-assistant[15788]: 05/08/2021, 06:33:26 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Maximum retries reached while connecting to 77:15:44:d8:f7:ca
Aug 05 06:33:26 lounge room-assistant[15788]: 05/08/2021, 06:33:26 - error - BluetoothService: Failed to connect to 77:15:44:d8:f7:ca: Maximum retries reached while connecting to 77:15:44:d8:f7:ca
Aug 05 06:33:20 lounge room-assistant[15788]: 05/08/2021, 06:33:20 - info - BluetoothLowEnergyService: Attempting app discovery for tag 771544d8f7ca
Aug 05 06:33:03 lounge room-assistant[15788]: 05/08/2021, 06:33:03 - info - BluetoothLowEnergyService: Attempting app discovery for tag 771544d8f7ca
Aug 05 06:32:48 lounge room-assistant[15788]: 05/08/2021, 06:32:48 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 5ed0979f1050 with ID 5ed0979f1050 and RSSI -82
Aug 05 06:32:48 lounge room-assistant[15788]: 05/08/2021, 06:32:48 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Maximum retries reached while connecting to 77:15:44:d8:f7:ca
Aug 05 06:32:48 lounge room-assistant[15788]: 05/08/2021, 06:32:48 - error - BluetoothService: Failed to connect to 77:15:44:d8:f7:ca: Maximum retries reached while connecting to 77:15:44:d8:f7:ca
Aug 05 06:32:42 lounge room-assistant[15788]: 05/08/2021, 06:32:42 - info - BluetoothLowEnergyService: Attempting app discovery for tag 771544d8f7ca
Aug 05 06:32:37 lounge room-assistant[15788]: 05/08/2021, 06:32:37 - warn - BluetoothService: Did not detect any low energy advertisements in a while, resetting
Aug 05 06:32:03 lounge room-assistant[15788]: 05/08/2021, 06:32:03 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Maximum retries reached while connecting to 77:15:44:d8:f7:ca
Aug 05 06:32:03 lounge room-assistant[15788]: 05/08/2021, 06:32:03 - error - BluetoothService: Failed to connect to 77:15:44:d8:f7:ca: Maximum retries reached while connecting to 77:15:44:d8:f7:ca
Aug 05 06:31:59 lounge room-assistant[15788]: 05/08/2021, 06:31:59 - info - BluetoothLowEnergyService: Attempting app discovery for tag 771544d8f7ca
Aug 05 06:31:58 lounge room-assistant[15788]: 05/08/2021, 06:31:58 - info - BluetoothLowEnergyService: Attempting app discovery for tag 771544d8f7ca
Aug 05 06:31:43 lounge room-assistant[15788]: 05/08/2021, 06:31:43 - error - BluetoothLowEnergyService: Failed to search for companion app at tag 771544d8f7ca: timed out
Aug 05 06:31:26 lounge room-assistant[15788]: 05/08/2021, 06:31:26 - info - BluetoothLowEnergyService: Attempting app discovery for tag 771544d8f7ca
Aug 05 06:31:11 lounge room-assistant[15788]: 05/08/2021, 06:31:11 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 771544d8f7ca with ID 771544d8f7ca and RSSI -76
Aug 05 06:31:08 lounge room-assistant[15788]: 05/08/2021, 06:31:08 - info - BluetoothLowEnergyService: Attempting app discovery for tag 771544d8f7ca
Aug 05 06:26:49 lounge room-assistant[15788]: 05/08/2021, 06:26:49 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 2087b34ab11e with ID 2087b34ab11e and RSSI -79
Aug 05 06:26:49 lounge room-assistant[15788]: 05/08/2021, 06:26:49 - info - BluetoothLowEnergyService: Discovered companion app with ID 55B84C83-0836-4A10-8896-26A5FCB9E55D for tag 572ef3ac3dde
Aug 05 06:26:48 lounge room-assistant[15788]: 05/08/2021, 06:26:48 - info - BluetoothLowEnergyService: Attempting app discovery for tag 572ef3ac3dde
Aug 05 06:24:52 lounge room-assistant[15788]: 05/08/2021, 06:24:52 - warn - BluetoothService: Did not detect any low energy advertisements in a while, resetting
Aug 05 06:19:07 lounge room-assistant[15788]: 05/08/2021, 06:19:07 - warn - BluetoothService: Did not detect any low energy advertisements in a while, resetting
Aug 05 06:17:41 lounge room-assistant[15788]: 05/08/2021, 06:17:41 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 70f4ccf8302e with ID 70f4ccf8302e and RSSI -84
Aug 05 06:17:35 lounge room-assistant[15788]: 05/08/2021, 06:17:35 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 7f1a4806fbc1 with ID 7f1a4806fbc1 and RSSI -89
Aug 05 06:12:17 lounge room-assistant[15788]: 05/08/2021, 06:12:17 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 4593c0a5c905 with ID 4593c0a5c905 and RSSI -98
Aug 05 06:10:13 lounge room-assistant[15788]: 05/08/2021, 06:10:13 - info - BluetoothLowEnergyService: Discovered companion app with ID 397D8CC9-A660-4FD6-9CD2-5CF06958BF0F for tag 500eb1d15ee7
Aug 05 06:10:12 lounge room-assistant[15788]: 05/08/2021, 06:10:12 - info - BluetoothLowEnergyService: Attempting app discovery for tag 500eb1d15ee7

This was yesterday morning. The lounge is directly below the bedroom and both iOS devices are usually seen during the night by the lounge and the RPi Zero W in the bedroom. We also spent several hours last night watching TV in the lounge so the lounge RA instance should have tracked the iOS devices during the evening.

This is my wife's iOS device:

{
     "Lounge": {
       "lastUpdatedAt": "2021-08-05T07:08:05.817Z",
       "distance": 7.3,
       "outOfRange": false
     },

And the log:

Aug 05 08:09:16 lounge room-assistant[15788]: 05/08/2021, 08:09:16 - warn - BluetoothService: Did not detect any low energy advertisements in a while, resetting
Aug 05 08:09:16 lounge room-assistant[15788]: 05/08/2021, 08:09:16 - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
Aug 05 08:08:48 lounge room-assistant[15788]: 05/08/2021, 08:08:48 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
Aug 05 08:08:48 lounge room-assistant[15788]: 05/08/2021, 08:08:48 - error - BluetoothService: Failed to connect to 5c:8a:2a:45:5c:be: timed out
Aug 05 08:08:38 lounge room-assistant[15788]: 05/08/2021, 08:08:38 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c8a2a455cbe
Aug 05 08:08:37 lounge room-assistant[15788]: 05/08/2021, 08:08:37 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:08:37 lounge room-assistant[15788]: 05/08/2021, 08:08:37 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:08:36 lounge room-assistant[15788]: 05/08/2021, 08:08:36 - info - BluetoothService: Detected unusually long lock on Bluetooth adapter 0, force unlocking
Aug 05 08:08:16 lounge room-assistant[15788]: 05/08/2021, 08:08:16 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: timed out
Aug 05 08:08:16 lounge room-assistant[15788]: 05/08/2021, 08:08:16 - error - BluetoothService: Failed to connect to 5c:8a:2a:45:5c:be: timed out
Aug 05 08:08:06 lounge room-assistant[15788]: 05/08/2021, 08:08:06 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c8a2a455cbe
Aug 05 08:08:06 lounge room-assistant[15788]: 05/08/2021, 08:08:06 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 5c8a2a455cbe with ID 5c8a2a455cbe and RSSI -77
Aug 05 08:08:03 lounge room-assistant[15788]: 05/08/2021, 08:08:03 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:08:03 lounge room-assistant[15788]: 05/08/2021, 08:08:03 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:07:48 lounge room-assistant[15788]: 05/08/2021, 08:07:48 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:07:48 lounge room-assistant[15788]: 05/08/2021, 08:07:48 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:07:32 lounge room-assistant[15788]: 05/08/2021, 08:07:32 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:07:32 lounge room-assistant[15788]: 05/08/2021, 08:07:32 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:07:17 lounge room-assistant[15788]: 05/08/2021, 08:07:17 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:07:17 lounge room-assistant[15788]: 05/08/2021, 08:07:17 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:07:02 lounge room-assistant[15788]: 05/08/2021, 08:07:02 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:07:02 lounge room-assistant[15788]: 05/08/2021, 08:07:02 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:06:47 lounge room-assistant[15788]: 05/08/2021, 08:06:47 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:06:47 lounge room-assistant[15788]: 05/08/2021, 08:06:47 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:06:32 lounge room-assistant[15788]: 05/08/2021, 08:06:32 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:06:32 lounge room-assistant[15788]: 05/08/2021, 08:06:32 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:06:17 lounge room-assistant[15788]: 05/08/2021, 08:06:17 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:06:17 lounge room-assistant[15788]: 05/08/2021, 08:06:17 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:06:02 lounge room-assistant[15788]: 05/08/2021, 08:06:02 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:06:02 lounge room-assistant[15788]: 05/08/2021, 08:06:02 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:05:46 lounge room-assistant[15788]: 05/08/2021, 08:05:46 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:05:46 lounge room-assistant[15788]: 05/08/2021, 08:05:46 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:05:31 lounge room-assistant[15788]: 05/08/2021, 08:05:31 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:05:31 lounge room-assistant[15788]: 05/08/2021, 08:05:31 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:05:16 lounge room-assistant[15788]: 05/08/2021, 08:05:16 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:05:16 lounge room-assistant[15788]: 05/08/2021, 08:05:16 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:05:00 lounge room-assistant[15788]: 05/08/2021, 08:05:00 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:05:00 lounge room-assistant[15788]: 05/08/2021, 08:05:00 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:04:45 lounge room-assistant[15788]: 05/08/2021, 08:04:45 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:04:45 lounge room-assistant[15788]: 05/08/2021, 08:04:45 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:04:29 lounge room-assistant[15788]: 05/08/2021, 08:04:29 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:04:29 lounge room-assistant[15788]: 05/08/2021, 08:04:29 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:04:14 lounge room-assistant[15788]: 05/08/2021, 08:04:14 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:04:14 lounge room-assistant[15788]: 05/08/2021, 08:04:14 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:03:59 lounge room-assistant[15788]: 05/08/2021, 08:03:59 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:03:59 lounge room-assistant[15788]: 05/08/2021, 08:03:59 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:03:44 lounge room-assistant[15788]: 05/08/2021, 08:03:44 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:03:44 lounge room-assistant[15788]: 05/08/2021, 08:03:44 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:03:36 lounge room-assistant[15788]: 05/08/2021, 08:03:36 - info - BluetoothLowEnergyService: Discovered new BLE peripheral 6e4921b1c30d with ID 6e4921b1c30d and RSSI -85
Aug 05 08:03:29 lounge room-assistant[15788]: 05/08/2021, 08:03:29 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:03:29 lounge room-assistant[15788]: 05/08/2021, 08:03:29 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5
Aug 05 08:03:13 lounge room-assistant[15788]: 05/08/2021, 08:03:13 - warn - BluetoothLowEnergyService: Failed to discover companion app ID due to error: Connection to 5c:5b:69:63:78:a5 is already trying to be established
Aug 05 08:03:13 lounge room-assistant[15788]: 05/08/2021, 08:03:13 - info - BluetoothLowEnergyService: Attempting app discovery for tag 5c5b696378a5

Finally, the :6415/status as of now:

{"status":"ok","info":{"ble_advertisement_timeout":{"status":"up"},"bt_successive_errors":{"status":"up"},"ha_mqtt_connected":{"status":"up"}},"error":{},"details":{"ble_advertisement_timeout":{"status":"up"},"bt_successive_errors":{"status":"up"},"ha_mqtt_connected":{"status":"up"}}}

I had thought that RA would start to ignore all iOS devices at the same time. However, the time stamps above suggest that this is not the case.

Hope this helps with the diagnosis.

@RutgerDiehard
Copy link

I have made what appears to be a significant change to Home Assistant over the last day or so in terms of my issues discussed in this thread. This has sort of coincided with what I've observed when attempting to troubleshoot the issues with RA nodes ignoring my iOS devices after a while. Specifically, when restarting Zigbee2MQTT, the troublesome nodes start to work again without restarting RA.

The change has been to upgrade Zigbee2MQTT from 1.18.1-1 to 1.21.0-1. On my system, this wasn't an automatic upgrade as the repository changed. So I had to add the new repository, backup the configuration, install the new Zigbee2MQTT version, stop the old one and copy the configuration, then start the new version. I followed this post.

I didn't set out to try upgrading Zigbee2MQTT as a fix - this was to solve another issue with RGBW bulbs - but initial results are looking promising; I have not had any node stop tracking my iOS devices for over 48 hours now.

I wonder what versions of Zigbee2MQTT others are using?

@CobraDunn
Copy link
Author

CobraDunn commented Aug 11, 2021

@mKeRix - The cluster election behaving weirdly on your add-on instance is strange, since it has no special code tied to the add-on. Does it change anything if you let room-assistant auto-detect the network interface by dropping that configuration line?

Thanks for follow-up. I commented out the "networkInterface: eth0", deleted the device in MQTT, rebooted the HA server, and started the add-on instance.

After 1 Hr of the uptime, the add-on reports a leader of "none". All instances, including the add-on, correctly report the Cluster Size of 12.

Room-Assistant App:
The add-on instance does not appear in the Instance Browser list. It DOES appear inside each of the other instances and updates distances as expected... I'm lost.

FYI, I have been able to keep things working for weeks now by using crontab to auto-reboot all devices at 2:00 am. I delay the reboot of the leader by 5 min to make sure all other instances have completed the restart. Without the delay, the leader will not be stable and consistent.

Update...
#860 - After reading through this recent post I restarted ONLY the current leader. All instances immediately fell in line under the add-on "bar" Cluster Leader. This is correct per my config, but confirms the election issues outlined in #860. It also confirms that commenting the networkInterface config line changed the behavior.

@RutgerDiehard
Copy link

I spoke too soon it seems. Back to nodes randomly ignoring iOS devices after successfully tracking them for while. I am going to schedule a reboot every evening as a workaround.

@CobraDunn
Copy link
Author

CobraDunn commented Aug 19, 2021

I spoke too soon it seems. Back to nodes randomly ignoring iOS devices after successfully tracking them for while. I am going to schedule a reboot every evening as a workaround.

@RutgerDiehard - I still have a few instance crashes, but they are significantly reduced by nightly reboots. Typically the instance goes dark and stops providing distance updates after the reintroduction of an iPhone. Sometimes the instance shows "unavailable", but typically the clustering routine continues running while offering no clue to the BLE failure. This often takes down (2) to (3) of my (11) instances simultaneously. It's commonly accompanied by the impacted instance(s) responding slowly, or not at all, to SSH logins. Even when the instance is partially crashed as described, it does auto-reboot via crontab schedule.

Hope this helps until we get things sorted. I'm not aware of any alternatives products that provide the functionality of room-assistant.

@Hukuma1
Copy link

Hukuma1 commented Aug 26, 2021

So I'm confused. Did beta2 remove the ability for iPhone to automatically be tracked via companion app (not having to be open in foreground)? My only use case for RA is to track position of 2 iPhones between 2 nodes I got in a cluster. Trying to figure out the (new?) trajectory of this project. Or do I just not need the app whatsoever for this specific task?

@CobraDunn
Copy link
Author

@Hukuma1 - The Home tracking functionality of the Companion App tracking did not change. The Auto-Toggle Visibility feature, however, no longer works.

@CobraDunn
Copy link
Author

@mKeRix - Looking to understand the path forward. There are many unresolved issues and I keep encountering new failure modes. I and other monetary contributors are becoming frustrated. This project has so much potential. Please provide an update.

@RutgerDiehard
Copy link

I spoke too soon it seems. Back to nodes randomly ignoring iOS devices after successfully tracking them for while. I am going to schedule a reboot every evening as a workaround.

@RutgerDiehard - I still have a few instance crashes, but they are significantly reduced by nightly reboots. Typically the instance goes dark and stops providing distance updates after the reintroduction of an iPhone. Sometimes the instance shows "unavailable", but typically the clustering routine continues running while offering no clue to the BLE failure. This often takes down (2) to (3) of my (11) instances simultaneously. It's commonly accompanied by the impacted instance(s) responding slowly, or not at all, to SSH logins. Even when the instance is partially crashed as described, it does auto-reboot via crontab schedule.

Hope this helps until we get things sorted. I'm not aware of any alternatives products that provide the functionality of room-assistant.

Thanks @CobraDunn, I scheduled nightly reboots and, while it helped improve stability slightly, I still had no confidence devices were where room-assistant thought they were.

I've stumbled across another room-based presence detection solution based on ESP32 devices; website, repository and Reddit. I'm in no way associated with this but have purchased 8 ATOM Lite ESP32 Development Kit and replaced the RPi Zeros running RA. Espresense is architected differently and has less "tweakability" than RA however, they are stable and update as expected. Worth a look in my opinion.

@Scott8586
Copy link

I've also been playing with ESP32 based solutions, both ESPresense and ESPHome's esp32_ble_tracker: component.
The promise of ESPresense's fingerprint is just that, a promise as I already cannot tell the difference between two iPhones, but the project may still become useful. ESPHome has it's issues, but it also seems more stable than using the pi zeros.

@PeteBa
Copy link
Contributor

PeteBa commented Sep 19, 2021

If you have are interested, you could try out room-assistant PR #887 as that seeks to improve on ble stability. Happy to assist as I would be interested in any feedback.

@Scott8586
Copy link

Scott8586 commented Sep 19, 2021

@PeteBa - I will give it a try.

@PeteBa
Copy link
Contributor

PeteBa commented Sep 20, 2021

@Scott8586 , best to create a stand-alone version to test so you dont disturb the existing copy. If you have already installed room-assistant on the pi - and therefore have the main dependencies loaded - then you can create a version to test with the following from your home directory:

stop the current room-assistant service: $ sudo systemctl stop room-assistant
clone the repo: $ git clone https://github.com/PeteBa/room-assistant.git ra-test
change into the ra-test directory: $ cd ra-test
checkout the PR branch: $ git checkout ble_query
install the necessary node modules: $ npm i --unsafe-perm
build the new version of ra: $ node_modules/.bin/tsc -p tsconfig.build.json
copy across your config file and add instanceBeaconEnabled: false to the bluetoothLowEnergy section
run the test version: $ bin/room-assistant.js

If you are doing this on a pi zero w then the build step may run out of memory. If that is the case then you can run an interpreted version which is a bit slow to start but should work.

run in interpreter mode: node -r ts-node/register -r tsconfig-paths/register src/main.ts

@Hukuma1
Copy link

Hukuma1 commented Sep 20, 2021

Any option for those of us using the Docker container? Currently latest build seems to be 3.0.0-beta.2 from 3 months ago. Would love to hop on and help test!

Preliminary tests by the way have been good for my RPi4 running that 3.0.0-beta.2, but it craps out on my Intel NAS. Would love to help solve this issue. (It just dies after a certain amount of time and is never able to recover.)

9/18/2021, 6:15:34 PM - warn - BluetoothService: Did not detect any low energy advertisements in a while, resetting,
9/18/2021, 6:15:37 PM - error - BluetoothService: Command failed: hciconfig hci0 reset

@Scott8586
Copy link

@PeteBa - thanks for the detailed notes on testing your branch/pull. You were right the pi zero ran out of heap on the compile, but I have it running as the interpreted version, on a host which is only looking for a handful of iBeacons. I've turned off the nightly reboot, but I do have it alert me when the host goes offline. I'll keep track.

@Scott1009
Copy link

I ran @PeteBa 's branch for a couple of days - it seemed to go well on an isolated machine where I was only running the LowEnergy integration, so I've moved on to room-assistant 2.19.0 (and npm 7) on my Pi Zeros.

On the zeros where I need to run bluetoothClassic, I'm trying a configuration where I turn off inquiries when I know no one is around (when we are both away and/or the house in Vacation mode), to see if that keeps those machine more stable - I'm finding that the Pis struggle the most and are most likely to drop offline when none of the devices I'm pinging are in the local area.

FWTW, I'm finding ESPresense just isn't going to work for me in place of bluetoothClassic because the fingerprints are not unique - the two main devices that I want to track, iPhones are showing up as the same identifier. Perhaps I can use it for additional beacon tracking at some point...

@mKeRix
Copy link
Owner

mKeRix commented Sep 23, 2021

@CobraDunn I understand your frustration. Unfortunately I'm still having a really hard time to find the time and energy for this spare time project, even though I still have lots of personal wishes for what to improve and add on top of the project. I appreciate the people that sponsor me/the project lots, but if you feel frustrated with the current situation I would ask you to cancel the sponsorship. Everything surrounding this project is open source and free to use either way.

Apart from that, I'd be open for new maintainers to join - in case someone wants to work more actively on the project.

@Scott8586 That probably has to do with the Pis using the whole interval length when the device isn't around, which blocks up the adapter for a long time. It might be cool to have a dynamic interval length per device that will leave longer gaps between queries if a device is away. That would mean a slower detection on re-entry, but hopefully much better stability of the instances.

@RutgerDiehard
Copy link

FWTW, I'm finding ESPresense just isn't going to work for me in place of bluetoothClassic because the fingerprints are not unique - the two main devices that I want to track, iPhones are showing up as the same identifier. Perhaps I can use it for additional beacon tracking at some point...

I hope @mKeRix doesn't mind me posting this on here but ESPresense has had considerable development over the last few weeks. The device IDs are now created based on a query to the BLE iOS device which helps increase uniqueness. It has resolved my issue with an iPhone 8 Plus and and XS Max appearing the same.

ESPresense can even integrate with the Room-Assistant iOS helper application and use its UUID to define the device ID. I'm successfully using Bluetooth presence in automations to keep a light on after being triggered by a PIR.

@PeterCicaMolnar
Copy link

PeterCicaMolnar commented Feb 5, 2023

Hi All, just 2 noob questions.

First of all, thank you @mKeRix for RA, I just love it :) But... :)

I'm on 2.20.0 now, but I would try 3.0.0 beta on all my instances. Also how can I downgrade to eralier versions?
I have 1 Pi4, 1 Pi3B and 2 Pi Zero.
How can I install beta version and it's dependencies? I using BT Classic and HA integrations only.

TIA, Peter

Edit, beta:
sudo npm i --global --unsafe-perm room-assistant@beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests