-
-
Notifications
You must be signed in to change notification settings - Fork 140
Sharing Your BirdNET Pi
Anyone interested in sharing their BirdNET-Pi installation with friends, colleagues, and the whole rest of the world can use this as a reference for setting up their own previously-purchased custom domain name OR a new, totally free hostname from NoIP.com to do just that!
This guide has two sections: one for those who have a static public IP address, and one for the rest of us (i.e., you have a dynamic public IP address).
- How to create a DHCP reservation for BirdNET-Pi and how to forward ports on your router
- Your public IP address, and whether it is static (always stays the same) or dynamic (it does not stay the same)
- - If you are unsure whether your public IP address is static or dynamic, it is probably dynamic. You usually have to request (and pay extra for) a static IP address from your ISP.
- - To find out the BirdNET-Pi's public IP address at any given time, go to "Tools" > "System Info" and scroll down to the "Viewer" section wherein you will find the "Public IP:" listed.
- If you own your own domain name, how to register an A record and a CNAME record with your domain registrar
In your home router settings, there are two settings/configuration options we need to utilize: DHCP reservations, and Port Forwarding/Redirection.
DHCP is the protocol that allows all of the hosts on the network to defer to one source on the network (the router) for configuration. It handles things like issuing newly connected devices available IP addresses, configures the DNS/gateway and subnet masking for the host, and identifies special servers/resources on the network, like printers, network attached storage, or network booting (tftp) file servers.
We need to tell DHCP that BirdNET-Pi wants to permanently reserve an IP address so that no other devices on the network will ever be issued that IP address. This will allow the network to reliably count on birdnetpi (the hostname) always resolving to the same IP address, and that that IP address will always point to BirdNET-Pi (the device).
Consult your router's manual for how to set a DHCP reservation. It doesn't matter what IP address is reserved, so long as a reservation exists. (If you are absolutely sure that your router does not support DHCP reservations, you can configure the BirdNET-Pi to use a static IP address. I will not document those steps here.)
- Note:If you are able to track down the page for port forwarding but not for setting up DHCP reservations, don't worry. If you have the ability to utilize port forwarding, but cannot configure DHCP reservations, it means the router is doing it for you in the background.
Port forwarding is the process of configuring the router to forward requests it receives on a specific port --ports 80 and 443 in our case-- to a specific host on the network --'birdnetpi' (hostname) in our case.
+--------+
| |
| User |
| |
+--------+
|
| Makes a web request
| to your home network
| to port 80 (http) or
| to port 443 (https)
V
+-----------+ +--------------------+ +--------------------+
| Modem | | Router with port | forwards requests | BirdNET-Pi |
|(Public IP)|---->| forwarding rules |-----------------> | listening on ports |
+-----------+ | for ports 80, 443 | to BirdNET-Pi | 80 and 443 |
| to BirdNET-Pi's IP | | (Internal IP) |
+--------------------+ +--------------------+
If you have a static IP address, this will be easy for you. There are basically 2 steps to complete after the steps above, though they differ depending on whether you own a domain or not.
- Set an A record for your domain named "@" that points to your static public IP address.
- Use a DNS lookup tool, (this works well enough), to be sure that your domain resolves to your IP address BEFORE you move onto Step 2, else Step 2 will not work.
- Using the web interface, go to "Tools" > "Settings" > "Advanced Settings"
- Input a Webpage password under "BirdNET-Pi Password"
- Input your domain in the BirdNET-Pi URL under "Custom URL" (NO TRAILING SLASHES)
- Click "Update Settings" and wait about 20 seconds and then go to your domain's URL.
If your Internet Service Provider or LTE Carrier issues your network a dynamic public IP address, hosting public web services becomes very difficult to manage. What is available one day is suddenly not reachable the next and you would have to reconfigure all of your DNS records each time to fix things again.
The most elegant solution to that problem that I have discovered so far is NoIP.com, which uses a small piece of client software to update the DNS records anytime the ISP issues the BirdNET-Pi's network a new public IP address.
DDNS=Dynamic Domain Name Server (https://noip.com)
DUC=Dynamic Update Client (on the BirdNET-Pi)
- The ISP/LTE Carrier issues a new public IP address to the Modem/Router.
- The DUC running on the BirdNET-Pi detects the change and sends an update to the DDNS that it has a new IP address.
- The DDNS updates its A record so that requests to "http://birdnetpi.ddns.net" resolve to the newly updated IP address.
IP=Public IP Address
+-----------------------------------+
| |
| Dynamic Domain Name Server |
| No-IP hostname entry for |
| birdnetpi.ddns.net: |
|"A" record target ->172.73.170.186 |
| | +---------------+
+-----------------------------------+<----->| Internet |
^| |ISP/LTE Carrier|
|| DDNS directs all +---------------+
DUC updates DDNS || requests to |
when IP changes || birdnetpi.ddns.net | ISP or LTE carrier
|| to 172.73.170.186 | issues DHCP IP to
|v | modem or router
+-----------------------------------+ v
| | +----------------+
| BirdNET-Pi | | Router/Modem |
| Public IP=172.73.170.186 |<----->|Passes its IP to|
| [ Running DUC ] checks every Nmin | |the rest of the |
| Hostname=birdnetpi.ddns.net | | network |
| | +----------------+
+-----------------------------------+
- Go to https://noip.com and sign up for a free account. Go through all of the registration procedures, that is to say, confirm the account through the email account confirmation link.
- Directly from NoIP.com's Dashboard, use the Quick Add box to create a new Hostname. Select any Domain from the list and leave the Record Type to A.
- Using the navigation panel on the left side of the NoIP web page, select Dynamic DNS--->No-IP Hostnames. Ensure the IP/Target value for the Hostname points to your current public IP address. (See the second sub-bullet from 'What You Should Know First' if you don't know this value.)
- Create 1 CNAME record for the domain you own that points to the No-IP hostname you setup in the step above.
- Use a DNS lookup tool to be sure that your NoIP Hostname resolves to your IP address and that the CNAME for the domain you own which points to the NoIP Hostname resolves BEFORE you move onto the next steps.
- Using the web interface, go to "Tools" > "Settings" > "Advanced Settings"
- Input a Webpage password under "BirdNET-Pi Password"
- Input your domain in the BirdNET-Pi URL under "Custom URL" (NO TRAILING SLASHES)
- Click "Update Settings" and wait about 20 seconds and then go to your domain's URL.
- Run BirdNET-Pi's included DUC installation script,
sudo ${HOME}/BirdNET-Pi/scripts/install_noip2.sh
. - When prompted, enter the email address and password that you use as login credentials for noip.com.
- Set the update interval to 5 (minutes)
- Answer "no" when asked if any scripts should be run when a new IP is detected.
- This script runs in the background and will update the NoIP.com hostname A record any time a change is detected in BirdNET-Pi's public IP address, which will ensure that all requests to your domain resolve to the BirdNET-Pi's current public IP address.
- Go to https://noip.com and sign up for a free account. Go through all of the registration procedures, that is to say, confirm the account through the email account confirmation link.
- Directly from NoIP.com's Dashboard, use the Quick Add box to create a new Hostname. Select any Domain from the list and leave the Record Type to A.
- Using the navigation panel on the left side of the NoIP web page, select Dynamic DNS--->No-IP Hostnames. Ensure the IP/Target value for the Hostname points to your current public IP address. (See the second sub-bullet from 'What You Should Know First' if you don't know this value.)
- Use a DNS lookup tool to be sure that your NoIP Hostname resolves to your IP address BEFORE you move onto the next steps.
- Using the web interface, go to "Tools" > "Settings" > "Advanced Settings"
- Input a Webpage password under "BirdNET-Pi Password"
- Input your NoIP hostname in the BirdNET-Pi URL under "Custom URL" (NO TRAILING SLASHES)
- Click "Update Settings" and wait about 20 seconds and then go to your domain's URL.
- Run BirdNET-Pi's included DUC installation script,
sudo ${HOME}/BirdNET-Pi/scripts/install_noip2.sh
. - When prompted, enter the email address and password that you use as login credentials for noip.com.
- Set the update interval to 5 (minutes)
- Answer "no" when asked if any scripts should be run when a new IP is detected.
- This script runs in the background and will update the NoIP.com hostname A record any time a change is detected in BirdNET-Pi's public IP address, which will ensure that all requests to your domain resolve to the BirdNET-Pi's current public IP address.