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

✨ [birdnet-pi] Ongoing work #1371

Open
29 of 35 tasks
alexbelgium opened this issue May 1, 2024 · 32 comments
Open
29 of 35 tasks

✨ [birdnet-pi] Ongoing work #1371

alexbelgium opened this issue May 1, 2024 · 32 comments
Labels
enhancement New feature or request prevent stale Prevents stale being applied

Comments

@alexbelgium
Copy link
Owner

alexbelgium commented May 1, 2024

Checked

  • If a new addon, I have checked on Google that such as addon doesn't already exists
  • If a new feature, I have searched in the discussions & issues that it was not already covered

Which addon?

Birdnet-pi as legacy alternative to birdnet-go while it is developed

Is your feature request related to a problem? Please describe

List ongoing work

Describe the solution you'd like

Todo :

  • Structure + symlinks
  • Duplicate detection for birdnet.conf
  • tmpfs inclusion
  • minimum ingress to access stats
  • systemctl works
  • alignement of pi and caddy UID to allow db access
  • correct php to have error message if db read only
  • finish and start script to salvage and reused StreamData in temporary folder
  • implement translated ebird with labels
  • set birdsongs location from addon options
  • set terminal password from addon options
  • View log doesn't work
  • Duplicate options
  • Analysis robust (check new monitoring service works as intended)
  • Remove journald to only use /proc
  • Correct ebird taxo: https://www.birds.cornell.edu/clementschecklist/wp-content/uploads/2023/12/ebird_taxonomy_v2023-csv.zip
  • Test on VM
  • Test on supervised
  • cron not running
  • enable disk purge
  • Add webui for convert species
  • Managing authentification in ingress
  • Ingress broken for terminal, filebrowser and stats
  • Add new graphs from main repo
  • Add button to save wav if no detections

Improve birndet-pi

  • daily_plot.py:101: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  • Have ebirds vs aboutallbirds as an option
  • Changed identified bird. Script created. Now would need an icon in the statspage (next to FreqShift which opens a listbox to select the new specie, then execute the script already written with inputs of the mp3 url and the new specie)
  • Automatically convert one bird to another ? (dangerous) - based on a text file with ;
  • Weekly detections page
  • Create a new sqlite column (or a separate table) with status : CONFIRMED ; UNCONFIRMED ; PROBABLE
  • Increase confidence level needed when raining based on buienradar? Or other app
  • Have a different threshold for rare and usual birds
@alexbelgium alexbelgium added enhancement New feature or request prevent stale Prevents stale being applied labels May 1, 2024
@deadrubberboy
Copy link

Hello! Where do I configure an RTSP input? I tried the web interface but the "tools" button says I can't config there. I only see "default" as audio option in the config.

*I'm running Scrypted add on and can get rtsp rebroadcast from there or direct from Amcrest camera. Neither is "IN" HA currently.

@alexbelgium
Copy link
Owner Author

Hi ! Ingress isn't working that much for the moment but you can access it fine using ip:port!

@deadrubberboy
Copy link

Hello! Not sure what "ingress" is. I can access the green page. When I tried "tools" to get to settings the first time I got an error. I got in just now though! I'll see if I can get rtsp configured. Thanks!

@alexbelgium
Copy link
Owner Author

Ingress is when accessing from HA (in the sidebar) while ip:port is a direct access :)

@deadrubberboy
Copy link

Thanks! I made progress. When I go to "spectrogram" I can hear my camera audio. I can actively hear birds chirping too. No detections.

When I click on "log" from the web interface I see an error "rtsp @ 0xaaaaea3eba00] method SETUP failed: 461 Unsupported Transport".

Any ideas?

@alexbelgium
Copy link
Owner Author

Well that's great! Now it means (according to chatgpt) that you are using a protocol (either tcp or udp) not supported by ffmpeg, is that an option for you to change the rtsp sound options?

@deadrubberboy
Copy link

I'm using Scrypted rebroadcast stream. I changed it from "scrypted TCP" to "FFMPEG TCP". Rebooting.

How can I be sure it's saving /reading a file?I see in config the default location is /config/BirdSongs - Do I need to create that folder somewhere?

@deadrubberboy
Copy link

Should I go by "your" log or the one on web interface (green screen)?

@deadrubberboy
Copy link

Sorry. I keep peppering you with stuff! Not even sure this is the best format. Sorry, I'm totally new.

Good news though! I noticed the file reference in the log was ".wav" and the setting for recording was ".mp3". I changed the mp3 pulldown to .wav and rebooted again. There's a detection! Hopefully I got it sorted. Thank you for your work on this and your patience with me specifically!

@alexbelgium
Copy link
Owner Author

Should I go by "your" log or the one on web interface (green screen)?

It's the same! It both is stdout

How can I be sure it's saving /reading a file

Whey the spectrogram you can check that the rtsp stream works. With the log you can see if there is an error. On the first page you would see the spectrogram being analyzed, and detections!

@alexbelgium
Copy link
Owner Author

Sorry. I keep peppering you with stuff! Not even sure this is the best format. Sorry, I'm totally new.

Good news though! I noticed the file reference in the log was ".wav" and the setting for recording was ".mp3". I changed the mp3 pulldown to .wav and rebooted again. There's a detection! Hopefully I got it sorted. Thank you for your work on this and your patience with me specifically!

Great! There is actually no link : the stream is read as a wav, but it is saved as a mp3 (after analysis) for future reading as a very efficient storage method. I would recommend you keep it.

@deadrubberboy
Copy link

I'm still seeing the error. Must have been unrelated. I'll go back in and change back to mp3. Thank you again.

@deadrubberboy
Copy link

Does this tell you anything? I see the RTSP error but then still says analyzing audio file?

CleanShot 2024-05-15 at 16 22 36

