[monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection


freezes up. have any suggestions ??? thank you in advance.

Please stop posting pictures of text.

Copy and paste has been with us a while now :slight_smile:

1 Like

./support/btle: line 352: printf: write error: Channel break
What is this mistake?

Is there any reason why if I turn the bluetooth off on my phone, it still shows up on monitor as a confidence of 100? Trying to test this out without leaving the house :slight_smile: this is after me publishing monitor/scan/depart

2 Likes
  • Logs begin at Fri 2020-03-06 16:15:26 EET. -
    Apr 07 22:14:31 samsung bash [29819]: ./support/btle: line 352: printf: write error: Channel break
    Apr 07 22:58:35 samsung bash [29819]: ./support/btle: line 352: printf: write error: Channel break
    Apr 07 23:08:54 samsung bash [29819]: ./support/btle: line 399: printf: write error: Channel break
    Apr 07 23:13:17 samsung bash [29819]: ./support/btle: line 352: printf: write error: Channel break
    Apr 08 01:54:49 samsung bash [29819]: ./support/btle: line 399: printf: write error: Channel break
    Apr 08 02:49:39 samsung bash [29819]: ./support/btle: line 352: printf: write error: Channel break
    Apr 08 03:28:40 samsung bash [29819]: ./support/btle: line 352: printf: write error: Channel break
    Apr 08 05:59:12 samsung bash [29819]: ./support/btle: line 352: printf: write error: Channel break
    Apr 08 06:34:08 samsung bash [29819]: ./support/btle: line 399: printf: write error: Channel break
    Apr 08 07:33:17 samsung bash [29819]: ./support/btle: line 352: printf: write error: Channel break
    what is this mistake? And how to deal with it? Thank you in advance

Hello @pedromargarido,

There is a different thread for this, as its not part of the core Monitor project here. But to answer your question, from the topic the app isn’t seeing any nodes as it says "nodes": 0. So there is no data to process.

So I think you need to look into the setup of the monitor system. Please any further questions, kindly ask in the main thread.

Kind regards

Hello,

Maybe I’m having a hard time understanding some limitations, but, somehow, the script doesn’t detect non-static devices. I sometimes could get it to see an “iTag” beacon, it sees a device that’s into the static configuration, but does not detect any new devices.

I’m running it on rPi 4.

root@beepi:/home/pi/monitor# hcitool scan
Scanning ...
        ...1C:23       A31s-Tablet
        ...A4:9E       Bluetooth Audio
root@beepi:/home/pi/monitor# bash monitor.sh -r

===================================================

              *** BETA/DEV BRANCH ***

===================================================
> starting monitor.sh (v. 0.2.200)...
> removing web request caches
> warning: periodic scan mode may cause interference with 2.4GHz networks if run on a Raspberry Pi
> warning: for security purposes, please consider changing 'username' in: mqtt_preferences
> warning: for security purposes, please consider changing 'password' in: mqtt_preferences
> warning: variable mqtt_port does not appear in mqtt_preferences. using default port 1883.
> warning: variable mqtt_publisher_identity does not appear in: mqtt_preferences. using hostname: beepi.
> warning: operating in anonymous and unprotected mode for mqtt broker at 192.168...
> ...A4:9E confidence topic: home/monitor/beepi/bluetooth_audio (has not previously connected to hci0)
[-] 0.2.200 11-04-2020 12:43:17 AM [CMD-NAME]   ...A4:9E Bluetooth Audio  Unknown
[-] 0.2.200 11-04-2020 12:43:17 AM [CMD-MQTT]   home/monitor/beepi/bluetooth_audio { ... confidence : 100 ... }

Scanning with the -b option also does not show the new devices. I haven’t altered the preferences, just the MQTT, which, seems to be working fine.

My scenario: I want to leave the script running for a while, then collect the addresses from MQTT. I could set up a separate hci scan and leave that running, collect data, feed it to the ‘monitor’, but I want to avoid the extra steps.

Is it something interfering with the scan? I often see this message “cycling bluetooth hardware on hci0. please wait a moment…”. I don’t use the BT hardware for anything else.

Sorry for that, I was confused and lost thinking the monitor app from HACS and the core were the same, but now I understood! Thank you very much.

I have another question, is it possible to use the monitor script on the same RPi I run HassOS/Hassio?

Yes, there’s an add-on (linked in this thread). Of course, that assumes your Pi is well placed to cover the whole house…

Tried to find the add-on bit there are 1839 posts… :slight_smile:
Or did you mean this:

I think he means this one: https://github.com/Limych/hassio-addons

Thanks @Tinkerer !!

2 Likes

Thanks also!

Is it possible to install Monitor on same RPi where MQTT Broker is installed?
Im now test Monitor on a RPi3 and have a MQTT Broker running on RPi Zero.

It will be great if I can do whole install of the Monitor on the Zero, Monitor and Broker on same RPI Zero…

Or will it conflict with the install with this part:

7. Install Mosquitto 1.5+  **(important step!)** :

# get repo key 
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key 

#add repo 
sudo apt-key add mosquitto-repo.gpg.key 

#download appropriate lists file
cd /etc/apt/sources.list.d/ sudo 
wget http://repo.mosquitto.org/debian/mosquitto-buster.list 

#update caches and install 
apt-cache search mosquitto 
sudo apt-get update 
sudo apt-get install -f libmosquitto-dev mosquitto mosquitto-clients libmosquitto1

Yes of course you can.

1 Like

EDIT: Removed old MQTT install and reinstall with new one, problems solved.

Tried but gives a error:

root@mqtt-server:~/monitor# apt-cache search mosquitto
bash: clearapt-cache: command not found
root@mqtt-server:~/monitor# apt-cache search mosquitto
libmosquitto1-dbg - debugging symbols for libmosquitto binaries
libmosquittopp-dev - MQTT version 3.1 client C++ library, development files
libmosquittopp1 - MQTT version 3.1/3.1.1 client C++ library
libmosquittopp1-dbg - debugging symbols for libmosquittopp binaries
mosquitto-auth-plugin - Authentication plugin for Mosquitto with multiple back-ends
mosquitto-dbg - debugging symbols for mosquitto binaries
mosquitto-dev - Development files for Mosquitto
libmosquitto-dev - MQTT version 3.1/3.1.1/5.0 client library, development files
libmosquitto1 - MQTT version 3.1/3.1.1/5.0 client library
libmosquitto1-dbgsym - debug symbols for libmosquitto1
libmosquittopp1-dbgsym - debug symbols for libmosquittopp1
mosquitto - MQTT version 3.1/3.1.1/5.0 compatible message broker
mosquitto-clients - Mosquitto command line MQTT clients
mosquitto-clients-dbgsym - debug symbols for mosquitto-clients
mosquitto-dbgsym - debug symbols for mosquitto
root@mqtt-server:~/monitor# sudo apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Hit:3 https://repo.mosquitto.org/debian buster InRelease
Reading package lists... Done

root@mqtt-server:~/monitor# sudo apt-get install -f libmosquitto-dev mosquitto mosquitto-clients libmosquitto1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libmosquitto1 : Depends: libc6 (>= 2.28) but 2.24-11+deb9u4 is to be installed
 mosquitto : Depends: libc6 (>= 2.28) but 2.24-11+deb9u4 is to be installed
E: Unable to correct problems, you have held broken packages.
root@mqtt-server:~/monitor#

Do I need uninstall the current mosquito version and then install this one? the 1.5+ version?

Has anyone had any issues with getting an iPhone to show up? My iPhone is fine and shows up but my wife’s drops off from time to time and the only way to get it back is to restart either Bluetooth or her phone. Anyone else had an issue with this? She has an Apple Watch so was going to try and track this as well as/instead of the phone…

Why are you installing mosquitto 1.5? Who’s instructions are you following? I don’t believe you need to do that.

I followed this github:

Have same issues. I tried this for 2 days on a RPi3B+ on table without problems at all.
Now add the board inside a closet where I have more RPI running, icl my HA server. a MQTT Server near to each other and now monitor is loosing connection with BT of 2 iPhones.

Maybe it will help to use a external BT Dongle with a cable, far away from the RPi. the reduce interference with Wifi?

Thanks, it’s weird that one of the phones still works though. My Rpi3B+ is also running deconz so maybe I need to set up another pi with just monitor but was hoping to consolidate my pis