Closed vladtepz closed 5 years ago
Are all your devices already marked 'home'? If so, an arrive scan is not necessary and is not performed. Can you post monitor log output without the -F flag so that I can see the progression from start to when we expect an arrive scan to happen?
4 devices are 'home', 4 devices are 'not home'. ( 8 total )
Without the -F
or -V
Flags, I get a bunch of these, and then nothing ever happens unless I trigger a scan with "monitor/scan/arrive
"
mike@hassio:~/.monitor$ sudo bash monitor.sh -a -x
> starting monitor.sh (v. 0.2.148)...
> retaining mqtt status reports
> warning: monitor.service not installed. Install service? (y/n)
n
##### (below x8, addresses redacted ) #####
> XX:XX:XX:XX:XX confidence topic: monitor/hassio { id: XX:XX:XX:XX:XX ... } (has not previously connected to hci0)
> XX:XX:XX:XX:XX device_tracker topic: monitor/hassio { id: XX:XX:XX:XX:XX ... }/device_tracker [not_home or home]
Then nothing.... It doesn't do an initial scan for me when starting, if that's what you were looking for.
The issue may be with the number of devices you're trying to track. Select a single device first to see if an improvement appears.
When you run: sudo hcitool lescan
does the output look like a very fast stream of data or does it settle down in maybe 15 - 30 seconds to a list?
sudo hcitool lescan
is quiet. Nothing shows up initially, and then, only 1 device did show up after a few minutes. ( ran it for about 5 minutes )
Started Monitor up with only x2 devices. ( x1 device I knew was home, x1 device I knew was away ) Waited for the "LE Advertising Report" to show up, it passed the filters.
Results are the same. No scan was triggered.
The hcitool output is quite surprising. Are you in a rural or otherwise radio isolated area?
fairly rural, nearest neighbor is around 200 feet / 60 meters away.
Ok, that explains it. I have pushed an update in the last hour - have you updated? That corrects a minor issue with single topic mode.
The brass tacks here is that monitor uses hcitool lescan
to obtain information about your bluetooth environment. You evidently only have one device in the bluetooth environment, so it's probably being processed before monitor fully boots up and is able to receive that data.
As a test, try this. Let monitor boot and then power cycle bluetooth on the iPhone (e.g., through Settings App, not through the control center button). You should see a new device and monitor will begin to scan.
Most users won't run into this problem because they have more than just a single device advertising, so monitor has plenty of devices that can trigger it. I think I have a solution for you. Let me work on it.
Monitor Version: 0.2.150
Updated, did a used -d
to restore to default behavior_preferences, no change.
FWIW, just a little more background, I've also been testing, although not all at the same time, on a Raspberry Pi 3 Model B, & Raspberry Pi 3 Model B+ ( running raspbian )
All 3 devices are experiencing the same issue. They all update if triggered manually, none through BTLE advertisements.
I've had Monitor ( 0.1.675 ) running for about the last 5 months prior without issue. I had never updated until recently because it worked well and I kind of forgot about it.
Fast Forward about a week ago, and I am currently in the process of updating/upgrading all my local Servers/PCs/Media Boxes/etc..., hence me stumbling upon the issue. Didn't have a chance to post an issue until today.
If you can't think of anything else, perhaps I'll try to get v0.1.675 running again and slowly update every few releases and see where it breaks.
Unless you ( hopefully) have any other suggestions?
Updated to 151, with a small change that should help your installation(s) get over the hump a bit - see if that makes a change. what about the test above?
Tested monitor.sh (v. 0.2.151)
Results:
a few side notes:
behavior_preferences
is default (unedited)Another thing to note.
power cycle bluetooth on the iPhone (e.g., through Settings App, not through the control center button). You should see a new device and monitor will begin to scan.
Nothing shows up when I do this, I've tried with my both my iPhone and x2 iPads. I've even tried rebooting the devices close to the device running Monitor.
monitor -c addr
. Device pairs fine. Scan issue remains, only difference is when I do a manual scan, I get the rssi values back since I paired it.OK @andrewjfreyer so I finally had a full day to test and the issue may be with my specific set-up and/or hardware on one of my servers and may not be related to Monitor at all.
Here are my results:
Raspberry Pi 3 Model B - ( Docker, Monitor running on debian:buster-slim tested) Working as intended. 👍
Raspberry Pi 3 Model B+ - ( Docker, Monitor running on debian:buster-slim tested) Working as intended. 👍
Raspberry Pi 3 Model B+ - ( Monitor running on Raspbian Stretch Lite tested) Working as intended. 👍
x8664 Test PC - ( Monitor running on Lubuntu 18.04.1 LTS tested)_ Working as intended. 👍
x8664 Server running HA - ( Monitor running on Ubuntu Server 18.04.1 LTS tested & Docker, Monitor running on debian:buster-slim tested)_ Not working as intended. 😞
This leads me to believe that the issue is on my side. I'll have to track it down, because prior to a reformat, Monitor was working as intended on this machine/OS. The only significant changes were Hard Drive & Memory upgrades and the addition of a HUSBZB-1 Zwave/Zigbee USB stick.
You can probably close this issue for now. Thanks for the help. 👍
Hmm. Sorry to hear that there isn't a resolution thus far... I'll close for now. Thanks for the report!
@vladtepz I don't know if it affects what you were seeing, but I'm curious regardless for my install: what version of MQTT you are running?
Looks like the default for 18.04 / Bionic is MQTT version 1.4.15 - is that working for you? If you upgraded, what method did you use? The PPA appears to jump to 1.6.2.
@mrand At the time, I tested with the Docker version of Mosquitto, The Mosquitto PPA, and the Hassio Mosquitto add-on. ( Among creating my own docker images )
I believe all 3 were on version 1.5.x at the time, as I remember reading that a 1.5+ version was required.
Not sure what happened to 1.5 in PPA though...
I've stopped using Monitor for now, because of the issue, until I have more time to play around with it, so I won't be of much help. Sorry.
Hmmm the "1.5+" phrase might be key here... I was originally thinking 1.5.xx when I read it.
@andrewjfreyer, from https://github.com/andrewjfreyer/monitor/issues/175#issuecomment-488001197, it looks like you're saying 1.6.2 would likely work for the machine running monitor?
For reference, I'm hoping to try this on my Wyse 7020 thin client that has the optional wifi/bluetooth installed.
@andrewjfreyer, from #175 (comment), it looks like you're saying 1.6.2 would likely work for the machine running monitor?
Yes, the issue was fixed with 1.6.2 of mosquitto. Error introduced in 1.6.0, so anything before or after 1.6.2 will work.
OS: Ubuntu 18.04.2 LTS
Monitor Version: 0.2.148 Command Used:
sudo bash monitor.sh -a -x
My issue:
Monitor will only scan if I manually trigger a scan via "
monitor/scan/arrive
" or "monitor/scan/depart
", and this is working as intended.Unfortunately, it will not scan for bluetooth advertisements.
behavior_preferences:
I've also tried (unsuccessfully) with:
Here is my output with the "
-F
" flag enabled:I'm expecting the advertisement to trigger a scan,
flag pass:
toblacklist:
are all highlighted Green, but a scan is ever attempted.Do I not have it setup correctly?
If you need any more info from me, just let me know.
Thanks.