@deadrubberboy
Copy link

I AM still seeing detection pop up... 🤷‍♂️

CleanShot 2024-05-15 at 16 27 08

@deadrubberboy
Copy link

Popped open log again and see what looks like a success in the RTSP. I guess it's hit and miss?
CleanShot 2024-05-15 at 16 43 07

@alexbelgium
Copy link
Owner Author

Well as long as it works :) perhaps your rtsp stream is not stable? You could try with an app that connects to the rtsp stream to see if there is no interruptions in the stream. It could be seen from the live spectrogram too

@deadrubberboy
Copy link

I switched to the sub stream direct from camera instead of the rebroadcast from Scrypted. Now I don't see the "RTSP" line in the logs come up at all. I think that did the trick. Spectrogram works, and getting detections.

Thank you again! I saw you pushed updates yesterday. Appreciate all of your efforts!

@alexbelgium
Copy link
Owner Author

I'm still adding features & corrections based on the list in the first post :-) changing misidentified species works great!

@deadrubberboy
Copy link

Hi! Me again. Back to bug you. Everything has been working great and I even got my bird weather api working etc.

Something broke in a recent update and rolling back doesn't fix it. It was around the time with the port change to 8081 - I've been taking all updates as I get notified of them. Last recordings were on 5/21 if that helps narrow. I can still hear live audio etc but no detections anymore. I am seeing this in the logs:
CleanShot 2024-05-23 at 08 55 00@2x

Any tips on what I should do?

@deadrubberboy
Copy link

thinking it's related to the new instructions are Let's Encrypt? I'm installing that add on now. Didn't have before.

@alexbelgium
Copy link
Owner Author

Hi, sorry for all the versions there was many things to adapt to be able to use ssl while taking into account Homeassistant's and docker limitations... I think it is a permission issue, I encountered the same. The thing is that each time the addon is closed or restarted, all files not yet analyzed are copied in /data/Streamdata, then put back in the analysis queue when the addon is started again.

What I would propose to you : enable the web terminal from the Tools/Service tab, then go to the Web terminal, login with the user "pi" and the password that you put in the addon options, and type : chown -R pi:pi /tmp/StreamData && chmod -R 777 /tmp/StreamData && echo "done"

@alexbelgium
Copy link
Owner Author

alexbelgium commented May 23, 2024

thinking it's related to the new instructions are Let's Encrypt? I'm installing that add on now. Didn't have before.

There is 2 mutually exclusive ways to achieve ssl :

  • Have a https url reported in the birdnet.conf + have port 80 mapped to 80 in the addon options : it will use caddy's automatic certificates system to provide ssl. For that, the ssl option must be set to false in the addon options (default)
  • Activate the ssl option in the addon options, it will go fetch the certificates from the Let's Encrypt addon and automatically set-up https

@alexbelgium
Copy link
Owner Author

Btw (sorry for the multiposts) ; in theory a script exists that checks the content of StreamData. when there is more than 100 files ; it will restart services and redo permissions to fix potential issues

The only failure I saw was when the disk is full ; it seems to analyse but actually don't save anything

@deadrubberboy
Copy link

Hi, sorry for all the versions there was many things to adapt to be able to use ssl while taking into account Homeassistant's and docker limitations... I think it is a permission issue, I encountered the same. The thing is that each time the addon is closed or restarted, all files not yet analyzed are copied in /data/Streamdata, then put back in the analysis queue when the addon is started again.

What I would propose to you : enable the web terminal from the Tools/Service tab, then go to the Web terminal, login with the user "pi" and the password that you put in the addon options, and type : chown -R pi:pi /tmp/StreamData && chmod -R 777 /tmp/StreamData && echo "done"

Thanks for the quick reply! Did this (had to add sudo to front of that command - got error otherwise). Seems to have fixed it! Will I need to run that whenever there is an update?

Do I need to enable SSL? What are the risks if I don't? I run HA in a VM on an always on MacMini. It has its own (internal/local) IP address. I don't need to access the web interface of Bridnet-Pi outside of home. If I do, I can always do it in the HA app via iPhone/Mac via the Nubocasa link. I pay for the remote access to support them, but rarely use it.

@alexbelgium
Copy link
Owner Author

I've added this permissions fix in the startup script ; it won't happen again :) that's the good thing about debugging like that on github, once I'm aware I try to find a solution that should avoid the issue for other users or in the future :-)

For ssl it's only recommended if you use it externally... I've put so much effort on it because my domain forces me to use https and it was bugging me not to be able to use it :-)

@deadrubberboy
Copy link

Thanks again!

@deadrubberboy
Copy link

Hello again! Got this after today's update. Stopped detecting:

CleanShot 2024-06-04 at 16 07 08@2x

@deadrubberboy
Copy link

Bigger section from "your log":

CleanShot 2024-06-04 at 16 14 14@2x

@alexbelgium
Copy link
Owner Author

Thanks! Argh I'm sorry. Please try adding PROCESSED_SIZE=0 to your birdnet.conf. I'll revert the change to avoid issue for other users

@deadrubberboy
Copy link

deadrubberboy commented Jun 4, 2024

Happy to help!

And thanks! That (PROCESSED_SIZE=0) seems to have solved it!

*no apology needed! Appreciate your efforts

@deadrubberboy
Copy link

Just sent a coffee your way 😉

@alexbelgium
Copy link
Owner Author

Thanks very much! I tried to readd the Processed folders to be able to retrieve wav file for analysis if we are not happy about detections but it seems something messed out as it doesn'r automatically add the value to the birdnet.conf... And this value is costumizable from the settings page :)

But seeing your issue i'll revert so other people don't lose detections

alexbelgium added a commit that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prevent stale Prevents stale being applied
Projects
None yet
Development

No branches or pull requests

2 participants