Hi,
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
do
logger " ++ RuuviCollector sleeping $i more seconds to give influx a start."
sleep 20
done
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
Docs: InfluxDB OSS v2 Documentation
Main PID: 465 (influxd)
CGroup: /system.slice/influxdb.service
ââ465 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
maalis 27 10:39:39 raspberrypi influxd[465]: ts=2019-03-27T08:39:39.195924Z lvl=
maalis 27 10:39:39 raspberrypi influxd[465]: ts=2019-03-27T08:39:39.196382Z lvl=
maalis 27 11:09:39 raspberrypi influxd[465]: ts=2019-03-27T09:09:39.195830Z lvl=
maalis 27 11:09:39 raspberrypi influxd[465]: ts=2019-03-27T09:09:39.196198Z lvl=
maalis 27 11:39:39 raspberrypi influxd[465]: ts=2019-03-27T09:39:39.195891Z lvl=
maalis 27 11:39:39 raspberrypi influxd[465]: ts=2019-03-27T09:39:39.196299Z lvl=
maalis 27 12:09:39 raspberrypi influxd[465]: ts=2019-03-27T10:09:39.195862Z lvl=
maalis 27 12:09:39 raspberrypi influxd[465]: ts=2019-03-27T10:09:39.198984Z lvl=
maalis 27 12:39:39 raspberrypi influxd[465]: ts=2019-03-27T10:39:39.195894Z lvl=
maalis 27 12:39:39 raspberrypi influxd[465]: 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
Docs: man:bluetoothd(8)
Main PID: 3473 (bluetoothd)
Status: âRunningâ
CGroup: /system.slice/bluetooth.service
ââ3473 /usr/local/libexec/bluetooth/bluetoothd --experimental
maalis 27 13:07:26 raspberrypi systemd[1]: Starting Bluetooth serviceâŠ
maalis 27 13:07:27 raspberrypi bluetoothd[3473]: Bluetooth daemon 5.50
maalis 27 13:07:27 raspberrypi systemd[1]: Started Bluetooth service.
maalis 27 13:07:27 raspberrypi bluetoothd[3473]: Starting SDP server
maalis 27 13:07:27 raspberrypi bluetoothd[3473]: Bluetooth management interface 1.14 initialized
maalis 27 13:07:27 raspberrypi bluetoothd[3473]: Failed to set privacy: Rejected (0x0b)
maalis 27 13:07:27 raspberrypi bluetoothd[3473]: Endpoint registered: sender=:1.39 path=/A2DP/SBC/Source/1
This is actually a bug in the tests, for now you can workaround this issue by compiling the package without running the tests with the -DskipTests flag, for example mvn package -DskipTests
edit: this bug has been fixed now
It looks like you have bluez installed but not bluez-hcidump. You need both (as mentioned in the requirements), the latter one provides hcidump.
It looks like you have a standard raspbian, in which case you should be able to install it with:
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:
hcidump --raw
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.
Iâm trying to figure out why Iâm not getting any data to grafana. I figured I could try with the properties file if there is something that could help me
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
name: databases
name
----
_internal
ruuvi
> use ruuvi
Using database ruuvi
> show measurements
name: measurements
name
----
ruuvi_measurements
> show series
key
---
ruuvi_measurements,dataFormat=3,mac=xxxxxxxxxxxx
ruuvi_measurements,dataFormat=3,mac=yyyyyyyyyyyy
> quit
pi@localhost:~ $
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â |
sed âŠ
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
hcitool lescan
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:
name: ruuvi_measurements
tags: mac=C7103C6824C2
time mac last
---- --- ----
2019-03-04T03:55:22.83Z C7103C6824C2 26.01
name: ruuvi_measurements
tags: mac=D3517872EC0F
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.
pi@raspberrypi:~ $ influx
Connected to http://localhost:8086 version 1.5.2
InfluxDB shell version: 1.5.2
use ruuvi
Using database ruuvi
show measurements
name: measurements
name
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,
After starting ruuvicollector, the âhcitool lescanâ doesnât work, but âhcidump --rawâ gives the same blank window as before starting RuuviCollector. Am I missing something?
if there are no devices shown, you donât have a bluetooth device!
You should see something like
Devices:
hci0 B8:27:EB:E3:A4:6C
Add these 5 lines to /home/pi/RuuviCollector/RuuviCollector/.sh BEFORE the java statement
for i in 240 220 200 180 160 140 120 100 80 60 40 20
do
logger -p user.notice " ++ RuuviCollector sleeping $i more seconds to give InfluxDB a start."
sleep 20
done
Then
sudo shutdown --reboot now " add delay to Ruuvi collector"
`
4) When the system come back up:
hcitool lescan & hcidump -t --raw # this starts an asynchronous lecscan and hcidump
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 future samples, you can easily discard some measurements already in the collector by adjusting the measurementUpdateLimit configuration property in ruuvi-collector.properties.
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!
displays the space and user ID. The system âholds backâ this space for cases just like yours. Had you logged in as root you should have been able to clean things up.
As Scrin stated you can change the retention policy (which was likely infinite) to hack off old data (and keep it off).
Does anybody managed to make Ruuvi Collector working under Ubuntu/Debian?
I have spend a whole day trying to figure out why I donât get any data from the collector.
The command below bring me such error:
adam@adam-pc:~$ sudo hcitool lescan
Set scan parameters failed: Input/output error
Also the comand hciconfig hci0 up is unsuccessfull.
The only workaround so far is to change the distro. On LXLE linux everything works out of box. I have tried bluetooth daemon V5.43, V5.48 and V5.50 - same result.
Any ideas?