Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling automatic update of location with GPS (via gpsd service) #42

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

Kytutr
Copy link

@Kytutr Kytutr commented Apr 25, 2024

This pull request is about enabling automatic update of location with GPS (via gpsd service).

The main reason for this is to make the whole BirdNET-Pi setup more portable (in the sense of moving it around outdoors). It's plug-and-play process, after you configure it.

How it works:

  • GPS receiver is connected to a Raspberrry Pi (in my case it's Holux RCV-3000, connected via USB)
  • gpsd service controls GPS receiver
  • Python script location_autoupdate.py works as service and updates latitude and longitude in configuration

Main changes:

  • README.md - that's the very first thing you want to change ;-)
  • homepage/views.php and scripts/config.php to reflect new configuration options
  • scripts/install_config.sh to install new service and it's base configuration
  • scripts/location_autoupdate.py whole new service - it teams up with gpsd and updates the location
  • scripts/service_controls.php - adding the new service also there
  • scripts/update_birdnet_snippets.sh - ensuring that location_autoupdate service is installed during update

Dependencies:

  • running gpsd service with configured GPS device
  • Python modules: gpsdclient and apscheduler

How was it tested?

  • by performing series of clean installations and making fixes
  • by updating from current Nachtzuster main branch
  • you can see here that service is running (after clean installation):
    image
  • if you would like to give it a try, please use this branch for clean installation or update: https://github.com/Kytutr/BirdNET-Pi/

Configuration steps

  1. Enable service here:
    image
  2. And enable it and configure here:
    image

Please don't be shy with comments, advices, feedback from testing (most important part yearning for testing is update).

Kytutr and others added 24 commits April 24, 2024 23:45
First commit for location autoupdate (via gpsd)  - !experimental!
Adjusting installation scripts to my fork
Adjusting/fixing installation and update
@Nachtzuster
Copy link
Owner

Interesting...
This will break some other code I think. eg. the plotly/streamlit code for a sunset/sunrise line assumes a fixed location, so the line will become meaningless if you wonder off too much.

Also I'm missing code changes to make the analysis process actually pick up the location changes, what is the plan on that?

@lloydbayley
Copy link

This would indeed cause issues with not only the streamlit but also Birdweather uploads too that rely on the lat/lon settings.
It would require quite a bit of coding to try to manage it with those two (that I can think of offhand) and I think it would cause a lot of confusion. It extends to a feature beyond the original scope of the project. Perhaps it might be better in another fork for those who wish to make it mobile. It would have to disallow/not use a few features to flow properly.

@Kytutr
Copy link
Author

Kytutr commented May 5, 2024

Interesting... This will break some other code I think. eg. the plotly/streamlit code for a sunset/sunrise line assumes a fixed location, so the line will become meaningless if you wonder off too much.

Thank you for the answer @Nachtzuster
Now I will analyse your hints and try to face problems you mentioned. I see that my pull request is not quite ready to be merged.

Also I'm missing code changes to make the analysis process actually pick up the location changes, what is the plan on that?

Oh, this one needs to be addressed too. Will work on that.

@Nachtzuster Nachtzuster marked this pull request as draft June 29, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants