This SD image includes several features I consider important and helpful.
To get your system running
/boot/wpa-supplicant.conf which the boot process will use to overwrite
/etc/wpa_supplicant/wpa-supplicant.conf and then deletes the boot one.For example:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="my-netname"
psk="Myi-wifi-NetPass"
}
Check for matching quotes
damonitor2
ssh is already enabled so you can use ssh or windows version of putty to login
pi and ruuvicoll will get you in to the bash shell with command line editing using vi
sudo raspi-config.
sudo touch /var/log/grafana.log; sudo chgrp grafana /var/log/grafana.log; sudo chmod g+w /var/log/grafana.log
sudo touch /var/log/xorm.log; sudo chgrp grafana /var/log/xorm.log; sudo chmod g+w /var/log/xorm.log
sudo mkdir /var/log/atsar
Then shutdown -r now 'first shutdown and restart'
When issuing influx from the shell be patient
rc.local.boot/etc/rc.local upon boot log directory/boot/rc.local.boot (includes network configuration ) as well as emerg and alert syslog messages.
hcitool and hcidump require additional capabilities:
sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcitool` sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcidump`The error
unable to set CAP_SETFCAP effective capability: Operation not permittedMeans you forgot
sudo or need to run as user root
To verify that these tools are correctly setup, run each from the command line. The output should be something like:An error likeorCould not open device: No such device
Can't attach to device hci0. No such device(19)means that the BLuetooth interface is not found. `
Set scan parameters failed: Input/output errorMeans that
hcitool is already running.
> hcidump
HCI sniffer - Bluetooth packet analyzer ver 5.43
device: hci0 snap_len: 1500 filter: 0xffffffff
> HCI Event: LE Meta Event (0x3e) plen 43
LE Advertising Report
ADV_IND - Connectable undirected advertising (0)
bdaddr E4:D5:6D:EC:6E:29 (Random)
Flags: 0x06
Unknown type 0xff with 26 bytes data
RSSI: -90
> HCI Event: LE Meta Event (0x3e) plen 42
This will continue until you press ^\ to quit or ^C to interrupt.
ruuvi-collector.propertiesmeasurementUpdateLimit=30000 Restrict number of updates per tag to a more reasonable frequency and consider perfomance
storage.values=raw don't include calculated values in the database which reduces the size
RuuviCollector inserts data into the influxdb for any RuuviTag for which it receives data .filter.mode blacklist | whitelist
influxUrl=http://localhost:8086 relocate the database (and grafana) to another system to ease the load.
ruuvi-names.properties.
influxdb considerations
influx -precision rfc3339 -database ruuvi
alter retention policy autogen on ruuvi DURATION 4320h0m0s (or whatever)
influx -precision rfc3339 -database ruuvi # rfc3339 uses better time display
select mac,last(temperature) from ruuvi_measurements group by mac tz('America/New_York'); # show list of ruuvi tagsdelete from ruuvi_measurements where mac = 'D3517872EC0F' …
Command line editing in influx is done using emacs commands.
influx is a heavy processs. Using it from command line gives SQL command flexability.curl is much less resource intense and is a better choice for cronjobs.curl --get 'http://localhost:8086/query?' --data-urlencode "db=ruuvi" --data-urlencode "q=SELECT mac,last(temperature) \
FROM ruuvi_measurements tz('America/New_York') "
grafana is accessable at http://DaMonitor2:8888
systemd considerations:
/home/pi/RuuviCollector/RuuviCollector
/etc/systemd/system/multi-user.target.wants/ruuvicollector.service contains: Restart=always
RestartSec=300 prevent rapid restart up failiure
/etc/systemd/system/ruuvicollector.service.requires/influxdb.service
crontab
pi user includesinfluxdb to extract the last(temperature) from a particular tag and uses syslog to
send a message to my syslog server. You probably want to change that.
/etc/syslogd
/var/log
/boot/log so they can be viewed from a non-linux system
warning (and above) messages go to my syslog server via UDP (You should probaly remove or change that)
influxdb files there.
syslogd messages there instead of /var/log. /etc/syslog
/var/swapfile as discussions
on the Raspberry Pi forum dispute any advantage.
ruuvi-collector.propertiesmeasurementUpdateLimit=30000 Restrict number of updates per tag to a more reasonable frequency and consider perfomance
storage.values=raw don't include calculated values in the database which reduces the size
RuuviCollector inserts data into the influxdb for any RuuviTag for which it receives data .filter.mode blacklist | whitelist
influxUrl=http://localhost:8086 relocate the database (and grafana) to another system to ease the load.
ruuvi-names.properties.
influxdb considerations
influx -precision rfc3339 -database ruuvi
alter retention policy autogen on ruuvi DURATION 4320h0m0s (or whatever)
influx -precision rfc3339 -database ruuvi # rfc3339 uses better time display
select mac,last(temperature) from ruuvi_measurements group by mac tz('America/New_York'); # show list of ruuvi tagsdelete from ruuvi_measurements where mac = 'D3517872EC0F' …
Command line editing in influx is done using emacs commands.
influx is a heavy processs. Using it from command line gives SQL command flexability.curl is much less resource intense and is a better choice for cronjobs.curl --get 'http://localhost:8086/query?' --data-urlencode "db=ruuvi" --data-urlencode "q=SELECT mac,last(temperature) \
FROM ruuvi_measurements tz('America/New_York') "
grafana is accessable at http://DaMonitor2:8888
systemd considerations:
/home/pi/RuuviCollector/RuuviCollector
/etc/systemd/system/multi-user.target.wants/ruuvicollector.service contains: Restart=always
RestartSec=300 prevent rapid restart up failiure
/etc/systemd/system/ruuvicollector.service.requires/influxdb.service
crontab
pi user includesinfluxdb to extract the last(temperature) from a particular tag and uses syslog to
send a message to my syslog server. You probably want to change that.
syslogd
/var/log
/boot/log so they can be viewed from a non-linux system
warning (and above) messages go to my syslog server via UDP (You should probaly remove or change that)
influxdb files there.
syslogd messages there
/var/swapfile as discussions
on the Raspberry Pi forum dispute any advantage.
Be sure to let me know if you have any problems or suggestions.