BirdNET-Pi behind a reverse proxy #92
-
Is it possible to disable or bypass the .local function? I guess this is the cause of the problem I have. I have several other web servers in my network and therefore use reverse proxy in my Synology NAS to direct calls from the Internet correctly, because in the router you can only control calls on one port to a specific server. This function requires that you enter an IP address and port number on the local network, a regular URL is not accepted. I have tried to enter both IP address and regular URL in the BirdNET-Pi configuration, but nothing works. So what I want is for the web server to respond to the local IP address instead of birdnetpi.local. I hope there is a solution to this. |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 13 replies
-
Hello, @Svardsten53 and thank you so much for you interest in BirdNET-Pi and for your great question. I actually was just helping another user with a similar scenario to allow for several BirdNET-Pis on the same local network. Please take a look through that conversation if you'd like to see how that worked out, though that is just for reference and not me pointing you elsewhere :)
BirdNET-Pi's announce themselves on the network via an avahi-alias for "birdnetpi.local" that allow mDNS allowed networks to find it easily. It can easily be disabled by issuing The "problem" is actually a great security feature of Caddy's wherein caddy only listens and responds to its site-blocks and ignores requests to the underlying host's open ports when the requests don't match the site block. This means we just need to tell Caddy that is should listen for requests to the host's local IP. The
It seems you came quite close to the solution and had precisely the right idea on how to achieve what you need, with one crucial step missing: updating BirdNET-Pi after altering the
then issue Be sure to clear your web browser's cache so that it does not load old, broken links. Please let me know how this works for you and if you have further questions or would like any further assistance as I am more than happy to help! My best regards, |
Beta Was this translation helpful? Give feedback.
-
Patrick, thanks for your quick reply. I'm much closer the solution now I hope. I have still problem when typing the URL which is defined in the reversed proxy to port 80 on the Pi, the only thing I get is a white page. The strange thing is if i point the proxy to port 8000 I can see the Icecast2 status page. I have not modified anything in the .local settings. Update is done after every change. Settings in config file:
The caddy file looks like this:
The caddy log from the last update:
|
Beta Was this translation helpful? Give feedback.
-
Hello again!
This bit seems to point to the remaining issue, which is again tied to the aforementioned Caddy listening rules wherein it will only respond to requests that match its site-block definitions. This means that you'll need to add whatever URL is defined in your reverse proxy to the Caddyfile's main site-block. Also, you will want to change your CADDY_PWD since it was posted here (though it was hashed, it was not encrypted -- I did however, remove the original comment with the password).
I suspect that will work, but without knowing more specifics (that you should not post here) about how you're trying to route the traffic, and more specifically, what the request headers contain, I can only say that is my best guess as to what will work. Unfortunately, the caddy logs you've provided only show a successful caddy reload, which is a good thing and indicates that there are no issues on Caddy's end, but doesn't contain any requests/responses. If you'd like more help, please consider emailing me privately so as not to share sensitive networking information here. My fingers are crossed for you and I hope it works 👍 |
Beta Was this translation helpful? Give feedback.
-
A big thank you to Patrick for the quick response and clear and informative instructions and of course for a very nice program. Now we have made it work! In the end, it was pretty simple.
In birdnet.conf:
In my reverse proxy I forwarded incoming HTTPS traffic on port 443 for the current subdomain to HTTP 192.168.0.106 on port 80. Case closed and I hope that others can also benefit from these instructions in the future. Best regards from a retired mainframe guy who has now entered the Linux world. |
Beta Was this translation helpful? Give feedback.
-
I read that article a few days ago and it really is a good help to get started. I have had some domains for several years now and enjoy creating things on the Internet. I live 20 km outside Stockholm in Sweden. Right now it's not so much birds because it's winter. My plan is to mix two microphones, a omnidirectional and a shotgun microphone to cover both the ground and the sky to also detect migrating birds. |
Beta Was this translation helpful? Give feedback.
-
Thank you Patrick for the detailed description. Caddy seems to know a lot and I will gladly study it in the future. Right now I just want to make it work and use the solution I already have. When I rebooted my Pi I was back to the white page in my browser, but since I now know from your description that Caddy uses parameters in the config file, it was possible to fix, as long as you did things in the right order. This is what the URL configuration looks like now and the result in the Caddy file.
The microphone is now connected, the sound card configured and I get spectrograms. However, I have an error message, but open a separate ticket for it to keep things separate, unless I find the solution myself. Thanks a lot for all your help! |
Beta Was this translation helpful? Give feedback.
-
yes, Dundee. I do get some bizarre annotations, eg a great bittern which is very rare and not found in Scotland at all. Looking forward to what tomorrow’s dawn chorus brings.
I’m hoping to persuade the University to put some in the botanic gardens.
..d
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Patrick McGuire ***@***.***>
Sent: Thursday, December 30, 2021 6:37:42 PM
To: mcguirepr89/BirdNET-Pi ***@***.***>
Cc: David Martin (Staff) ***@***.***>; Comment ***@***.***>
Subject: Re: [mcguirepr89/BirdNET-Pi] BirdNET-Pi behind a reverse proxy (Discussion #92)
CAUTION: This email originated from outside the University of Dundee. Do not click links or open attachments unless you recognise the sender's email address and know the content is safe.
I'm very glad to hear that you're up and running. Am I safe in assuming that your BirdNET-Pi will be listening in Scotland?
—
Reply to this email directly, view it on GitHub<#92 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAOH7JQ7VAG6B2DVJM6MQCTUTSRHNANCNFSM5JOZOWGQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID: ***@***.***>
The University of Dundee is a registered Scottish Charity, No: SC015096
|
Beta Was this translation helpful? Give feedback.
-
Dear Patrick,
Thank you so much for the detailed info. I'll definitely tweak the settings and see what I can do with them. I'll take a look through the species labels and build a regional list. There are great regional variations within UK, let alone Europe so I will need to do some curation there.
I have some experience with using ML approaches in bioinformatics, though little in actually implementing tensorflow models. Our University is big on impact and we are partnering with the Eden Project in bringing their first site outside Cornwall to Dundee. As part of that there is lots of opportunity for engagement and student learning, and this fits in very nicely.
Best wishes
..d
Dr David Martin
Senior Lecturer in Bioinformatics
College of Life Sciences
University of Dundee
…________________________________
From: Patrick McGuire ***@***.***>
Sent: 31 December 2021 14:47
To: mcguirepr89/BirdNET-Pi ***@***.***>
Cc: David Martin (Staff) ***@***.***>; Comment ***@***.***>
Subject: Re: [mcguirepr89/BirdNET-Pi] BirdNET-Pi behind a reverse proxy (Discussion #92)
CAUTION: This email originated from outside the University of Dundee. Do not click links or open attachments unless you recognise the sender's email address and know the content is safe.
yes, Dundee.
Very cool! I'm glad to have Scotland represented!
I do get some bizarre annotations, eg a great bittern which is very rare and not found in Scotland at all. Looking forward to what tomorrow’s dawn chorus brings.
You will definitely encounters some false positives, but I would encourage you to take a look at this comment<#11 (comment)> and the discussion around it for some erudite methods of tuning the BirdNET-Pi.
Within birdnet.conf, you will find a few parameters that you can adjust to mitigate false positives. These settings will alter your detections significantly. The variables that you may be interested in are CONFIDENCE and SENSITIVITY.
To quote a wonderful avian acoustic expert, Frank @DD4WH<https://github.com/DD4WH>:
". . . if you would like to lower the number of false positives, it would be much better to reduce SENSITIVITY (and thus increase specificity) of the classifier model by lowering the sensitivity parameter. If there are still too many false positives after that, you can then increase the minimum CONFIDENCE score.
Making those adjustments and utilizing the data visualization tools on the BirdNET-Pi webpage will certainly help with discerning false positives, but will also allow for detecting very rare occurrences of species that are deemed atypical.
Another tools you may utilize is a custom_species_list.txt. Using the labels.txt file found in /home/pi/BirdNET-Pi/model, you can curate your own list of species for monitoring. Simply selecting the species from labels.txt and pasting them into another file called custom_species_list.txt that you keep in the /home/pi/BirdNET-Pi directory will only report detection results from species found therein. If I'm not mistaken, Frank @DD4WH<https://github.com/DD4WH> has put together a list of European species he may be able to share with you -- (sorry, Frank, for not keeping up with that!!!)
I'm hopeful that the info above will allow you to adjust your system enough to meet your needs.
One last important note on mitigating false positives: BirdNET-Pi is fully integrated with BirdWeather<https://app.birdweather.com> (you can even see how the integration took place here<#82>), which uses e-Bird grid data during post-processing to drastically lower confidence scores for rare and unlikely species, while increasing the confidence score for common and likely species.
To see how the same data is reported differently on the BirdNET-Pi and within BirdWeather, take a look at @CaiusX<https://github.com/CaiusX>'s installation here<https://birds.naturestation.net>, and then locate his installation in Johannesburg, South Africa on the BirdWeather Map<https://app.birdweather.com>.
With all of that said, I hope you will be willing to reach out to Tim ( ***@***.*** ) <--- trying to obfuscate the actual email address from internet crawlers, but replace the DOT with a . and hisname with Tim. I hope you will reach out to him with your Latitude, Longitude, and a general location for the station label so that he can provide you with a unique BIRDWEATHER_ID. When you receive your BirdWeather ID, simply input it as the BIRDWEATHER_ID within birdnet.conf (no quotes or anything, just paste it next to the = sign) and your subsequent detections will be shared with the rest of the world!
And finally,
I’m hoping to persuade the University to put some in the botanic gardens.
This is very exciting news. PLEASE allow me to help in any way that I can. BirdNET-Pis install NoMachine remote desktop software by default, so if any scenario comes up for which you would like another set of eyes, or need to recover valuable data, please don't hesitate to let me know as I am eager to help and equally want to persuade the University to put some in the botanical gardens!
My very best regards,
Patrick
—
Reply to this email directly, view it on GitHub<#92 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAOH7JUB22RBIZEC4B2GHU3UTW67XANCNFSM5JOZOWGQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID: ***@***.***>
The University of Dundee is a registered Scottish Charity, No: SC015096
|
Beta Was this translation helpful? Give feedback.
-
Your star count has gone up by 1!
I have started the wheels in motion on this. I might be able to get an honours student next September to work on it as well - I'll have to push the Machine Learning in biology side and treat it as a particular type of thesis project.
..d
Dr David Martin
Senior Lecturer in Bioinformatics
College of Life Sciences
University of Dundee
…________________________________
From: Patrick McGuire ***@***.***>
Sent: 31 December 2021 15:10
To: mcguirepr89/BirdNET-Pi ***@***.***>
Cc: David Martin (Staff) ***@***.***>; Comment ***@***.***>
Subject: Re: [mcguirepr89/BirdNET-Pi] BirdNET-Pi behind a reverse proxy (Discussion #92)
CAUTION: This email originated from outside the University of Dundee. Do not click links or open attachments unless you recognise the sender's email address and know the content is safe.
This is very exciting and wonderful to know. I do hope you will pass along my willingness to help to any students interested in using BirdNET-Pi for their projects. I have helped a few students at the Technical University in Denmark and would be honored to continue making contributions to anyone else eager to learn. As a selfish reminder, please do Star the project should you decide to use it, as I would be very, very grateful and its my best indication of how many github users are using a BirdNET-Pi.
My best regards as always!
Patrick
—
Reply to this email directly, view it on GitHub<#92 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAOH7JV3TKAKKLWLCWBUCLLUTXBWNANCNFSM5JOZOWGQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID: ***@***.***>
The University of Dundee is a registered Scottish Charity, No: SC015096
|
Beta Was this translation helpful? Give feedback.
-
It seems to be running just fine, though my powerline network has been a bit flaky. There are a small number of false positives – I have the settings at a threshold 0.75 and the sensitivity at 1.25, so mostly out of the box.
Quite happy with it so far. I have a few others keen to set one up but there are supply issues with Raspberry Pi at the moment.
..d
From: Patrick McGuire ***@***.***>
Sent: 11 January 2022 13:04
To: mcguirepr89/BirdNET-Pi ***@***.***>
Cc: David Martin (Staff) ***@***.***>; Mention ***@***.***>
Subject: Re: [mcguirepr89/BirdNET-Pi] BirdNET-Pi behind a reverse proxy (Discussion #92)
CAUTION: This email originated from outside the University of Dundee. Do not click links or open attachments unless you recognise the sender's email address and know the content is safe.
Greetings, @davidmam<https://github.com/davidmam>! I hope this finds you well.
I just wanted to check in with you to see how you are doing and see what your thoughts are after running your BirdNET-Pi for a little over a week. I have enjoyed checking in on your station via BirdWeather<https://app.birdweather.com> :)
My best regards and a belated Happy New Year!
Patrick
—
Reply to this email directly, view it on GitHub<#92 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAOH7JXBGCMTRVGLVOYHKZLUVQTEBANCNFSM5JOZOWGQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
The University of Dundee is a registered Scottish Charity, No: SC015096
|
Beta Was this translation helpful? Give feedback.
-
I was listening back to the Great Bittern calls. Sounds like a small heron with a 4 litre diesel engine 🙂 I have the microphones on the back of my garage, right next to a busy road and traffic lights so get a lot of that diesel vehicle rumbling. It would be helpful to have an exclude list rather than an include list.
..d
Dr David Martin
Senior Lecturer in Bioinformatics
College of Life Sciences
University of Dundee
…________________________________
From: Patrick McGuire ***@***.***>
Sent: 11 January 2022 14:14
To: mcguirepr89/BirdNET-Pi ***@***.***>
Cc: David Martin (Staff) ***@***.***>; Mention ***@***.***>
Subject: Re: [mcguirepr89/BirdNET-Pi] BirdNET-Pi behind a reverse proxy (Discussion #92)
CAUTION: This email originated from outside the University of Dundee. Do not click links or open attachments unless you recognise the sender's email address and know the content is safe.
I'm very glad to hear that you are happy with (mostly) default settings. Learning what false positives your installation will trigger is part of the fun!! and will help you in tuning settings to your needs in Dundee.
I've heard from others that the RPi shortage is a real barrier for Europe right now. My fingers are crossed that the supply will start to reflect the demand and that you and others will have more ease getting your hands on these great tools sooner than later.
My kindest regards,
Patrick
—
Reply to this email directly, view it on GitHub<#92 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAOH7JRN5GO5Z22L4LP2DUDUVQ3KVANCNFSM5JOZOWGQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
The University of Dundee is a registered Scottish Charity, No: SC015096
|
Beta Was this translation helpful? Give feedback.
Hello again!
This bit seems to point to the remaining issue, which is again tied to the aforementioned Caddy listening rules wherein it will only respond to requests that match its site-block definitions. This means that you'll need to add whatever URL is defined in your reverse proxy to the Caddyfile's main site-block. Also, you will want to change your CADDY_PWD since it was posted here (though it was hashed, it was not encrypted -- I did however, remove the original comment with the password).
You can change the password easily by changing it in
…