Bluetooth monitoring

Ok, so I run Home Assistant (on a pi3) and I’d like to improve Home Presence detection. So I came across this tool GitHub - andrewjfreyer/monitor: Distributed advertisement-based BTLE presence detection reported via mqtt
and now I’m wondering if I can safely install this on the Vero4k.
See from step 7.

Does anyone know?

No idea — make a backup and try it?

Ok I tried it but I get stuck.

osmc@Boven_osmc:~$ wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
converted 'http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key' (ANSI_X3.4-1968) -> 'http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key' (UTF-8)
--2018-12-29 11:17:14--  http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3120 (3.0K) [application/octet-stream]
Saving to: 'mosquitto-repo.gpg.key'

mosquitto-repo.gpg. 100%[=====================>]   3.05K  --.-KB/s   in 0s

2018-12-29 11:17:14 (97.2 MB/s) - 'mosquitto-repo.gpg.key' saved [3120/3120]

osmc@Boven_osmc:~$ sudo apt-key add mosquitto-repo.gpg.key
OK
osmc@Boven_osmc:~$ cd /etc/apt/sources.list.d/
osmc@Boven_osmc:/etc/apt/sources.list.d$ sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
converted 'http://repo.mosquitto.org/debian/mosquitto-stretch.list' (ANSI_X3.4-1968) -> 'http://repo.mosquitto.org/debian/mosquitto-stretch.list' (UTF-8)
--2018-12-29 11:17:32--  http://repo.mosquitto.org/debian/mosquitto-stretch.list
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 51 [application/octet-stream]
Saving to: 'mosquitto-stretch.list'

mosquitto-stretch.l 100%[=====================>]      51  --.-KB/s   in 0s

2018-12-29 11:17:32 (1.20 MB/s) - 'mosquitto-stretch.list' saved [51/51]

osmc@Boven_osmc:/etc/apt/sources.list.d$ apt-cache search mosquitto
libmosquitto-dev - MQTT version 3.1 client library, development files
libmosquitto1 - MQTT version 3.1 client library
libmosquittopp-dev - MQTT version 3.1 client C++ library, development files
libmosquittopp1 - MQTT version 3.1 client C++ library
mosquitto - MQTT version 3.1/3.1.1 compatible message broker
mosquitto-clients - Mosquitto command line MQTT clients
mosquitto-dbg - debugging symbols for mosquitto binaries
python-mosquitto - MQTT version 3.1 Python client library
python3-mosquitto - MQTT version 3.1 Python 3 client library
osmc@Boven_osmc:/etc/apt/sources.list.d$ sudo apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

So I did a sudo apt-get install apt-transport-https (no idea if that’s a right way to do it but ok).
Then I did again the sudo apt-get update but get these errors:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libcurl3-gnutls
The following NEW packages will be installed:
  apt-transport-https libcurl3-gnutls
0 upgraded, 2 newly installed, 0 to remove and 51 not upgraded.
Need to get 365 kB of archives.
After this operation, 532 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.debian.org/debian/ jessie/main libcurl3-gnutls armhf 7.38.0-4+deb8u11 [229 kB]
Get:2 http://ftp.debian.org/debian/ jessie/main apt-transport-https armhf 1.0.9.8.4 [135 kB]
Fetched 365 kB in 0s (1331 kB/s)
Selecting previously unselected package libcurl3-gnutls:armhf.
(Reading database ... 22172 files and directories currently installed.)
Preparing to unpack .../libcurl3-gnutls_7.38.0-4+deb8u11_armhf.deb ...
Unpacking libcurl3-gnutls:armhf (7.38.0-4+deb8u11) ...
Selecting previously unselected package apt-transport-https.
Preparing to unpack .../apt-transport-https_1.0.9.8.4_armhf.deb ...
Unpacking apt-transport-https (1.0.9.8.4) ...
Setting up libcurl3-gnutls:armhf (7.38.0-4+deb8u11) ...
Setting up apt-transport-https (1.0.9.8.4) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
osmc@Boven_osmc:/etc/apt/sources.list.d$ sudo apt-get update                    Ign http://ftp.debian.org jessie InRelease
Get:1 http://ftp.debian.org jessie-updates InRelease [145 kB]
Hit http://apt.osmc.tv jessie InRelease
Get:2 http://security.debian.org jessie/updates InRelease [44.9 kB]
Get:3 https://repo.mosquitto.org stretch InRelease [11.0 kB]
Hit http://ftp.debian.org jessie Release.gpg
Hit http://ftp.debian.org jessie Release
Get:4 http://ftp.debian.org jessie-updates/main arm64 Packages/DiffIndex [11.8 kB]
Hit http://ftp.debian.org jessie-updates/contrib arm64 Packages
Get:5 http://ftp.debian.org jessie-updates/non-free arm64 Packages/DiffIndex [736 B]
Get:6 http://ftp.debian.org jessie-updates/main armhf Packages/DiffIndex [11.8 kB]
Hit http://ftp.debian.org jessie-updates/contrib armhf Packages
Get:7 http://ftp.debian.org jessie-updates/non-free armhf Packages/DiffIndex [736 B]
Hit http://ftp.debian.org jessie-updates/contrib Translation-en
Get:8 http://ftp.debian.org jessie-updates/main Translation-en/DiffIndex [3688 B]
Get:9 http://ftp.debian.org jessie-updates/non-free Translation-en/DiffIndex [736 B]
Get:10 http://apt.osmc.tv jessie/main arm64 Packages/DiffIndex [2023 B]
Get:11 http://apt.osmc.tv jessie/main armhf Packages/DiffIndex [2023 B]
Ign http://apt.osmc.tv jessie/main Translation-en
Hit http://ftp.debian.org jessie/main arm64 Packages
Hit http://ftp.debian.org jessie/contrib arm64 Packages
Hit http://ftp.debian.org jessie/non-free arm64 Packages
Hit http://ftp.debian.org jessie/main armhf Packages
Hit http://ftp.debian.org jessie/contrib armhf Packages
Hit http://ftp.debian.org jessie/non-free armhf Packages
Hit http://ftp.debian.org jessie/contrib Translation-en
Hit http://ftp.debian.org jessie/main Translation-en
Hit http://ftp.debian.org jessie/non-free Translation-en
Fetched 235 kB in 11s (20.9 kB/s)
W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease  Unable to find expected entry 'main/binary-arm64/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch https://repo.mosquitto.org/debian/dists/stretch/InRelease  Unable to find expected entry 'main/binary-arm64/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.

