so, adding “temperature” in “field(value)” didn’t work.
We showed the project to our teacher and his opinion was that somehow the RuuviCollector isn’t sending data. Now we are trying to build the ruuvicollector again, but now the building is giving errors/failures.
We then tried modifying the values inside ruuvicollector properties file, and with modifying “influxBatchMaxSize=2000” to 1234 and “limitingStrategy.defaultWithMotionSensitivity.threshold=0.05” to 0.06. This got rid of two “failures”. The building worked without properties file, but that didn’t give any data last time so that’s why we are trying to get this to work with the properties file.
Also, continuity to my last problem, hcitool. We noticed/remembered that line "sudo setcap ‘cap_net_raw,cap_net_admin+eip’ which hcidump gave an usage error for setcap.
systemctl status ruuvicollector # NB may show last failure even if ruuvicollector is running OK
systemctl status influxdb
ps -el |grep hci # find all things bluetooth
ps -el |grep Ruuvi
ls -ltra /var/log | tail # show last several most recently updated logs
and copy / paste results here ( Not screen print which omits information)
influxdb takes a while to get ready to accept transactions (especially after a powerfail)
I have found it helpful to add this to RuuviCollectorStart.sh just before java -jar target/ruuvi-collector-*.jar
for i in 240 220 200 180 160 140 120 100 80 60 40 20
logger " ++ RuuviCollector sleeping $i more seconds to give influx a start."
To slow down influxdb restarts after failures add this to service section of /etc/systemd/system/influxd.service
so for the first one (I wasn’t sure how much you wanted from it so I copied everything):
pi@raspberrypi:~ $ hcidump |head -30
bash: hcidump: komentoa ei löydy
pi@raspberrypi:~ $ systemctl status ruuvicollector
Unit ruuvicollector.service could not be found.
pi@raspberrypi:~ $ systemctl status influxdb
● influxdb.service - InfluxDB is an open-source, distributed, time series databa
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset:
Active: active (running) since Sat 2019-03-23 14:39:11 EET; 3 days ago
Main PID: 465 (influxd)
└─465 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
maalis 27 10:39:39 raspberrypi influxd: ts=2019-03-27T08:39:39.195924Z lvl=
maalis 27 10:39:39 raspberrypi influxd: ts=2019-03-27T08:39:39.196382Z lvl=
maalis 27 11:09:39 raspberrypi influxd: ts=2019-03-27T09:09:39.195830Z lvl=
maalis 27 11:09:39 raspberrypi influxd: ts=2019-03-27T09:09:39.196198Z lvl=
maalis 27 11:39:39 raspberrypi influxd: ts=2019-03-27T09:39:39.195891Z lvl=
maalis 27 11:39:39 raspberrypi influxd: ts=2019-03-27T09:39:39.196299Z lvl=
maalis 27 12:09:39 raspberrypi influxd: ts=2019-03-27T10:09:39.195862Z lvl=
maalis 27 12:09:39 raspberrypi influxd: ts=2019-03-27T10:09:39.198984Z lvl=
maalis 27 12:39:39 raspberrypi influxd: ts=2019-03-27T10:39:39.195894Z lvl=
maalis 27 12:39:39 raspberrypi influxd: ts=2019-03-27T10:39:39.196274Z lvl=
I can’t get status for ruuvicollector as it cannot be compiled with the errors I’m having, so it’s not running. If I recall correctly it compiles without the properties file, but I want to have it with the properties file. The errors should be in my previous command. I still have them if you would prefer them in text. For the first command
hcidump |head -30
I have the bluez installed, but I don’t know why it doesn’t work, though in the end it gave me
pi@raspberrypi:~/Documents/bluez-5.50 $ systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-03-27 13:07:27 EET; 8s ago
Main PID: 3473 (bluetoothd)
└─3473 /usr/local/libexec/bluetooth/bluetoothd --experimental
maalis 27 13:07:26 raspberrypi systemd: Starting Bluetooth service…
maalis 27 13:07:27 raspberrypi bluetoothd: Bluetooth daemon 5.50
maalis 27 13:07:27 raspberrypi systemd: Started Bluetooth service.
maalis 27 13:07:27 raspberrypi bluetoothd: Starting SDP server
maalis 27 13:07:27 raspberrypi bluetoothd: Bluetooth management interface 1.14 initialized
maalis 27 13:07:27 raspberrypi bluetoothd: Failed to set privacy: Rejected (0x0b)
maalis 27 13:07:27 raspberrypi bluetoothd: Endpoint registered: sender=:1.39 path=/A2DP/SBC/Source/1
should work without any “usage errors”. After these RuuviCollector should be able to get the data.
If not, you can try troubleshooting it by first stopping ruuvicollector and then running:
hcitool lescan --duplicates --passive
in one terminal window, it should print some lines as it receives various BLE data. While that is running in one terminal window, run this in another:
this should print out all the raw data that’s received (as long as hcitool is running in another window!). If you encounter any erros with these, you could try googling for help. Once those works, then RuuviCollector should work too, as RuuviCollector runs those two commands internally.
What databases, measurements and series do you have?
pi@localhost:~ $ influx
Connected to http://localhost:8086 version 1.7.4
InfluxDB shell version: 1.7.4
Enter an InfluxQL query
> show databases
> use ruuvi
Using database ruuvi
> show measurements
> show series
And you have setup a data source in Grafana which uses the same Influx database as the RuuvoCollector uses?
hcidump -t --raw | #include time stamps
grep --line-buffered --invert-match ‘–’ |
sed --unbuffered “N ;s/\n//; s/ / /” |
grep --line-buffered ‘99 04’ |
If you are not getting anything from ‘99 04’ manufacture ID packets from hcidump, RuuviCollector will not see anything!
Also if RuuviCollector is running and has forked
Another attempt to run hcitool lescan will fail with
Set scan parameters failed: Input/output error
To see if there is ANY ruuvi tag entries in the influx database use
influx -database ruuvi -precision rfc3339
select mac, last(temperature) from ruuvi_measurements group by mac
results should be similar to:
time mac last
---- --- ----
2019-03-04T03:55:22.83Z C7103C6824C2 26.01
time mac last
---- --- ----
2019-03-29T16:02:32.745Z D3517872EC0F 11.65
I tried the first thing you had in this message, did I do it right? I just wrote the whole thing as you put it but it didn’t give anything. The “sed” gives an error that the first character is an unknown command. I didn’t understand that message you are referencing to, care to open it a little for me? I probably need to use it but I don’t know what to do with it.
I used your influxdb command and it gave me https://i.imgur.com/esEZThJ.png I don’t understand how it doesn’t have any data from my ruuvitag(Just gives some random default data.) I have the mac address everywhere I could think of, for example in the ruuviCollector properties file under whitelist. The ruuvitag is using RAW mode, as I suppose it should be.
So the hcitool works before running the ruuvicollector, like here https://i.imgur.com/pKF3dUJ.png But after running it, hcitool lescan gives an input/output error. For that I found another ruuviforum post and there someone suggested going to bluetoothctl console and powering on power, agent and scan, and reboot the machine after that. After doing all that,
I’ve been trying to find solutions for reducing the influxdb size. If there’s already a solution then can you please point me to it
My issue is that I’ve been running raspberrypi with ruuvicollector, influxdb and grafana for ~10 months now. Just this morning my grafana interface stopped working and I noticed that raspberry has totally run out of space.
Is there something I can do to downsample the data? I’ve installed a virtual machine with ubuntu and tried messing up with a copy of the database but so far haven’t got any results…
For downsampling the existing data, you need to run an “INTO query” as mentioned in this post (obviously do this before setting the retention policies to drop the oldest “full accuracy” data if you don’t want to lose historic data. Though as always, remember to take backups before experimenting)
Thanks for the help!
I had to get a new SD-card first because the old one had 0 bytes free so I couldn’t do anything with it…
For someone else fighting with similar issues I took an image from the original card with win32 disk imager and then wrote it to a new SD-card, booted into raspberry (no gui since it won’t boot into gui without any free space on card), connected with SSH and used raspbi-config to expand the rootfs to whole card.
Then I used the provided links to do some research and now I’m downsampling the data and soon dropping the old data after I’m done
I might not be doing this the most efficient way but at the moment it seems to work!