mcguirepr89 / BirdNET-Pi

A realtime acoustic bird classification system for the Raspberry Pi 4B, 3B+, and 0W2 built on the TFLite version of BirdNET.
Other
1.3k stars 139 forks source link

Webserver is nonresponsive #657

Closed shibaku closed 1 year ago

shibaku commented 1 year ago

I have a (formerly)working installation that appears to be recording and processing audio just fine, but am now no longer able to access the web page. I can ssh into the pi just fine, but this is what I get when I try to connect to the webserver: Screenshot 2022-11-18 8 56 47 PM

I see the same blank-ish screen whether I'm inside my local network (whether connecting via hostname or via local IP address) or connecting externally. I've even tried connecting via a phone that's not connected to my wifi, and get the same result.

Here's the output from curl:

  <title>Magic Birdhouse</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
  body::-webkit-scrollbar {
    display:none
  }
  </style>
  <link rel="stylesheet" href="style.css?v=8.05.22">
  <link rel="stylesheet" type="text/css" href="static/dialog-polyfill.css" />
  <body>
  <div class="banner">
    <div class="logo">
  <a href="https://github.com/mcguirepr89/BirdNET-Pi.git" target="_blank"><img src="images/bird.png"></a>  </div>

    <div class="stream">

    <form action="" method="GET">
      <button type="submit" name="stream" value="play">Live Audio</button>
    </form>
    </div>
    <h1><a href="/"><img class="topimage" src="images/bnp.png"></a></h1>
  </div><div class="centered"><h3>Magic Birdhouse</h3></div>
  <iframe src="/views.php"></iframe>
  </div>

Using curl to access views.php returns nothing.

Any ideas?

lloydbayley commented 1 year ago

That's really weird because the curl output from index.php looks fine. Indeed, views.php should return the content with curl but I would like to check the Caddy URL first.

If you check the caddy url in the birdnet.conf by SSHing in and running: grep URL ~/BirdNET-Pi/birdnet.conf

It will show you something similar to this (this is mine):

## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream BIRDNETPI_URL=https://berowra.birdnetpi.com HEARTBEAT_URL=

It's the BIRDNETPI_URL that we want to check. If it has a trailing backslash, it will cause caddy to baulk.

Check that out first and see how you go!

shibaku commented 1 year ago

That was it (well, almost, but it put me on the right track). Thank you. It was formed correctly without the trailing backslash in the birdnet.conf file, but somehow /etc/caddy/Caddyfile hadn't been updated when I updated the URL via the web interface. I removed it there and that fixed the problem.

lloydbayley commented 1 year ago

Excellent news. That IS strange isn't it?! I might have a play with a test copy I have to see if I can replicate that but had a quick look at the code for the advanced settings and it seems ok. Thanks for letting us know the outcome! :)