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

Weekly Report (yes, it's still not working) bug #26

Closed
MueJosh opened this issue Apr 1, 2024 · 21 comments
Closed

Weekly Report (yes, it's still not working) bug #26

MueJosh opened this issue Apr 1, 2024 · 21 comments
Labels
bug Something isn't working

Comments

@MueJosh
Copy link

MueJosh commented Apr 1, 2024

In the settings menu for Apprise notification there is a problem with the weekly report.
It doesn't get send (this is also problem in the original repo)

To Reproduce
Steps to reproduce the behavior:

  1. Go to Tools - Settings - Notifications
  2. Click on send weekly report
  3. Error - Don't see a weekly report at the end/ start of the week ;)

Expected behavior
Get the weekly report as an notification from apprise

Screenshots
image

Your build
Raspberry Pi 4
64 bit bullseye lite

Code or log snippets

I think the problem lays in this script:

https://github.com/Nachtzuster/BirdNET-Pi/blob/main/scripts/weekly_report.sh

As Its says that the user is named Birdnet-pi and it should be the real username not the default one.

I can't test it right now but maybe you can get it working.

@Nachtzuster
Copy link
Owner

No, that is the directory name in $HOME, and that is ok.

There might be something wrong with your specific setup:
Could you post Tools->System Info->Viewer ?

@MueJosh
Copy link
Author

MueJosh commented Apr 2, 2024

No, that is the directory name in $HOME, and that is ok.

There might be something wrong with your specific setup:

Could you post Tools->System Info->Viewer ?

Sure, here it is :)

image
image
image
image

@Nachtzuster
Copy link
Owner

that looks ok -I think-

Could you run /usr/local/bin/weekly_report.sh manually ? and report the output?
Does that give you a notification?

@MueJosh
Copy link
Author

MueJosh commented Apr 2, 2024

Yeah, I wasted a lot of time trying to get it running. In the end I gave up (though I would love too see it working)

image

And the notification:

image

@Aixsponsa
Copy link

Aixsponsa commented Apr 2, 2024

The last Weekly Report email I received was March 11th 2024, if that helps track down anything.

Edit: To add.

If you include this at the end of your URL the weekly reports are still being generated. It comes down to the apprise notification.

localhost/views.php?view=Weekly%20Report&ascii=true

@Nachtzuster
Copy link
Owner

@MueJosh help me understand the issue you're seeing is that

  1. you do not get any weekly notifications or
  2. the notification you get are a stack-trace like shown in your screenshot
  3. something else

@Nachtzuster Nachtzuster added the bug Something isn't working label Apr 3, 2024
@MueJosh
Copy link
Author

MueJosh commented Apr 3, 2024

  1. Yes, I don't receive a weekly report (though I'm receiving detections etc.)

  2. yep, but I just receive this notification (like in the screenshot) if I send a "test notification"

I don't even know how the weekly report should look like, is it a picture of the weekly_report.php or plain text?
I have never seen it before 😅

@Nachtzuster
Copy link
Owner

Nachtzuster commented Apr 4, 2024

looking at the screenshot, I think you're seeing a division by zero issue.
I pushed a fix to handle that safely.

Could you update and run /usr/local/bin/weekly_report.sh again?
Does that give you a notification now?

@MueJosh
Copy link
Author

MueJosh commented Apr 4, 2024

Now it gives me nothing
Normal bird notifications still work

Updated, reboot, checked the files, checked apprise notifications (saved it again, no changes done)

It always gives me this output (tried sudo once)
image

Really confusing, maybe it's because of the telegram api (idk)

@Nachtzuster
Copy link
Owner

This could actually be progress :-)

could you see what http://[YOURPI]/views.php?view=Weekly%20Report&ascii=true
gives you, that should be the report

@MueJosh
Copy link
Author

MueJosh commented Apr 4, 2024

That's nice to hear ^^

image

@Nachtzuster
Copy link
Owner

Ah yes, looking good. 👍
So now the week report itself is working.

I'm not sure about the apprise error though...
Could you remove one of the apprise entries so it should send one single notification and then run
/usr/local/bin/weekly_report.sh agiain? no sudo

@Nachtzuster
Copy link
Owner

