Monitoring on Pi Zero W with multiple RuuviTags

I can make an image of the systemI have running available if you like.
It includes RuuviCollector InfluxDB and grafana.
Is your other system MS Windows, Mac OS or linux?
Do you have an ethernet adapter on your PiZeroW?
Can you use a 32GB sd card?

Thanks a lot for all your help!

I’d appreciate the image. Yes, I have a 32GB SD card and a USB/Ethernet adapter for my Pi Zero W (although untested so far). Both Linux or Windows is fine.

Thanks again! I will report back either way if it works with your image or if I have to install fresh.


I am in a similar situation like you @alexhk and would like to know, if there are any known issues if I want to connect more ruuvitags, lets say up to 50 pcs to one Pi Zero W?
Many thanks for your answers.

1 Like

I (and I imagine many others ) would be really interested in what your application is for using 50 Ruuvis.

My Pi Zero W image is available at

It is exactly 5,040,031,819 bytes. You should expect it to take in the neighborhood of 1 hour to download at 1 MegaBYTE/second .

Use to write it to a 32GB SD card (without uncompressing it first). Takes about 40 minutes to write and verify.

Connect via USB keyboard and mouse (alternately since pi Zero will not provide enough power for most USB hubs) and HDMI monitor
Use an USB ethernet and connect via ssh from another system.

As pi/raspberry.


sudo raspi-config

Change user pi’s password &
Localisation to change timezone &
network options to change the wifi SSID and password AND hostname …
and shutdown/reboot.

It should start collectingRuuvi Tag data using the RuuviCollector written by Scrin and storing the data in an influx database after a few minute delay.

View the data with Grafana by pointing a web browser at hostname:8888.
Mouse over the graph icon on the left , select ruuvi.autogen, ruuvi_measurments and select a MAC. Note that selecting temperature will include the MEAN() and you may not want that.

You can also use influx from the command line using something like:

influx -precision rfc3339 -database ruuvi
select mac,ceil(temperature*9/5)+32 from ruuvi_measurements group by mac limit 5

That should cover it.
As you should expect: this is provided in the hopes it will be useful without any suggestions that it will actually work for you! Neither me nor anybody else can be responsible if there are any problems related to your use of the system.

That being said , please let me know you use it and have any problems or questions.

@dgerman no secret here: we want to measure temperature around a bigger hall in different containers :slight_smile:

Hello again, does anybody have any experience with connecting so many ruuvi tags to one BW gw? Maybe @otso could you please provide some info? Many thanks in advance.

Hello @vergil,

As the data is sent in broadcasts in random interval, there isn’t really a hard limit on how many beacons your receiver can hear. At some point the broadcasts will saturate the bandwidth, and you’ll get increasing packet loss.

I happen to be researching practical limits right now, if you’re interested in previewing the blog please feel free to look at and give any feedback on if the approach makes sense. Also please note that it’s a work in progress right now, i.e. not polished.

TLDR version: If you’re broadcasting once per second, you could expect highest throughput of data with 769 tags and have 2/3 packets lost. To test it out I programmed 16 RuuviTags to broadcast at 100 ms interval (equivalent to 160 tags, once second interval) and got 0.7 tx per second out of 10 tx per second to Mac regardless of how many tags were active.

My Raspberry Pi had a code which opened a new connection to backend for each sample and the connectivity could not keep up after a peak of 150 tx / second. I’l try later with Scrins RuuviCollector to see if it would hold up better under the load.

Your case of 50 RuuviTag should be fine by the Bluetooth, but Zero W probably has a shared antenna for Bluetooth and WiFi which might limit the rate of data you’ll get or even crash the collector program if it does not handle undelivered samples gracefully.

Hello @otso,
thank you very much for your insight and link to the blog post. In my case, I will not need the data with such granularity, i.e. sending the temperature once per minute up to once per 5 minutes should be just fine. Therefore also the chance to get to Zero W data rate’s limit should be minimized. And as you suggest in the blog, the best way to find out is to try it in real :slight_smile:

@dgerman thanks a lot for your help and for the effort.

I tried your image, bit it failed with Etcher. The official OS images for the Raspberry Pi Zero W worked with Etcher, so I went ahead and installed from scratch. It’s all up and running now, logging my RuuviTag data nicely.

I am waiting for my second 32GB SD card to be delivered, so I will try your image again in a few days and report back (out of curiosity, if it was a one time problem or if the image is corrupt).

I’ll create a separate post to show what and how I installed it.

So for everyone who is interested, I setup the Raspberry Pi Zero W headless with Raspbian Stretch Lite, InfluxDB, Grafana, and RuuviCollector. This was done more or less according to the guide posted at which doesn’t work for the Raspberry Pi Zero W, so I had to make some changes.

Long story short, I followed the guide above but when it came to Grafana it didn’t work with the Rasbperry Pi Zero W, because the official binary is an armv7 binary while the Pi Zero W needs an armv6 binary.

Here is what I had to run/install after I connected to the Pi Zero W via SSH:

sudo dpkg -i influxdb_1.7.5_armhf.deb

sudo systemctl start influxd
systemctl status influxd


At this point I found that the official Grafana armhf binary doesn’t work on the Zero W and I found a compatible armv6 binary in this thread on Github:

sudo apt-get install adduser libfontconfig
sudo dpkg -i grafana_6.0.1_armhf.deb

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server
sudo /bin/systemctl start grafana-server
sudo /bin/systemctl status grafana-server

