Collecting RuuviTag measurements and displaying them with Grafana


#102

Not an expert but are you sure you are running it on Raspberry Pi 3? I see references to bcm2835 and bcm2836 in your screenshot but Pi3 is based on bcm2837 and I’m not sure the binaries are 100% compatible. Just off the top of my head, may be completely off.


#103

Thanks, I confirm the integrity but I have to wait until Monday to try flashing and running the image.


#104

It’s 3b, but at least the previous version of the image worked just fine with the same procedure and same 16 gb SD card.


#105

New challenge, the unzipped image is a tad larger than 16 GB SD card allows. Need to reformat the card to see if the volume can be tweaked


#106

The card I used was “official Raspberry NOOBs 16 GB”. If the image won’t fit into your card, I can take a look into shrinking the filesystem by a few hundred MB


#107

Hi guys. We would like to make the official Raspberry Pi logger image super easy to use also for beginners. This is the plan (copypaste from its upcoming tutorial):

"There are several ways to explore the history. Starting from the easiest and the quickest one

1) Using a computer or a mobile phone, establish a connection to a WiFi access point named Ruuvi Logger (password = ruuvilogger). Once connected, surf to: http://ruuvi.logger"

Would someone be interested to help?

Basically what is needed:

  1. Make the RPi to act as a WiFi access point
  2. Install a DHCP server (?) so that user can type ruuvi.logger instead of 192.168.0.1 or something

#108

HI, just got my first tag and it they are cool. I tried Otso’s latest image and phase some problems.
First win10 did not unzip the package but I success with Linux and made installation card, but but… I was not able to get it running… I am sure I missed something. I read this page through several time and the result was not working.
I will try again tomorrow but few questions:
I understand grafana must be started but how other services? Are those up&running automatic?

Sorry for stupid questions but I have to make this running in my rasp, this is so nice stuff.


#109

Hello, latest image is for Raspberry Pi 3 and it should be good to go without additional configuration.
I think that every link is updated to point to google drive, if you find one pointing to Jenkins.ruuvi.com please let me know and I’ll fix it.


#110

And the solution of this problem was:

go to the port 80 instead 3000.

I don’t know if I have understood this wrong, but when I read this page through several times there was a tip to go http://yourip:3000, that is not working with Otsos image.

http://yourip:80 works


#111

Yes, the grafana runs on port 80 now. We’ll create a proper tutorial with up-to-date information soon, in meanwhile I’ll edit in note to use port 80. Thanks for the clarification.


#112

Okay, so the situation is this: Etcher lists the raspberry.img size as 15.93 GB, the “16GB” card is 15.64GB (300MB smaller).

Trying to reformat it didn’t succeed in OSX.

I believe the card initially held the similar NOOB image (got it from Verkkokauppa.com bundle), I suspect that I may have been damaged (even thou it has really hardly been used at all).

L


#113

Thanks for the report. I’ll look into shrinking the image a little somehow


#114

thanks, it is odd, but the capacity seems to have permanently shrank. Formatting it to something else than FAT worked, but the capacity remains at 15.64GB


#115

Tried with another 16 GB card, but the problem is the same. I think the older image wasn’t just as big.

If you can reduce the image by 400 MB it’ll be a safe bet to get it running on any 16GB card. I think I will go forward and get a bigger card in the mean time.

L


#116

Hello Lauri,
I think you may ask whether is better to encourage people to use Pi or rather work on the existing mobile app, which will ultimately always be easier than setting up the Pi and using it inside LAN.

I would suggest you work on improving the image for Pi “desktop” use. You can set it up so that it will launch the right Ruuvi Grafana dashboard from the start. At least the following would help:

  • reduce the image to fit on 16 GB card
  • install and setup NTP (I suspect things will go bad if you don’t and the device reboots)

Questions:

  1. Setting up ruuvi-names.properties doesn’t seem to take effect, I still see the data in Grafana only by Mac address

  2. I’m running the standard firmware of Ruuvi in the RAW mode. After few times skimming through this page I’m still uncertain should I try to replace it or will it work okay? My goal is to achieve a sauna temperature display similar to Slush but bit more complicated.

