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

Several problems after installation #8

Closed
Smo-RBR opened this issue Feb 25, 2024 · 7 comments
Closed

Several problems after installation #8

Smo-RBR opened this issue Feb 25, 2024 · 7 comments

Comments

@Smo-RBR
Copy link

Smo-RBR commented Feb 25, 2024

Installed the Nachtzuster version this night. After installation runs through, the Pi rebootet, and in the log, BirdnetPi complains about missing model/labels.txt, so i unzipped labels_l18n and symlinked labels_de.txt to labels.txt, and Birdnet startet detecting.
i hope i did this right?

Then when i want to save the Tools/Settings, birdnet throws an error:
Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /home/birdnet/BirdNET-Pi/scripts/config.php:228 Stack trace: #0 /home/birdnet/BirdNET-Pi/scripts/config.php(228): fwrite() #1 /home/birdnet/BirdNET-Pi/homepage/views.php(181): include('...') #2 {main} thrown in /home/birdnet/BirdNET-Pi/scripts/config.php on line 228

Maybe i caused this with my symlinking of the labels.txt?

@Smo-RBR
Copy link
Author

Smo-RBR commented Feb 25, 2024

When i provide lat/lon, they seem to be saved, but it detects birds fom the other side of the earth. So e.g.Xema sabini instead of Turdus merula

@Smo-RBR
Copy link
Author

Smo-RBR commented Feb 25, 2024

``Okay, maybe i found some problem in installation log, while the install scripts says ist has succesfull performed the installation, the log shows, that the install tried to search/install the labels.txt in the wrong home directory:
It first has the right directory /home/birdnet but the it uses /home/smo for searching the labels zip

+ cd /home/birdnet/BirdNET-Pi/scripts
+ ./install_language_label_nm.sh -l en
unzip:  cannot find or open /home/smo/BirdNET-Pi/model/labels_nm.zip, /home/smo/BirdNET-Pi/model/labels_nm.zip.zip or /home/smo/BirdNET-Pi/model/labels_nm.zip.ZIP.
unzip:  cannot find or open /home/smo/BirdNET-Pi/model/labels_nm.zip, /home/smo/BirdNET-Pi/model/labels_nm.zip.zip or /home/smo/BirdNET-Pi/model/labels_nm.zip.ZIP.
+ exit 0

Tried on Terminal:


birdnet:~/BirdNET-Pi/scripts$ ./install_language_label_nm.sh -l de

unzip:  cannot find or open /home/smo/BirdNET-Pi/model/labels_nm.zip, /home/smo/BirdNET-Pi/model/labels_nm.zip.zip

 or /home/smo/BirdNET-Pi/model/labels_nm.zip.ZIP.

unzip:  cannot find or open /home/smo/BirdNET-Pi/model/labels_nm.zip, /home/smo/BirdNET-Pi/model/labels_nm.zip.zip or /home/smo/BirdNET-Pi/model/labels_nm.zip.ZIP.

birdnet:~/BirdNET-Pi/scripts$ whoami

birdnet

birdnet:~/BirdNET-Pi/scripts$ pwd

/home/birdnet/BirdNET-Pi/scripts

birdnet:~/BirdNET-Pi/scripts$

So the problem is caused by lines like this
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd) in scripts/install_language_label_nm.sh, because the installer assumes that only one user account exists. Maybe grep for username instead ID in passwd, or switching to the user and use environment variables to determine correct $HOME could help.

@Nachtzuster
Copy link
Owner

Could you run awk -F: '/1000/{print $1}' /etc/passwd and awk -F: '/1000/{print $6}' /etc/passwd ?

@Smo-RBR
Copy link
Author

Smo-RBR commented Feb 25, 2024

Sorry, editet the command above, because i had the same idea :)

@Nachtzuster
Copy link
Owner

Yes, your analysis is correct.
BirdNET-Pi does require to be installed as the primary user (uid=1000).
I'm not sure why looking in /etc/passwd was chosen to get to the user and home dir

Anyway, you can set the language though the settings page:
afbeelding

@Smo-RBR
Copy link
Author

Smo-RBR commented Feb 25, 2024

This seems to fail too, because ist uses the same scripts i think. This logic is also implemented in another scripts, what maybe causes the other errors. I will use another, fresh SD card for this time testing. Do you plan a fix for this issue?

@Nachtzuster
Copy link
Owner

Yes, best try with a fresh cd card.
Getting rid of nosing in /etc/passwd is indeed on my to-do list.
For now I've merged some checks I already had in a branch. I had not merged them a I was not sure it was really needed :-)

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

No branches or pull requests

2 participants