Open source monitoring systems for pollinators & orchids

(Above) Masdevallia hortensis, found in  cloud forests at elevations around 2600 meters

The tropical Andes are a global biodiversity hotspot expected to suffer more pronounced effects of global warming than any other mountain ecosystem worldwide.

The likelihood that plant species can respond through evolutionary changes given the scale and time frame of climate change effects is also unknown. It is also common for charismatic animals to receive attention, yet threatened plants on the contrary have been given little attention in terms of conservation.

This project aims to monitor and conserve species of the threaten and diverse orchid plant family, a group of plants with an extraordinary diversity in tropical Andean Countries. We believe the use of new technologies can help us to monitor orchids, identify unknown pollinators, pollination events, flower development and in general terms phenological events to better understand their status.

Additionally, camera traps will be a powerful tool to control illegal orchid trade and there is potential to address multiple conservation and management challenges. We anticipate orchids can be used as a pilot to later extent and offer the scientific plant community a robust system to record pollinations in other plant families where pollination events are little known.

In addition to the hardware configuration and software programming, it has been necessary to think of other parameters that have not been experienced in this phase, but have been analyzed and planned for implementation, considering these problems that have been experienced in other similar equipment.

 

  • Tropicalization to resist high index humidity, with condensation on the hardware when there are changes in climate.
  • Packaged in waterproof cases.
  • High resistance and stability fixing and support system.
  • Long-lasting and rechargeable battery system so that replacement costs are not as high as those of AA alkaline batteries and their duration is longer.

