Beehive Monitor

This topic is dedicated to comments and conversations about the following RuuviLab tutorial:

If you don’t see any comments yet, don’t be afraid to be the first one to contribute!

Just linking to this topic which has good discussion about beehive monitoring:

I am still looking for a way of monitoring my beehives with Ruuvitags and sending the data at intervals of say 10minutes maybe by email to a pc with an accelerometer alarm by email.
Tags need to be nameable.
Hives are in remote areas without power but with mobile phone access.
I like the Mezurem solution of a spare android phone, that could easily be powered by a solar panel, but dont need the SMS message system and would prefer to have the data read on my own pc rather than on the cloud.
Running costs have to be low or very low.
Anyone been working on this?

Now running Meazurem gateway on a raspberrypi zero w with the client on a Samsung S5 running Android 6.0.1
Using a Macbook for ssh access seems to work for me.
At the moment I am still playing with the set up of sensors.
I have a UPS add on board and solar panel coming to power the pi.
One issue I have is adding or updating sensors in the terminal but I am working on it.
It is not a turnkey project and quite a challenge for the newbie to working at terminal level IMHO.
I will update later on success or failure.

What are your specifics for the UPS and Solar panel?

I have had success with the Ruuvi Collector feeding an influx database running on a pi Zero W(no cell phone involved). Not only displaying with Grafana but also downloading data in CSV format as well as extracting data with the influx command (sql like) program.

Seems that it would be easy(for someone with the knowledge) to have a cron invoked script run every 10 minutes like:

influx -precision rfc3339 -database ruuvi -execute “select LAST(temperature), LAST(movementCounter) where MAC =‘D48B9C6C230E’ or MAC =‘C6C30E’230E’” | sendmail me@myaddress.com

I’d be willing to assist with more details if you are interested.

I just want to be able to monitor and have temp, humidity and movement alarms for my hives.
They are in the countryside with cellphone access but no mains power.
I dont want to spend a bundle and graphs and historical data are of no interest.
Standalone in a weatherproof box.
Remote access for programing would be good too.

The configuration I described previously requires no external services for data collection. Grafana is not necessary but really pretty with no additional cost.
One raspberry pi should be able to monitor multiple hive/ruuviTag sets if they are close enough.

Use the

crontab -e

command to update the cron configuration.
Include:

MAILTO=ACampbell@emailhost.com

to have all output to be included in an email.
The lines

mm hh dd MM DOW command
00,30 * * * * checkHive.sh

cause the checkHive.sh script to be executed on the hour (00 minute) and half hour (30 minute), every hour, every day, every month, every DayOftheWeek.

You can add multiple influx commands to the check hive.sh script which can include LAST(humidity).

As you have said, the additional communications hardware/cost is for the cellular connection. I am not familiar with the SIM7000C GNSS GPS GPRS GSM Expansion Board For Raspberry but a quick overview suggests it would work.

Raspberry pi zero with wifi requires an additional 20% power so after construction of the first system you might sacrifice wifi connectivity for better power and use the raspberry pi without the wifi.

So far what we have discussed can be easily replicated for other bee keepers with very little personalization.

OK let me digest that.

The bit I am missing is how does the Rpi connect to say a giffgaff network at the nearest mast to send me the data it has collected and processed from the ruuvitags, either via an email or data?

A year ago I envisaged sitting at my laptop and reading the tag data being collected by a gateway from my hives positioned many miles away,
And an alarm on my phone if any hive went above a preser temp or was moved.

I am still not there, either with a working solution or a clear understanding of why.

As you referred to giffgaff I expect you are within their service area?

Yes, they use the O2 network here.
I take your point about the power consumption of the Wifi connection.

OK, I’ll look into what they have and get back to you.

A thought: Instead of email messages, consider syslog messages, which could be directly received by your Mac book and/or other hosts. This would allow classification of messages as Emergency, Alert , Critical , Error, Warning , Notice , Info or Debug and control their disposition by settings the configuration file on the Mac.
Read https://en.wikipedia.org/wiki/Syslog

That looks workable.
And if the collector is logging at say 15min intervals the graph would allow interpolation for any event messages not received.
According to some very quick research a Rpi zero with a BT dongle might need a considerably smaller UPS especially if as you suggest the collecter is only on to provide a timed event.
The alarm function would still be viable just not in realt time with a max 15minute delay that might be a workable tradeoff.

The RuuviCollector, i.e. java program receives ALL ruuvi bluetooth packets usually runs continuously (if you want to capture all data).

The cron process invokes the transmission periodically.

Timing considerations include real life “once you find out there is a problem, how long does it take to get there” and “how fast does the temperature change anyway”. No sense transmitting every 15 minutes if the temperature -mostly controlled by the bees(?)- changes very slowly and if there is a problem it takes you hours to get to the hive. Think about if the problem occurs in the middle of the night! Considering that, the cron invocation of the transmission could be only between 06:00 and 23:00 by simply changing the cron configuration entry on the pi to:

00,30 06-23 * * * checkHive.sh

See my notes on cron at Cron ; crontab configuration; scheduler

Best to just try you solar/battery config at home and increase solar panel if necessary. Remember you’re running the pi from the battery, charging the batter from the solar panel making dark nights and cloudy days less important. Your choice regarding pi zero W vs pi zero + BT dongle, I’d go with the simpler zero W. Much is up to you including a board that has a clock running off a very small separate battery, using micro amps which can actually shuts down /power up the raspberry pi for minutes/hours if you what to go to the extreme (I would not recommend that). Again in real life you’ve been living with no monitor all this time. Actual milage will vary. Include xxx% safety margin for little additional cost.

Have you seen my data at http://dalogger.dyndns.org:3430 ?
Feel free to poke around.

Your right and on reflection I may just be making a set of worry beads.
The temp reading returned will only ever be representative due to several factors and as you say the bees are very effective at controling it, if they are in cluster or not and that depends more on ambient temp.
The tag cannot be in the centre of the cluster anyway.
Intervention in the hive in winter, apart from supplimentary feeding that should have been started earlier, is often ineffective and impractical as well.
Movement detection is another desirable but not essential featue and I can think of only two issues in the past four years where it would have been useful but again not essential.
My bees have survived so far despite mans interference that may yet prove fatal for them and provided I manage them I hope will continue to do sa.
Lets let it rest for the time being . . . . . .
Thanks
AndyC

Having said that I can think of several situations when a movement alarm to a mobile phone would be very handy and not for a beehive. :slight_smile:

The short range of BT makes placing tags in a shed or garage or in a car on the drive and reading the data thru walls just about impossible.
Would it be possible to use a number of Rpis with BT and Wifi as collectors to pass the data to the Wifi router?

“Observing” events (including temperature change and movement) with ruuvi and passing that information to a Rpi and on to “the known universe and beyond!” is VERY do-able.

I’d really like to continue with the bee hive application. The financial cost is low (IMHO) and it seems it would be very interesting. Perhaps after monitoring a hive you will discover some previously unknown anomaly that will be of importance. I’m willing to continue to support you.

By the way are you a commercial bee keeper or a hobbist? Do you keep bees for the honey or the pollination? Are you located near Lambeth?

Re: power requirements: My son, living in southern NJ, USA has a 6W solar panel with a 500mAh battery on a Feather Huzzah( a board similar to a raspberry Pi Zero W.

Heh
I am a hobby beekeeper and keep them for the sake of the bees.
I try and let one or two chosen colonies a year swarm so as to enhance the wild population that is seriously depleted.
I am in West Sussex RH13.
Happy to keep along the path to enlightenment.
The UPS I have coming is a twin lion pack of 3000mA each with the 3.5W solar panel.
The site is sunny and south facing so we shall see.
I will load the ZeroW with the image from the website and see how we go.
When its up and running I am happy to get it mounted in a suitable weathrproof bu ventilated box and already have five tags at one apiary.
I dont know what level of knowledge about beekeeping and hives you have but where in dfferent hives the tags can be placed, normally above the crown board but not over a hole and centred, will mean that trends are likely more important than the actual realtime temp reading.
This is because as I said earlier the bees dont read the books so will centre there normal activities, and if they need, to their cluster where they choose and that could be at the edge not in the centre.
I also want to read up on Bluetooth mesh as that seems to me prety vital too but in a different way.
I noticed today using the meazurem on Rpi to an Android phone the phone must be on a Wifi hotspot.
Will that make a difference using say a Giffgaff SIM to the local mast?

Using logger or sendmail on the Rpi going to cell carrier does not need any phone at all. logger messages can go directly to your Mac or PC(or both…) and sendmail goes to your mail server

Looking further into giffgaff; cheapest plan allows 500 SMS messages(texts) and 500MB (WOW!) However, I don’t see anything about them catering to IOT. That doesn’t mean they won’t support it.
Hologram (at first glance) looks more friendly.

Bluetooth mesh should not be a concern if multiple tags are within the range of the Rpi.