MeidokonWiki:

I have Hass running on an RPi3 at home, not doing much at the moment though.

Hardware

RPi3 type B

Software

I'm running Hass.io because it's easymode.

Beaconing

General notes: https://www.home-assistant.io/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/

So it can do some interesting things, but it's especially good for presence detection and the like.

There's a bunch of libraries for supporting it in various forms, etc:

Scanning and detecting beacons

apt install python3-pip
apt install python3-pil
apt install python-smbus i2c-tools
apt install vim
apt install chrony
apt install dnsutils
apt install python-gpiozero festival
apt install python-alsaaudio
apt install python3-gpiozero
apt install python3-alsaaudio
apt install tcpdump
apt install bluez-tools
apt install bluez-hcidump

apt install python3-pip python3-pil python-smbus i2c-tools vim chrony dnsutils python-gpiozero festival python-alsaaudio python3-gpiozero python3-alsaaudio tcpdump bluez-tools bluez-hcidump


activate_beacon.sh

#!/bin/bash

sudo hciconfig hci0 down
sudo hciconfig hci0 up
sudo hciconfig hci0 leadv 3
sudo hciconfig hci0 noscan

#                                                      COMP.ID    LEN    UUID                                                   MAJ   MIN   POWER  EOF
#sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00   02 15     E2 0A 39 F4  73 F5  4B C4  A1 2F  17 D1 AD 07 A9 61    42 42 69 69 CC     00
sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00   02 15     28 F3 7A B2  A4 FB  57 E9  BD 7D  DA F9 A4 A4 F4 D6    42 42 69 69 CC     00

get things setup with dietpi-config, static IP, disable bootwait for network, ondemand power governor for 40sec

apt install less strace vim bluez-hcidump net-tools tcpdump lsof

copy tile-scan over, it should now run

try installing node-red via dietpi-software

deps for node-red-contrib-noble

use the *ansson11 one, it's updated sorta-kinda

{ .trigger_source: "ble_tile1"; }

Doing setcap on /usr/local/bin/node seems to have fixed my woes, it wasn't screwed up npm packages after all (or maybe it is)

  212  npm install @abandonware/bluetooth-hci-socket
  213  npm install bluetooth-hci-socket@npm:@abandonware/bluetooth-hci-socket
  214  ls
  215  npm install @abandonware/noble
  216  npm install bluetooth-hci-socket@npm:@abandonware/bluetooth-hci-socket @abandonware/noble

# https://github.com/abandonware/noble#running-without-rootsudo-linux-specific
setcap cap_net_raw+eip /usr/local/bin/node

Didn't need, but useful: https://github.com/kmi/node-red-contrib-noble/issues/2

MeidokonWiki: HomeAssistant (last edited 2021-04-14 18:02:31 by furinkan)