Nachtzuster commented Apr 4, 2024

hmm, some googling sugests that this could be a Telegram limitation.
similar issue: Eleirbag89/TelegramBotPHP#152
and https://community.zapier.com/troubleshooting-99/google-calendar-telegram-bad-request-can-t-parse-entities-unsupported-start-tag-br-at-byte-offset-120-25977
Could you test with another serivice like email oe whatsapp to confirm?

@MueJosh
Copy link
Author

MueJosh commented Apr 4, 2024

I think it was working before just fine- on another birdnetpi without any updates (and no setup for apprise notifications) it's outputting the "same" (different values obviously)

The error is still the same 🫠
image

Edit: I'll test other notifications after dinner :)

@MueJosh
Copy link
Author

MueJosh commented Apr 4, 2024

I got fed up with the notifications / weekly report ;)

Signal needs a docker / server to send messages, email needs the password (I have 2fa enabled- more issues)
This is why I use telegram 😅

Problem are all the <>*/ ... on the weekly report
Adding ?format=markdown to the chat id "solves" the problem.
Not great but it works!

image
image

pull request (never did this before; it took some time to figure it out)

@Nachtzuster
Copy link
Owner

That is a great find! Seems the best solution I think

@arne1921KF
Copy link

arne1921KF commented Apr 6, 2024

Nice, thank you, @MueJosh.

Interestingly, adding the ?format=markdown command breaks the formatting of the notification title.

OTH, it allows formatting for the body, which is great. Having scientific names in italics is such a relief... ;-)
The only thing missing (from markdown, so no solution for that) is the ability to add a new line.

Here's my current take:
*$comname* (_$sciname_) wurde erkannt.``Confidence score: $confidence, $confidencepct %, cutoff: $cutoff, sensitivity: $sens/`` [Audio available on local network]($listenurl)
ETA: how do I break the inline code tag here on GitHub?

ETA 2: 🦩?! 😂

@MueJosh
Copy link
Author

MueJosh commented Apr 7, 2024

@Nachtzuster there are definitely better ways- look at the pull request comment.

Nice, thank you, @MueJosh.

Interestingly, adding the ?format=markdown command breaks the formatting of the notification title.

OTH, it allows formatting for the body, which is great. Having scientific names in italics is such a relief... ;-)

Yeah, this is exactly what markdown should do ^^
I think it would be possible to delete the font size = small from weekly report.php though there are better ways (you can check out my pull request- it's definitely not finished)

Yeah, this is really easy to implement if the format=markdown is just for the weeklyreport ...
I've never got __XYZ__ to work, just when I write it manually in chat.

The only thing missing (from markdown, so no solution for that) is the ability to add a new line.

What do you mean with this?
%0A (is that what you meant?)
Example:
*$comname* (_$sciname_) wurde erkannt.``Confidence score: $confidence, $confidencepct %, cutoff: $cutoff, sensitivity: $sens/`` %0A[Audio available on local network]($listenurl)

Edit: I see... it works with a test notification but normal operation does not. I have an idea but no time to find out.
Berufsschulprüfung ahead 🙄

I don't get the rest 😅

@MueJosh
Copy link
Author

MueJosh commented Apr 7, 2024

@Nachtzuster should I open another issue for notification breaks?
I don't mind Handeling it here

Example, this is how it's set up normally:
Ein/e $comname ($sciname) wurde soeben erkannt. Erkennungswahrscheinlichkeit $confidencepct%
Looks like this:
image

Code for break-line <> , /n , %0A or whatever the server wants for a break
Ein/e $comname ($sciname) wurde soeben erkannt. %0AErkennungswahrscheinlichkeit $confidencepct%

This is how it's supposed to look like (send with "test notification" button)
image

Same break line %0A
How it actually comes out:
image

If I have the time (can be weeks to months) I can handle it.

Maybe it's an issue with apprise? (I don't think so)

@Nachtzuster
Copy link
Owner

Nachtzuster commented Apr 8, 2024

should I open another issue for notification breaks?

@MueJosh yes please.

@Nachtzuster
Copy link
Owner

@MueJosh I've swapped out the <small> tags in the html, it still looks the same as before -kinda- but now sending to Telegram should work without workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants