BirdNET-Pi to Monitor Bird Calls: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 205: | Line 205: | ||
== Advanced Settings == | == Advanced Settings == | ||
= BirdNET-Pi API = | |||
* BirdWeather has an API in place and the BirdWeather (web) App makes use of it in producing the results seen via the web page portal. | |||
* Documentation is here - [https://app.birdweather.com/api/index.html] '''https://app.birdweather.com/api/index.html''' | |||
* There is also an online query tool for testing queries here - '''https://app.birdweather.com/graphiql''' | |||
== Example Python code == | |||
* This is a simple python program that will return some BirdWeather results from station 273 (my station in Bundoora, Victoria Australia) | |||
[[File:Screen Shot 2023-02-25 at 6.27.37 am.png | 900px]] | |||
* Here is the Python code that can be copied. | |||
<syntaxhighlight lang="python"> | |||
import requests | |||
import json | |||
query = """query{ | |||
station(id: "273") { | |||
id | |||
location | |||
name | |||
topSpecies { | |||
averageProbability | |||
species { | |||
id | |||
commonName | |||
scientificName | |||
} | |||
} | |||
} | |||
}""" | |||
url = 'https://app.birdweather.com/graphql' | |||
r = requests.post(url, json={'query': query}) | |||
#print(r.status_code) | |||
#print(r.json()) | |||
data_json = json.dumps(r.json()) | |||
print(data_json) | |||
</syntaxhighlight> | |||
* The output is shown in the Python Shell. | |||
* The data is in JSON format | |||
[[File:Screen Shot 2023-02-25 at 6.29.51 am.png | 900px]] | |||
* Copy this output and paste it in JSONviewer to make the data human readable '''https://jsonviewer.com''' | |||
* The data should be similar to the screen shot below. | |||
[[File:Screen Shot 2023-02-25 at 6.31.16 am.png | 900px]] | |||
== BirdWeather online GraphiQL tool == | |||
* An online query tool for testing queries at this URL - '''https://app.birdweather.com/graphiql''' | |||
* An example output is presented for station 273. | |||
[[File:Screen Shot 2023-02-25 at 6.45.02 am.png | 900px]] | |||
* Use the online documentation to modify your query '''https://app.birdweather.com/api/index.html'''. | |||
* This will help you understand how the API work. | |||
* In this example below the wikipediaSummary has been added to the query. | |||
[[File:Screen Shot 2023-02-25 at 6.51.32 am.png | 900px]] | |||
[[File:Screen Shot 2023-02-25 at 6.54.01 am.png | 900px]] | |||
Revision as of 17:06, 6 March 2023
BirdNET-Pi Lesson
| Lesson number | Step by step instructions | Dropbox Video link | Teacher resources |
|---|---|---|---|
| Lesson 2a | #The Importance of Using BirdNET-Pi to Monitor Bird Calls | Cornell University BirdNET-Pi Project | |
| Lesson 2b | #BirdNET-Pi microSD Card Imaging | GitHub BirdNET-Pi Installation Guide | |
| Lesson 2c | #BirdNET-Pi Software Installation | BirdNET-Pi Software Installation using SSH | |
| Lesson 2d | #BirdNET-Pi Finalising the Installation | BirdNET-Pi Finalising the Installation | |
| Lesson 2e | #Settings Configuration in BirdNET-Pi Web Portal |
BirdNET-Pi microSD Card Imaging
- Download and install the Raspberry Pi Imaging software.
- The software is available from https://www.raspberrypi.com/software
- Insert a microSD card in the computer with the Raspberry Pi Imaging software.
- The size of the microSD card needs to be 16 GB.
- Open the Raspberry Pi Imager and click CHOOSE OS to select the operating system for BirdNET-Pi.
- Click Raspberry Pi OS (other) Other Raspberry Pi OS based images
- Scroll down the list and select "Raspberry Pi OS Lite (64-bit)"
- Next, click "CHOOSE STORAGE" to select the SD card the BirdNET-Pi will use
- Choose the SD card onto which we will write the RaspiOS-Lite (64-bit) operating system
- Now, click the gear icon in the bottom right to open the "Advanced options" menu
- Answer Yes - to fill in WiFi details
- Set the hostname you would like this BirdNET-Pi to use to be reached.
- For example, to have multiple BirdNET-Pis on the same network, you might want to give them each a different hostname.
- In this example, the installation will be reachable at "http://birdnetpi1.local", since that is the hostname that is set during this step.
- You should also "Enable SSH" and select to "Use password authentication"
- When you scroll down, you will set the option to "Set username and password."
- This example creates a new user called pi.
- You will also configure the system's connection to your WiFi by entering the network's name (SSID) and the password used to connect to that WiFi.
- Adjust the locale settings for your Time zone and Keyboard layout.
- Save the settings
- Click "WRITE" to write the image to the SD card
- Select "YES" and enter to allow your host system (the computer you're on now) to write the SD card.
- Wait while the image is written to the card and the checksums verified
- You may need to give permission for your computer to make changes to the SD card.
- Enter your password (if requested) and click OK.
- The writing and verification process takes approx 5-10 minutes.
- When the SD card is ready, you'll be notified that is ok to remove it from your computer
- At this point, you will put the SD card into the Raspberry Pi and will allow it a few minutes to boot up.
- After a few minutes, you can move on to the next step.
BirdNET-Pi Software Installation
- At this point, you will put the SD card into the Raspberry Pi and will allow it a few minutes to boot up.
- After a few minutes, you can move on to the next step.
- Using a terminal emulator of your choosing (macOS and Linux users can use the terminals that come with the OS -- Windows users can use PowerShell or PuTTY).
- Use the username and hostname from step 8 to SSH into the Raspberry Pi.
- In this example, we created the birder user on the birdnetpi1.local host, so the command would be ssh pi@birdnetpi1.local
- When warned that you are connecting to a new machine, type yes to proceed
- You will be prompted for the password that you set for user pi
- After entering the password for your user, you will be able to begin the installation of the BirdNET-Pi software.
- Copy and paste the command below into the terminal and press "Enter"
- Note: Ctrl+Shift+V will often paste in Terminals -- in PuTTY, right-click to paste
- curl -s https://raw.githubusercontent.com/mcguirepr89/BirdNET-Pi/main/newinstaller.sh | bash
- The installation process will take approximately 5 to 10 minutes.
- When the installation is finished, the system will automatically reboot. When it is booted back up,
you will be able to reach your BirdNET-Pi using the hostname you set in step 8. In this installation example, it is http://birdnetpi1.local. The default (if you did not set a specific hostname in step 8) will be http://birdnetpi.local. It can also be reached at the Pi's IP address.
BirdNET-Pi Finalising the Installation
- Open a Browser on a computer on the local network.
- Enter the following address in the search bar http://birdnetpi1.local
- BirdNET-Pi Dashboard will open up.
Settings Configuration in BirdNET-Pi Web Portal
- The BirdNET-Pi web portal has additional configuration options.
- Click on the Tools dropdown menu.
- A Log into birdnetpi1.local:80 window will appear.
- The username is birdnet
- There is no password.
- Click on Log in
- A new series of administration buttons will appear under the main menu.
- Click on Settings
- Wait a few seconds for the Settings page to load.
- BirdNET-Pi needs to know the latitude and longitude location up to 4 decimal places.
- Use Google Maps to pinpoint the location of the BirdNET-Pi sensor.
- Enter the GPS coordinates to 4 decimal places.
- BirdNET-Pi will keep your data localised unless you upload data to BirdWeather.com.
- If you would like to share data contact Tim (tim@birdweather.com) to request a BirdWeather ID.
- Sending data to BirdWeather.com will is important for this project because we can then access the data using an API (more on this later).
- Update the Time and Date settings.
- To commit (save) all setting click on the Update Settings button.
- To check that the Settings have been updated successfully wait for the Settings page to reload.
- Then scroll down to the bottom of the page.
- A Success message should be displayed.
Advanced Settings
BirdNET-Pi API
- BirdWeather has an API in place and the BirdWeather (web) App makes use of it in producing the results seen via the web page portal.
- Documentation is here - [1] https://app.birdweather.com/api/index.html
- There is also an online query tool for testing queries here - https://app.birdweather.com/graphiql
Example Python code
- This is a simple python program that will return some BirdWeather results from station 273 (my station in Bundoora, Victoria Australia)
- Here is the Python code that can be copied.
import requests
import json
query = """query{
station(id: "273") {
id
location
name
topSpecies {
averageProbability
species {
id
commonName
scientificName
}
}
}
}"""
url = 'https://app.birdweather.com/graphql'
r = requests.post(url, json={'query': query})
#print(r.status_code)
#print(r.json())
data_json = json.dumps(r.json())
print(data_json)
- The output is shown in the Python Shell.
- The data is in JSON format
- Copy this output and paste it in JSONviewer to make the data human readable https://jsonviewer.com
- The data should be similar to the screen shot below.
BirdWeather online GraphiQL tool
- An online query tool for testing queries at this URL - https://app.birdweather.com/graphiql
- An example output is presented for station 273.
- Use the online documentation to modify your query https://app.birdweather.com/api/index.html.
- This will help you understand how the API work.
- In this example below the wikipediaSummary has been added to the query.