L


#117
  1. The RuuviCollector must be restarted for it to re-read the configuration and names. (You also need to be using the new format with RuuviCollector version 0.2.0 or newer, as the naming support was implemented starting from that version). You might need to hard-refresh the Grafana page on your browser for it to realize the name is available as well in addition to the MAC.
  2. The RAW mode is the recommended one (available on the standard firmware), it gives the most accurate readings of all sensors and battery voltage. The “new” firmware with “RAW v2” is still in a “beta stage” so I wouldn’t recommend using it for “business critical production use” just yet, but it should still work equally well.

#118

Thanks Scrin, both issues are now clear. Here’s what happened

  1. I’ve now used
    sudo systemctl restart ruuvicollector
    to reboot the collector, which is the 0.2.0 bundled with the latest Pi image discussed above
    I also reloaded grafana in Chromium with Ctrl + Shift + R but things don’t seem to change.

I’m going to try adding a new tag and put in the name first before the collector hears it
EDIT:
Adding new tag works as expected but I still don’t get the name displayed on Grafana. Is there ways other than Grafana to check what goes on? (didn’t immediately figure out any cli tool to check db content)
EDIT2:
After creating new dashboard, I was able to pull out NAMES field and it was pre-populated with the correct values so this is just a Grafana issue with the dashboards setup.

  1. Good, glad to hear it, updating firmware doesn’t seem very straighforward

#119

Tip for Grafana:
Once you get the tag names set up for collecting, use
$tag_name
in the ‘alias by’ definition field of the Grafana query to get a legend with only the name.

UPDATE:
This will not work unless you also specify GROUP BY tag(name) as part of the metrics query.

E.g. SELECT mean("temperature") FROM "ruuvi_measurements" WHERE ("name" = 'Sauna1') AND $timeFilter GROUP BY time($__interval), "name" fill(null) ALIAS BY $tag_name

(don’t copy paste this as is, change name and drop ALIAS if you use edit mode)


#121

Hello.
I’m still interested in getting a slightly smaller image if possible.
However, otherwise I’ve done some work to tweak the weather station dashboard use case image out of the Raspian.

Here’s what I did to get a setup that will keep the clock synced when online, always start and keep HDMI output on (1080p50 fixed).
Comments starting with hashtag describe metalevel, those without are terminal commands or lines of code to insert in a settings file. You could automate much of this. I will clone this image for my personal projects, but have to shrink it first.

INSTALL LOG

#fresh Pi 16GB image flash and setup time: 22 min

#steps to fix the Feb/'18 image. Need keyboard + display + wifi

#set correct keyboard in pi settings

#change pi password in terminal from ‘raspberry’

passwd

#connect wifi

sudo apt-get install ntp

sudo dpkg+reconfigure tzdata

sudo nano /boot/config.txt

#edit to insert/enable

hdmi_group=1
hdmi_mode=31
hdmi_force_hotplug=1

#disable screen blankin in X

sudo nano .profile
#insert
xset s off
xset -dpms
xset s noblank

#configure chromium to continue where you left off

#configure ruuvi collector tag names

nano RuuviCollector/ruuvi-names.properties.example

#add mac addresses
#save without .example

nano RuuviCollector/ruuvi-collector.properties.example

#add
filter.mode=whitelist
filter.macs=

sudo systemctl restart ruuvicollector.service


#123

Had things working well, then something happened. Influx is running, ruuvi-collector is running. Within Influx I can see fresh data from my three ruuvi tags. But Grafana stopped working. At first I thought it was that I accidentally trashed /boot/config.txt, but I replaced it and there wasn’t anything special in there anyway. I re-installed grafana. I installed apache2 just in case I screwed that up somehow. Apache is working, i.e., I get the default web page. I restart grafana-server, get no errors but also do not see it in the processes list after issuing ps -ef.

I’m new to linux and raspberries, but I’ve been reading up. All seems in order… except whatever I messed up. The only thing I haven’t done yet is start from freshy-fresh image. I can do that, but I’d like to learn what I did.

Any clues what I f-ed up? Thanks!