Closed joknjokn closed 2 years ago
Hello! Thanks for your interest! I'm sorry I cannot answer this with any real certainty since I've not been able to test on a RPi3 myself yet and do not know.
I do think BirdNET-Pi would run on the RPi 3B+. So long as the ARM64 version of RaspiOS is the operating system, the TFLite pre-built binaries ought to run, which is the only part that might fuss.
You will want to enable the zRAM swapping to compensate for the 3B+'s small memory. There is a tool for this under birdnet-pi-config
's System Options.
See the screen shots below for how to use the tool:
In the Raspberry Pi's terminal (after installing BirdNET-Pi), OR from an SSH terminal session with the BirdNET-Pi, issue birdnet-pi-config
:
Use your arrow keys to select "System Options"
Then select "Configure zRAM"
Choose yes
I recommend using 2G for the RPi3
Then you'll see this
You'll have to reboot for the swap partition to be available.
Please give it a try, OR you are welcome to test the new pre-installed image HERE to save a little time. (You'll still want to do the zRAM options above if you choose this method.)
Please let me know if you encounter any trouble or have any other questions and I will be more than happy to assist you!
Hello, @joknjokn -- I hope this update finds you well.
We have been working on this for you and tests are looking quite promising:
I am more than happy to help out with any of the above suggestions, simply let me know where you'd like guidance and I will provide what I can!
My best regards, Patrick
PS I am keeping this issue open while I tinker with things a bit more and will provide any updates here that could be helpful.
@mcguirepr89 , thank you so much! I hope to get time for it soon, but since I can't find my RPi3-fan (ordering new one), I can't try yet. If the RPi3 gives me too much trouble, I'll probably order a RPi4.
Also, I was actually inspired by your project and managed to make a Flutter-app (Android only at the moment) that uses the BirdNet-model and also runs "live" and collects the results, without saving recordings though. Kind of like a portable mini-version of yours. Not nearly done, and I'm unsure if it will be, but the live-BirdNet functionality is really fun!
Also, I was actually inspired by your project and managed to make a Flutter-app (Android only at the moment) that uses the BirdNet-model and also runs "live" and collects the results, without saving recordings though. Kind of like a portable mini-version of yours. Not nearly done, and I'm unsure if it will be, but the live-BirdNet functionality is really fun!
That's awesome! I don't have any Android devices (as much as I love me some Linux), otherwise I would be eager to check this out. Please feel invited to share that project on this page's Discussions if you'd like -- I think it sounds very cool.
I actually have been able to successfully integrate a live detection stream from the BMBF InnoTruck demonstration source code that can utilize the same TFLite pre-built binaries that BirdNET-Pi uses for BirdNET-Lite. The full stack offers a live audio stream, a live spectorgram, and photos, but I've only been able to get the live detections and photos to work properly. Please take a look here in hopes that you might be able to help out with getting this firmly integrated into BirdNET-Pi, for which I would be very grateful!!!
My best regards
Hello again -- I haven't had the time to work on this, so please let me know how it goes for you. I'm happy to help you figure out how to get the resource requests to match up to what the RPi3 can offer, but I didn't want you to expect more updates from me at this moment as I'm focused elsewhere for the time being.
My best, Patrick
Sorry, forgot to reply.
The flutter/android-project is too messy to share at the moment. I had to mess up a third tflite-plugin to get it to work.
Regarding BirdNet-PiRPi3, it's more of a "long term" project for me, with slow progress. I think my next step is to see if I can grab a cheap RPi4 at black friday, before I spend too much time experimenting. But thanks a lot for the help - I'm sure I'm not the only one interested in getting it to work on RPi3 also. Really appreciate the help :)
It may be worth considering the new Raspberry Pi 2 Zero W -- it has a comparable ARM processor to the RPi3B with less power-consumption and MUCH cheaper. If I could get BirdNET-Pi running on one of those, then we would be in pretty exciting territory being able to edge compute deep neural networks on a $15 computer!!
I'll certainly keep you posted on any headway I make for either device. Please accept my best regards -- Patrick
That's interesting. Also probably better for portability with powerbank+solar, if that's ever going to happen!
Also probably better for portability with powerbank+solar, if that's ever going to happen!
I surely hope someone has the resources and know-how to put that together -- it would be really exciting to Frankenstein a BirdNET-Pi that could live forever in the woods (like Frankenstein's real monster). :zombie:
HI, thanks for the hints. I tried to install without desktop and everything went fine. I also activated zram. But i cannot connect to http://birdnet.local I can connect via ssh from the same PC, but also the IP adress in the browser isn't showing something.
Thanks for the help
It is obviously working, but i cannot access the webpage
Hello, @gitalm and thank you so much for your interest in BirdNET-Pi. Sorry I wasn't able to get back to you yesterday, but it was Thanksgiving here in the US and I had a lot going on.
Running on a RPi3 is somewhat tricky due to resource constraints, but I'm happy to work with you on getting things working as best as possible.
To begin, I wanted to be sure you're attempting to access the correct web page. Your comment mentions not being able to reach the web interface at "http://birdnet.local," but the web interfaces is actually at http://birdnetpi.local -- notice the 'pi' tucked in between .local and birdnet.
Could you check for me to see if you are able to access the web interface at http://birdnetpi.local?
Thank you and I will be around today to help out as much as I can -- My best, Patrick
Hi, @gitalm -- I just wanted to follow up with you to see if you've had an opportunity to revisit the web interface at http://birdnetpi.local with any success?
Wishing you a great weekend, Patrick
Dear Patrick
it is working. I think i a problem with my USB Microphone. Is a microphone for the 3.5mm Jack not applicable?
Thanks for helping
But it is not processing any files. See attached screenshoot. What ca i do?
Could you show a screenshot of the "BirdNET-Lite Log" under "System Links"? That will likely tell a bit more about what is going on.
With that said, I believe the problem will be due to no audio data input. I suspect that the spectrograms are black? Please confirm this for me. This is because the 3.5mm audio jack that is built into the pi does not support audio input.
What I would recommend to see what is going on are the following, which I will describe better below.
birdnet_recording.service
To Temporarily stop the birdnet_recording.service
, issue:
sudo systemctl stop birdnet_recording.service
To Remove all of the recordings your system has created so far, issue:
rm -rfv ~/BirdSongs/November-2021/27-Samstag/*
To *Grab some extracted sound files from @CaiusX's installation to populate today's directory on your system, find a sound from a bird that has a very high confidence score (they're embedded in the file name, so you can sort by file name to get a file with a high confidence score) and right-click the file to save it. Place it in the /home/pi/BirdSongs/November-2021/27-Samstag/
. Once the file is there, the birdnet_analysis.service
should find it and start analyzing almost immediately.
*Note: @CaiusX's installation is set for very different latitude and longitude than you are likely to have, so your system might not have the best chance of making a detection with exotic sounding birds. If using one of those files does not lead to a detection, we should still see it at least get processed successfully, so the test is not worthless.
**Note also that the RPi3 cannot keep up with realtime running all services, so you will still see files accumulate where the same installation will have no more than 2-3 files at a time on an RPi4.
OR
To Plug in a USB audio input device for testing, simply plug in the new device and navigate to the "Tools" link under "System Links," enter the user birdnet
and the password you configured for the web interface. Then press the "Restart Recording Service" button.
After those things, Watch the "BirdNET-Lite Log" found under "System Links" on http://birdnetpi.local to see if recordings are being analyzed.
I'll be out for the rest of the day, but I will certainly respond as soon as I have the chance.
Sorry for the delay. Sometimes the RPi3 Server is not accesible
Seems like Tensorflow has a problem
I installed Tensorflow for Python 3.9 with the following command,
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
and then the next issue appeared
I have also some issues about analyze.py
First mysql.connector was missing
pip install mysql.connector
But i can load the model
But the Error still is there (You can see the log from the webinterface and a bash from the RPi logged in via ssh)
Hi, @gitalm. I can shed a lot of light on what you are seeing and hopefully you'll have a better understanding of how BirdNET-Pi is put together.
Before anything, though, I will need you to verify with no uncertainly that you are using the ARM64 version of RaspiOS built on Debian Bullseye that can only be found here. Please don't continue troubleshooting until you can be sure that you are using the 64-bit version of the OS.
I installed Tensorflow for Python 3.9 with the following command, python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl and then the next issue appeared
This method, although it does not fail, does not install the site packages where BirdNET-Pi needs them to be. BirdNET-Pi's services utilize a python venv that is specifically built for the services. Also, that version of Tensorflow is not what is needed here and will not work. You will need to use the pre-built TFLite binaries that are included in the wheels in the BirdNET-Pi directory:
With that in mind, you can understand why your later interactions with the OS's site-packages seemed to indicate that those site-packages are not installed on the system . . .
I have also some issues about analyze.py First mysql.connector was missing pip install mysql.connector But i can load the model . . .
They are installed, but need to be accessed from within the 'birdnet' python venv located in the BirdNET-Pi directory. To activate the appropriate python virtual environment, you will need to issue source ~/BirdNET-Pi/birdnet/bin/activate
.
From that venv prompt, your pip
interactions will actually be affecting the correct site-packages. Issue pip list
to see the site-packages that BirdNET-Pi will actually be using.
Before we troubleshoot too much more, could you please relay to me your installation procedure?
My best
Thanks for all your help i followed the instructions from Headless installtion, but didn't avtivated the VNC and used ssh instead. I installed a Lite version from https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2021-11-08/2021-10-30-raspios-bullseye-arm64-lite.zip I wanted to use as less services as available, to get enough speed. After that i increased the Z-Ram by 2G like described above.
I also had to install bc seperatedly, because there was a failure inside the Log from the website.
sudo apt install bc
The source
command didn't work out
I'm happy to help and appreciate you trying to get this up and running on the Lite version of the OS. I used to only run things on the Lite version for my personal installations, but have done a lot of developing since then and it seems like there may be some dependency issues when using Lite now. Thank you for your help in pin pointing those things for me and others.
I'm scratching my head on how to best investigate what is going on. Not having the "activate" file in the python venv does not make sense to me, so I can only conclude that there were some glaring errors during installation that need to be addressed.
Is there any chance you would be willing to host a remote desktop session via AnyDesk on the device you are using to access the BirdNET-Pi via SSH?
I would really like to take a look through some logs and basically redo the installation while increasing the installer's verbosity.
If a remote session is out of the picture, I can recommend the following, which is what I would personally do:
/home/pi/BirdNET-Pi/scripts/uninstall.sh
to remove everything that has been installed so farrm -drfv /home/pi/BirdSongs
to remove the data directorycp ~/BirdNET-Pi/birdnet.conf-defaults ~/BirdNET-Pi/birdnet.conf
to create a new, generic birdnet.conf
birdnet.conf
to NOT select NoMachine installation and go ahead and set your Latitude and Longitudeinstall_birdnet.sh
and install_services.sh
scripts. Near the top of each script, there is a line for debugging:
. . .
# set -x
. . .
Remove the '#' to enable debugging.
/home/pi/BirdNET-Pi/scripts/install_birdnet.sh
Very carefully examine the installation for any errors to investigate further.
Again, I'm more than happy to take a look myself with AnyDesk -- this information is quite valuable to me, so either way I appreciate your persistence.
My best
I had another thought: You may try using the pre-installed Beta image, which we know works, and then disable the desktop environment and all of its services by changing the system's default target. You would still need to enable the zRAM, but you know how to do that.
To use the pre-installed image and then disable the graphical.target:
sudo systemctl set-default multi-user.target
to disable the desktop for all subsequent sessions.sudo sed -i 's/ExecStart=.*/ExecStart=echo/g' /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
to fix a bug with the image.
Let me know if you would like to pursue this option and/or if you have any questions about the process.
Dear Patrick, thanks for your help. I have two problems. I reinstalled the whole with the version mentioned in the Headless Installation and did exactly all steps. The Problem remains
I would try to use you 0.9 image, but the server is not found at the moment.
Do try once more
Dear Patrick,
i could now download your image and installed it on the RPi3. I can connect to the WIFI, but i cannot reach the RPi, neither SSH nor VNC (see screenshot) Is there another password?
Best wishes Johannes
That "BirdNET-Pi_v0.9" access point is the way into the system. Could you please show me what kind of error you are seeing when trying to connect with VNC and with SSH?
Also, be sure you wait the 5-7 minutes after the first boot for initial configuration.
Dear Patrick,
today my RPi 4 arrived and it is working. My problem with the RPi 3 was, that i used RPImager and set automatically a password. Thanks for the .0.10 version. Will try RPi3 soon, just need another SD Card.
That's great news! I just got a new job that starts Monday, so I will get myself a RPi3 in the next couple of months and will be able to do much more thorough testing for that model.
May I ask where your BirdNET-Pi will be listening?
My BirdNetPi should listen at lake of chiemsee https://www.openstreetmap.de/karte.html?zoom=12&lat=47.86819&lon=12.45941&layers=B00TT I'm really excited
Very exciting!! You'll have a lot of great results, I'm sure!
I hope you might consider making the installation public (if it will have internet access out there)
Also, it would be wonderful if you would consider contributing your data to https://app.birdweather.com
You can see my installation in Charlotte, North Carolina, United States (it's the green circle on the Eastern coast of the United States) to get an idea of how your installation will contribute data.
If you are interested, please email Tim to request a BirdWeather ID (which you will then simply input in birdnet.conf
to start using) -- "thewebsite.com" is "birdweather.com" and you can reach Tim via email at "hisname"@"thewebsite.com" (trying to obscure the email address from site-crawlers).
Thanks again for installing BirdNET-Pi!! :)
Dear Patrcik,
it is running with a RPi3!!!!! Thanks for your patience and help
@gitalm Great! Would share an installation/setup guide for the RPi3? :)
Let me know how it performs compared to the RPi4!
I do my best. But the installation was just the same with your image 0.10.
I changed now zram and gonna try both systems.
How can i measure this? htop
I changed now zram and gonna try both systems.
The zRAM swapping will be a big help
How can i measure this?
The easiest way to compare the two would be only run one system at a time and compare the ANALYZING AUDIO... DONE! Time FLOAT SECONDS
and birdnet_analysis.service: Consumed TIME(s) CPU time
lines in the "BirdNET-Lite Log" page.
Do this for each (after configuring zRAM for the RPi3):
systemd
as to how much time the service used the CPU. It will look something like this:
...
Date-time: 2021-12-12 10:57:43
ANALYZING AUDIO... DONE! Time 1.6 SECONDS <----------------------------- This line
WRITING RESULTS TO /home/pi/BirdSongs/December-2021/12-Sunday/2021-12-12-birdnet-10:57:43.wav.csv ... DONE!
WROTE 0 RESULTS.
('Junco hyemalis_Dark-eyed Junco', 0.09362676)
('Junco hyemalis_Dark-eyed Junco', 0.20422241)
('Junco hyemalis_Dark-eyed Junco', 0.08576561)
('Dryobates borealis_Red-cockaded Woodpecker', 0.11782787)
('Euphagus carolinus_Rusty Blackbird', 0.08103995)
Database Entry
Database Entry
Database Entry
Database Entry
Database Entry
birdnet_analysis.service: Succeeded.
birdnet_analysis.service: Consumed 7.923s CPU time. <-------------------- This line
birdnet_analysis.service: Scheduled restart job, restart counter is at 19141.
Stopped BirdNET Analysis.
birdnet_analysis.service: Consumed 7.923s CPU time.
Started BirdNET Analysis.
Sun 12 Dec 2021 10:58:07 AM EST
Starting run_birdnet() for December-2021/12-Sunday
get_files() for December-2021/12-Sunday
Files loaded
Starting move_analyzed() for December-2021/12-Sunday
Moving analyzed files to new directory
Starting run_analysis() for December-2021/12-Sunday
...
Do that on both and compare that value and we'll have a decent idea of how their core function compare to one another
Also, take a look at this for how you can run both BirdNET-Pis on the same network at the same time. My instructions above specify only having one system on the network at a time, but it is certainly possible for them to co-exist on your network by setting up DHCP reservations on your router and configuring the BIRDNETPI_URL
in birdnet.conf
to use their respective LAN IP addresses.
Dear joknjokn,
i followed the instruction from Patrick To use the pre-installed image and then disable the graphical.target:
sudo systemctl set-default multi-user.target
to disable the desktop for all subsequent sessions.sudo sed -i 's/ExecStart=.*/ExecStart=echo/g' /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
sudo raspi-config
to change the password 1 System Options -> S3 Password
5 Localisation Option -> L1 - L4
for your countrybirdnet-pi-config
System Options -> Configure zRAM
It looks like your steps above might be omitting running through the graphical BirdNET-Pi Configuration Wizard before disabling the graphical.target
?
But still there is a small problem with my RPi3 My Audio is not recognized, although it is the same software
Hmm that is very weird?
what is your output for aplay -L
?
null
Discard all samples (playback) or generate zero samples (capture)
default
Playback/recording through the PulseAudio sound server
lavrate
Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
Rate Converter Plugin Using Samplerate Library
speexrate
Rate Converter Plugin Using Speex Resampler
jack
JACK Audio Connection Kit
oss
Open Sound System
pulse
PulseAudio Sound Server
upmix
Plugin for channel upmix (4,6,8)
vdownmix
Plugin for channel downmix (stereo) with a simple spacialization
hw:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Hardware device with all software conversions
sysdefault:CARD=Headphones
bcm2835 Headphones, bcm2835 Headphones
Default Audio Device
dmix:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct sample mixing device
usbstream:CARD=Headphones
bcm2835 Headphones
USB Stream Output
hw:CARD=E205U,DEV=0
Superlux E205U, USB Audio
Direct hardware device without any conversions
plughw:CARD=E205U,DEV=0
Superlux E205U, USB Audio
Hardware device with all software conversions
sysdefault:CARD=E205U
Superlux E205U, USB Audio
Default Audio Device
front:CARD=E205U,DEV=0
Superlux E205U, USB Audio
Front output / input
surround21:CARD=E205U,DEV=0
Superlux E205U, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=E205U,DEV=0
Superlux E205U, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=E205U,DEV=0
Superlux E205U, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=E205U,DEV=0
Superlux E205U, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=E205U,DEV=0
Superlux E205U, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=E205U,DEV=0
Superlux E205U, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=E205U,DEV=0
Superlux E205U, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=E205U,DEV=0
Superlux E205U, USB Audio
Direct sample mixing device
usbstream:CARD=E205U
Superlux E205U
USB Stream Output
hw:CARD=vc4hdmi,DEV=0
vc4-hdmi, MAI PCM i2s-hifi-0
Direct hardware device without any conversions
plughw:CARD=vc4hdmi,DEV=0
vc4-hdmi, MAI PCM i2s-hifi-0
Hardware device with all software conversions
sysdefault:CARD=vc4hdmi
vc4-hdmi, MAI PCM i2s-hifi-0
Default Audio Device
hdmi:CARD=vc4hdmi,DEV=0
vc4-hdmi, MAI PCM i2s-hifi-0
HDMI Audio Output
dmix:CARD=vc4hdmi,DEV=0
vc4-hdmi, MAI PCM i2s-hifi-0
Direct sample mixing device
usbstream:CARD=vc4hdmi
vc4-hdmi
USB Stream Output
try issuing alsamixer
-- it should appear like this
Then press F6
so that it brings up a list like this:
and see if your sound card is listed there. If so, choose it and then press F4
to view the "capture" devices associated with the sound card.
All works here
Then I'm not quite convinced that there is an issue with the sound yet -- it looks like we might just have services that haven't been started.
Let's try these things and let me know what you see:
restart_services.sh
journalctl -n10 --no-pager -u birdnet_recording.service
journalctl -n30 --no-pager -u birdnet_analysis.service
journalctl -n30 --no-pager -u livestream.service
Thanks, it helps and it started recognizing
My pleasure! I really appreciate you experimenting with BirdNET-Pi on the RPi3 -- looking forward to learning your results!
RPi3 with 2G zRAM with that file https://xeno-canto.org/sounds/uploaded/BLMSIUFTFU/XC690635-200614_1865-3.30_TM-%C5%9Bp_KampPN.mp3
RPi4 with the same sound and the same microphone without zRAM
Yep it looks like the RPi3 is a bit backed up, even with the desktop disabled.
Some other things to try:
sudo systemctl disable --now livestream icecast2
You can tell analyze.py
to use more threads for the analysis by editing this part of /home/pi/BirdNET-Pi/analyze.py
:
...
print('LOADING TF LITE MODEL...', end=' ')
# Load TFLite model and allocate tensors.
interpreter = tflite.Interpreter(model_path='model/BirdNET_6K_GLOBAL_MODEL.tflite',num_threads=2)
interpreter.allocate_tensors()
...
Change num_threads=2
to num_threads=4
...
print('LOADING TF LITE MODEL...', end=' ')
# Load TFLite model and allocate tensors.
interpreter = tflite.Interpreter(model_path='model/BirdNET_6K_GLOBAL_MODEL.tflite',num_threads=4)
interpreter.allocate_tensors()
...
So long as you are confident that the power-supply is adequate, you can also try overclocking the system. Be aware, though, that if this fails, the image won't boot until you fix things, which isn't difficult, but if it's you're first time doing it, it can seem like a real nuisance.
To overclock the RPi3, edit the /boot/config.txt
file, and add these lines:
arm_freq=1500
over_voltage=4
and sudo reboot
To see the overclocking and ensure that there is no over-voltage warnings, I put together a small tmux pane that displays clock speed info and voltage "throttling" -- anything other than "throttled=0x0" is unacceptable: The new image has an old tmux, so run this to see the pane properly:
sudo rm /usr/local/bin/tmux
sudo apt -y install tmux
/usr/bin/tmux
Those commands "fix" the broken tmux, so after it's fixed, (in subsequent shell sessions), you'll just be able to call tmux
to see those values.
If all goes well, just increase the clock value gradually. But don't try to exceed 1750, as you most certainly won't boot at that point . . . I don't think.
If after overclocking you find your pi won't boot, put the SD card in an SD card reader and insert it into your laptop/PC and edit that same /boot/config.txt
file back to whatever you know worked.
I tested with your values
I'm afraid arm_freq=1300 will actually throttle the arm, since its default clock speed is 1400 -- I may be wrong about that, but that is my understanding
On Sun, Dec 12, 2021 at 3:34 PM gitalm @.***> wrote:
I tested with your values
- i have a fan for RPI3
- stopped icecast
- increased to 4
- added arm_freq=1300 core_freq=500 sdram_freq=500 over_voltage=2
[image: grafik] https://user-images.githubusercontent.com/7422149/145728614-d0a3bab7-6c5b-4949-8ab4-d9ed5c9fd2e9.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mcguirepr89/BirdNET-Pi/issues/66#issuecomment-991965871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMH3EDB4RCPMRNGKAC5FGLUQUBPDANCNFSM5HP53JRA .
Hi,
I'm wondering if you think this could run on RPi 3? If so, would it require difficult changes?
Thanks!