sudo apt-get install bluez-hcidump

sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcitool`
sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcidump`

sudo apt-get install screen

sudo apt-get install openjdk-8-jre-headless

java -jar ruuvi-collector-0.2.jar

Now I logged in to Garafana’s webUI and setup the RuuviTags.

1 Like

I downloaded and Etchered it before you did and it worked without problems. Did your download get a 5040031819 byte file?

Glad to hear you got it working the “hard” way.
What kind of containers are you monitoring?

PS you may be interested in my findings mostly related to starting/rebooting:

  1. influxdb takes a while to get ready to accept transactions (especially after a powerfail)
    I have found it helpful to add this to 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."
sleep 20

  1. To slow down influxdb restarts after failures add this to service section of /etc/systemd/system/influxd.service


I have 5,040,031,819 bytes, so that shouldn’t be the problem. I am trying again soon with Etcher (just made a backup of my only 32GB SD card which I need to test anyway).

I am not monitoring containers, that was another user.

I am just dropping a few RuuviTags in different rooms and front and back yard for now. Going to add a few more now that I have a working system.

Btw, do you autostart your RuuviCollector?

I now used screen and start RuuviCollector manually. It’s been ages since I setup screen to start at boot.

I have

/etc/systemd/system > ls -l ruuvicollector.service.requires/

lrwxrwxrwx 1 root root 36 Dec 30 21:44 influxdb.service -> /lib/systemd/system/influxdb.service



#DGG added RestartSec=
# # depends on influxdb

I also am enamored with syslog so my (May 26’19 version) RuuviCollector script is

 #                           link RuuviCollector, so systemctl and syslog talk nice:   ln RuuviCollector
 #  sudo systemctl start ruuvicollector
 cd "${0%/*}"; pwd
 logger -p user.notice " ++ /lib/systemd/system/ruuvicollector.service:ExecStart=/home/pi/RuuviCollector/ pwd=$PWD"

 # To disable RuuviCollector:  edit this script:  change  echo and logger to say NOT start and uncomment out the exit 0
  #                             then  sudo systemctl stop ruuvicollector
  echo                    ++ Did     start /home/pi/RuuviCollector/
  logger -p user.notice ' ++ Did     start /home/pi/RuuviCollector/'
  #exit 0
 # This may take  27 seconds if influxdb is running #  1/14/19 took 11 minutes before influx was ready accept a connection
 # This takes 19 seconds to timeout if influxdb is not even running  $? = 1 ALL CPU BOUND!!
 # If influxdb is not ready influx outputs:
 #  Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
 #  Please check your connection settings and ensure 'influxd' is running.
 ############################### wait until influxdb is ready  
 for(( i=1; i<30; i++ )) # wait  19+5 * 30  = 12 minutes  before giving up
 if [ $rc -eq 0 ] ; then logger --priority "++ ruuvicollector: influxdb now accepting transactions"; break; # loop and go
      else               logger --priority "++ ruuvicollector waited for influxdb $i times, rc=$rc and still waiting"
                          sleep 5
 if [ $rc -ne 0 ] ; then  logger --priority user.emerg "++ ruuvicollector gave up waiting for influxdb"; exit $rc; fi
  #  Since  sudo systemctl stop ruuvicollector issues  TERM ; trap that here to generate log entry
  trap 'logger --priority user.alert " ++ /home/pi/RuuviCollector got sig TERM" ;exit 15' TERM # will exit with x'80' + 15 i.e.143
  trap 'logger --priority user.emerg " ++ /home/pi/RuuviCollector got sig QUIT" ;exit  3' QUIT
  java -jar target/ruuvi-collector-*.jar
 logger -p user.notice " ++ /home/pi/RuuviCollector/ exited with rc=$?"

and contains
echo 'select last(temperature) from ruuvi_measurements' | influx -database ruuvi

my /etc/rsyslog.conf includes (among many other things)

 user.*           -/var/log/user.log is a raspberrypi I use to consolidate all my logs.

Thanks a lot, that will be very helpful!

Etcher definitely fails with the image you uploaded. Possibly the Etcher version?! In any case, I am going to restore my own image/backup and will have a look at your startup routine tomorrow morning (it’s getting late over here).

Strangely, Etcher first counts to 100% within the first 2 minutes of writing the image, then it switches to display the GB in the “progress bar” and at exactly 32GB it fails.

Still with us:

(new users can only put 1 image per post)

Now at 32GB it failed:

Perhaps a MS Windows thing. I’ll try that here and post results.

Notice your screen shot stating that the image is 2.21GB (wrong)
Notice your screen shot \.\PhysicalDrive2:UNKNOWN: unknown error, write .
What brand SD card are you using?

Maybe etcher for MS windows does not like 32GB image?

I tried version 1.5.19 and it said image was 866.89 - wrong
As expected after flashing for a minute or so it said 99% complete although it did keep on writing! And eventually completed.

Thanks again for testing! It doesn’t matter though, it’s all up and running now.

I am using a SanDisk 32GB card. I used Win32DiskImager for my own backup and wrote back the image after formatting to verify it worked too.

Etcher I’ve never used before.

I have the image from dgerman running on a Rpi zero w with one tag.
Just checking/testing to see if the battery/solar system I have can support the load.
Next thing is to see if the data from six tags can be displayed and still readable.
Does anyone have a multiple tag system running and how did you get the data from all the tags displayed in such a way that its still clear?
Heres my rudimentary test system display with a single tag.