Looks like it’s not gonna work right?

Are you on an old version of OSMC?
Your repos should show Stretch; rather than Jessie

Sam

Ah yes you are right. I have 2 Vero4k’s and started with the one I hardly use. I thought it did updates automatically but apparently it was way behind.
I installed the lastest update (October 12018) and ran the commands again.
Still I get an error:

osmc@Boven_osmc:~$ wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
--2018-12-31 12:46:17--  http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3120 (3.0K) [application/octet-stream]
Saving to: 'mosquitto-repo.gpg.key.1'

mosquitto-repo.gpg. 100%[===================>]   3.05K  --.-KB/s    in 0s

2018-12-31 12:46:17 (13.1 MB/s) - 'mosquitto-repo.gpg.key.1' saved [3120/3120]

osmc@Boven_osmc:~$ sudo apt-key add mosquitto-repo.gpg.key
OK
osmc@Boven_osmc:~$ cd /etc/apt/sources.list.d/
osmc@Boven_osmc:/etc/apt/sources.list.d$ sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
--2018-12-31 12:46:32--  http://repo.mosquitto.org/debian/mosquitto-stretch.list
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 51 [application/octet-stream]
Saving to: 'mosquitto-stretch.list.1'

mosquitto-stretch.l 100%[===================>]      51  --.-KB/s    in 0s

2018-12-31 12:46:32 (2.23 MB/s) - 'mosquitto-stretch.list.1' saved [51/51]

osmc@Boven_osmc:/etc/apt/sources.list.d$ apt-cache search mosquitto
libmosquitto1 - MQTT version 3.1/3.1.1 client library
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 - MQTT version 3.1/3.1.1 compatible message broker
mosquitto-clients - Mosquitto command line MQTT clients
mosquitto-dbg - debugging symbols for mosquitto binaries
mosquitto-dev - Development files for Mosquitto
mosquitto-auth-plugin - Authentication plugin for Mosquitto with multiple back-ends
libmosquitto-dev - MQTT version 3.1/3.1.1 client library, development files
N: Ignoring file 'mosquitto-stretch.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
osmc@Boven_osmc:/etc/apt/sources.list.d$ sudo apt-get update
Ign:1 http://ftp.debian.org/debian stretch InRelease
Hit:2 http://ftp.debian.org/debian stretch-updates InRelease
Hit:3 http://security.debian.org stretch/updates InRelease
Hit:5 http://ftp.debian.org/debian stretch Release
Hit:4 http://ftp.fau.de/osmc/osmc/apt stretch InRelease
Hit:6 https://repo.mosquitto.org/debian stretch InRelease
Reading package lists... Done
N: Ignoring file 'mosquitto-stretch.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://repo.mosquitto.org/debian stretch InRelease' doesn't support architecture 'arm64'

I think this is the main issue now:

:N: Skipping acquire of configured file ‘main/binary-arm64/Packages’ as repository ‘Index of /debian/ stretch InRelease’ doesn’t support architecture ‘arm64’

I have little experience with this OS so if you have an idea please let me know.

Use the armhf architecture

Thanks for your reply. Being a total noob. How/where do I put so that it uses the armhf architecture?

That’s not the issue actually
You need to rename the file in sources.d to remove the .1 extension (likely caused by wgetting twice)

Yes I noticed that so I removed all created files and run all the commands again.
Now I don’t see errors about the .1 extension files but still the latest command that fails is:

osmc@Boven_osmc:/etc/apt/sources.list.d$ sudo apt-get update
Ign:1 http://ftp.debian.org/debian stretch InRelease
Hit:2 http://ftp.debian.org/debian stretch-updates InRelease
Hit:3 http://security.debian.org stretch/updates InRelease
Hit:5 http://ftp.debian.org/debian stretch Release
Hit:4 http://ftp.fau.de/osmc/osmc/apt stretch InRelease
Hit:6 https://repo.mosquitto.org/debian stretch InRelease
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://repo.mosquitto.org/debian stretch InRelease' doesn't support architecture 'arm64'
osmc@Boven_osmc:/etc/apt/sources.list.d$

So still/again about the architecture.
Subsequently the next command also fails:

sudo aptitude install libmosquitto-dev mosquitto mosquitto-clients
sudo: aptitude: command not found

Thanks again for your quick replies. I would be thrilled if we get it working as I have a Vero4k upstairs so if I can use that for bluetooth monitor for my home automation would be fantastic.

Use apt-get instead of aptitude

1 Like

Excellent!
It works now!

Had to enable Bluetooth also of course, and run one of the commands under root, but now it’s all working as expected!
Many thanks for your help and a happy new year!