The most important thing is that it is feasible to use this technology for a conservation site such as the Orquídeas Reserve (video above, https://reserva.sco.org.co), to carry out long-term records that in the future provide valuable information, to be used with statistical analyzes, of:

  • Plant growth
  • Flowering
  • Growth rate
  • Floral visitors
  • Pollinators
  • Diseases

The following guide describes how to replicate our work to date using a Raspberry Pi and a custom camera lens to detect and record pollination events.

Getting Started


Prerequisites

  • Raspberry Pi 3B+ (others models should work too)
  • Raspberry Pi Camera module V2 and flex cable
  • M12 lens mount for Raspberry Pi Camera module v2
  • M12 lens for 10º
  • SD card (minimum 16GB)

Installing

First we have to set up our Raspberry pi installing the Raspbian operative system (OS) on the SD card.

There are many other operative systems but we choose Raspbian Buster Lite (https://downloads.raspberrypi.org/raspbian_lite_latest).

Raspbian Lite is a minimal OS. It is a very light OS with a minimal set of packages, recommended for remote management via Command Line Interface (CLI). For this reason this OS version requires a very low amount of RAM and CPU usage.

Using balenaEtcher (https://www.balena.io/etcher/) or your favorite tool to flash SD cards, copy the Raspbian Buster Lite image into the SD card.

Next, we have to activate the ssh service on the Raspberry Pi to access it via the internet. For this we create an empty file called “ssh” in the boot partition of the SD card.

Later, we introduce the SD into the Raspberry Pi and check that the board is properly connected to a power source and connected by an ethernet cable. Make sure that the camera is correctly adapted to the lens mount with the 10º lens. Some mounts are designed especially for the Raspberry Pi cam V2 and those mounts will be easier to place.

At this point we have the board working but still cannot access it. For this we will set up a ssh connection between a laptop and the Raspberry Pi.

We can look up for the IP address of the Raspberry Pi using nmap and hostname linux commands:

>hostname -I

(We get our laptop IP address e.g: 192.168.1.50).

>e.g.: 192.168.1.50

(Based on your laptop’s IP (XXX.XXX.X.0/24) address, next get all devices connected to your network).

> nmap -sP 192.168.1.0/24 

In this case the underlined IP (below) is the Raspberry Pi ‘s address, and you can find your own trying to connect to all the IPs shown by nmap using ssh:

Now we can log in to the Raspberry Pi over SSH;

>ssh pi@IP_ADDRESS

(the default username is pi and the password is raspberry). 

Now you have access to the board via the internet.

The first time you get into the Raspberry Pi and only once, we have to configure the time zone and activate the camera module using raspi-config.

>sudo raspi-config

(access the Raspberry Pi config UI).

In this menu, and using only the keyboard, we can configure the time zone in Localization Options and activate the camera module in Interfacing options.

Next, we install the python drivers for the camera;

> sudo apt update -y

> sudo apt upgrade -y

> sudo apt install python-picamera python3-picamera

Now we have to install the software to enable streaming video and for the focus adjustment in real time. We will use GStreamer, an open source library for  media-handling.

To install GStreamer and dependencies on the laptop and the Raspberry Pi;

> sudo apt install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-pulseaudio

If everything is alright we are ready to test the camera:

Type the following line in a terminal in the Raspberry Pi. Notice that the flag “host” refers to your own Raspberry Pi IP, and it must be modified.

> raspivid -t 0 -h 720 -w 1080 -fps 25 -vf -b 2000000 -o – | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=192.168.1.61 port=5000

While the last command is active in the Raspberry PI we type this in a terminal window in the laptop (Note that the flags “host” and “port” must be the same we used in the last command in the Raspberry Pi).

> gst-launch-1.0 -v tcpclientsrc host=192.168.1.61 port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

Now the screen of the laptop is displayed with the output of the Raspberry Pi cam.

We have to check that the output is perfectly centered on the screen, otherwise it will be impossible to adjust the focus of the lens. This is trickier if the lens mount is not specifically designed for a Raspberry Pi camera module V2. 

To aquire sharp images we manually adjust the focus, varying the distance between the lens and the object to be shot. In this case we will test the capability of the lens with a local bill. Here, a picture of the bill can be seen with a decent cell phone camera;

The focal distance of the 10º lens is about 0.4mm, so setting up this camera and the bill using this lens results in the following zoom.

At this point we have set up the camera and focused the lens. For taking maximum advantage we automate the process of taking images introducing software typically used in surveillance applications, which includes many functionalities including motion detection and video recording.

For the surveillance application use:

Raspberry PI-TIMOLO (PI-TImelapse, MOtion, LOw Light https://github.com/pageauc/pi-timolo/).

To install PI-TIMOLO;

> curl -L https://raw.github.com/pageauc/pi-timolo/master/source/pi-timolo-install.sh | bash

If everything went ok we should have a folder called pi-timolo in /home of the Raspberry Pi. Next, type;

> cd pi-timolo

Pi-timolo offers a lot of functionality, but we only want to record video when the cam is triggered by the detection movement algorithm, so we configure config.py to do this. Config.py is a wrapper script to configure the different options of pi-timolo.

> nano config.py

We turn on the “motionVideoOn” and turn off the option “timelapseOn”, the other options can be left default for a quick test.

Finally we are ready to test the pi-timolo: for this we run:

> python3 pi-timolo.py

Or send the process to background  and the standard output and the standard error to two different log files;

> nohup python3 pi-timolo.py > out.log 2> err.log &

We can monitor the activity of the pi-timolo activating the integrated web server of the timolo app.

> ./webserver.sh

>./webserver.py

Or we can send the web server task to the background.

> ./webserver.sh

> nohup ./webserver.py > wb_out.log 2> wb_err.log &

We access the web server interface via the browser.

> my_rpi_ip:8080

(where my_rpi_ip refers to the ip address of the Raspberry Pi we figured out before)

Notice that if the cam is triggered the video file will be stored in the “motion” folder.

The files in the Raspberry pi are stored at “./media/motion”.

We can retrieve the files saved in the rpi to the laptop using scp unix tool.

> scp -r pi@my_rpi_ip:/home/pi/pi-timolo/media/*

This will prompt for the Raspberry Pi  password and will then download (to the current directory of the laptop) all of the files stored in /home/pi/pi-timolo/media/

Now we are ready to play with different objects and lenses and try to get some pollinator HD videos.

Future development

Although the operation of these cameras has already been investigated and implemented, there is still a need to apply what is colloquially called “tropicalization”, which consists of adapting electronic equipment so that they are immune or at least more resistant to climatic conditions. Almost all of them have already been investigated, but their implementation in the field is missing to verify their success:

  • Waterproofing with pyroxylin lacquer so that condensed moisture does not bridge the circuits.
  • Watertight box with space to house silica gel type desiccant material inside
  • Storage system for rechargeable lithium batteries that can be changed without opening the camera.
  • Anti-frog coatings on the lenses, because since they are made of polycarbonate, they can easily become opaque with humidity.

Wireless transmission technology is already fully developed and it would be ideal if one of these cameras, in the middle of the forest, could be viewed from a mobile phone or computer. This technology is already implemented in other sites with normal camera traps, but the difficulty lies in two aspects: the presence of a signal or, failing that, access to satellites, and the conditions of confinement to the signal generated by the forest canopy. Being able to get indisputable information about who are the visitors of the flowers and, in many cases, of the natural pollinators, would be an important contribution to the conservation of orchids and the preservation of these forests.

Authors

Acknowledgments

Continue exploring

GeoSeals trialled in Ethiopia

GeoSeals trialled in Ethiopia

It was a warm afternoon in late May 2022, in a coffee shop in Portsmouth, when Ruby Hill and I first questioned “how...

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *