Raspberry Pi aids conservation work
Special Features
The sysfs interface under /sys/class/gpio
was originally used for the configuration, as well as for reading and writing the GPIOs. However, when the problems with the internal pull-ups described above arose, we switched to the wiringPi package, which provides a command-line tool and thus performs all tasks without problem from scripts. The following commands are used to configure the pull-ups:
$ sudo gpio -g mode 17 up $ sudo gpio -g mode 27 up
In addition to up
are the down
and tri
switches. The latter probably stands for "trigger" and switches off the internal resistors. However, it is not possible to read the status with software.
In addition to GPIOs, other challenges need to be solved by the software. Even if it only runs for a few minutes, the system needs to save as much energy as possible. The Rasp Pi Zero is considered unbeatable in this respect, but because UMTS sticks draw a large amount of power, it is not guaranteed that this arrangement will work with all sticks. Turning off the screen and network helps all Rasp Pis conserve energy. An interface-free system on a chip (SoC) also poses no problem in production because communication with the PIC takes place through GPIOs.
The various power-saving techniques were implemented with a separate system service, reconfigured in the central configuration file, which advantageously allows the individual techniques to be switched on and off as required.
Consistent logging is another feature. To ensure that as little information as possible is lost in the event of a power outage, a sync function ensures a secure write to the SD card after every written record and also reduces the possibility of filesystem corruption.
Installation
A Raspbian Lite installation with a number of additional packages, like wiringPi for the GPIOs and gammu for sending text messages, is sufficient, but because the installation involves a number of manual steps, the Raspbian Netinstaller [5] comes into play by automating the entire installation process and ensuring uniform, reproducible, and consistent systems.
The project files are located in the appropriate folders, and the configuration files for the installer are also updated directly in the project. A script downloads the Netinstaller and integrates the files from the project into its own image. After booting, the system then retrieves all necessary files and subsequently configures the system. After installing, all that remains is configuring for the specific trap.
Conclusions
At present, the system is sufficiently advanced to start beta testing, with plans for improvements already in place. For example, the Rasp Pi could send a text message at regular intervals, even without triggering it as a heartbeat message, so that the supervisors can have an overview of all traps. However, this would mean increased capacity requirements with regard to the LiPo battery.
Since the beginning of 2016, small SIM modules like the SIM800L [6] have been around that can be connected to the Rasp Pi through the GPIO. These modules offer an interesting alternative to the UMTS sticks currently used in the project in terms of price and technology. Problems with unrecognized sticks under Linux are then a thing of the past.
The mode switch from a CD-ROM to a modem device, which is necessary under Linux, turned out to be particularly problematic with these sticks, some of which only work under Wheezy and jessie-backports, but not under Jessie. Others work with Jessie without problem, but when switching to the USB modeswitch backport, the system suddenly no longer recognizes it. The software installation then depends on an external component.
Another advantage is that the SIM800 modules draw power directly from the LiPo battery, which means the module even works on first-generation Rasp Pis or the Pi Zero without problem. Additionally, the entire USB complex of the Rasp Pi 2/3 models can be switched off, which saves even more energy.
Regardless of the challenges on the hardware and software sides, many administrative and logistical problems have yet to be solved. For example, you would have to produce the printed circuit board (PCB) in small batches. The many required SIM cards also present a problem; because, ideally, the Rasp Pi only sends a handful of SMS messages per year, prepaid cards are best suited for this purpose. However, managing 40 to 50 contracts is a challenge and, in the worst-case scenario, could lead to false positives.
Finally, financing all the traps is still a problem. Purely from the electronics side, each costs about EUR100, if you produce the PCBs yourself. Another matter of concern is the cost of construction for the concrete pipe traps (Figure 6).
![](/var/linux_magazin/storage/images/issues/2018/207/rasp-pi-fox-trap/figure-6/720608-1-eng-US/Figure-6_large.png)
The circuit and schematic developed for the fox trap easily can be transferred to other projects that work autonomously and only occasionally transfer data. Because a text message has up to 160 characters, it is suitable for more than just a simple status report, and more information could be distributed across multiple text messages.
If GPRS at least is available in the intended area of application, an Internet connection with the UMTS stick is more suitable for the transfer of large amounts of data. Setting up the stick for this purpose is described in a previous RPG article [7].
Infos
- "Using SMS" by Bernhard Bablok, Raspberry Pi Geek, issue 21, 2017, pg. 82, http://www.raspberry-pi-geek.com/Archive/2017/21/Sending-and-receiving-an-SMS-with-the-Raspberry-Pi
- UMTS: https://en.wikipedia.org/wiki/UMTS
- Fuchsfalle [Fox trap] on GitHub: https://github.com/bablokb/fuchsfalle
- English instructions: ftp://ftp.linux-magazine.com/pub/listings/linux-magazine.com/207/
- Minimal Raspbian Netinstaller for Rasp Pi: https://github.com/FooDeas/raspberrypi-ua-netinst
- SIM800L: https://www.amazon.com/SIM800L-Quad-band-Breakout-Interface-Raspberry/dp/B06Y6Q7MFB
- "Rasp Pi 3G Hotspot" by Bernhard Bablok, Raspberry Pi Geek, issue 15, 2016, pg. 40, http://www.raspberry-pi-geek.com/Archive/2016/15/Creating-a-3G-hotspot-with-the-Raspberry-Pi
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.