Cyborgscode / Personal-Voice-Assistent

Building a fully featured and localized voice assistant for Linux
141 stars 6 forks source link

Networksetup in default config #21

Closed Cyborgscode closed 6 months ago

Cyborgscode commented 1 year ago

Is it logical to have in the 01-default.conf

network:"allow","","" network:"deny","","" Well so I did it... but it doesn't work. Here I am not sure I shall write it here but... For a trial I just did : /usr/share/pva/start.sh And apparently it doesn't work. May I open an issue ? (it have nothing to do with setting up french in pva)

Originally posted by @Denis4l in https://github.com/Cyborgscode/Personal-Voice-Assistent/issues/14#issuecomment-1559301984

Cyborgscode commented 1 year ago

It's the working default:

/etc/pva/conf.d/01-default.conf:network:"bindaddress","127.0.0.1" /etc/pva/conf.d/01-default.conf:network:"port","39999" /etc/pva/conf.d/01-default.conf:network:"allow","","" /etc/pva/conf.d/01-default.conf:network:"deny","",""

for a bind to 127.0.0.1 aka localhost, there is no need for a firewall allow/deny list of ip's. If you want to have satellite devices in your network, that can contact the command processor task ( thats the main process that inputs the decoded text message), instead of processing the cmd locally, you change it to your local LAN ip and add ips that are allowed to send text or that are denied.

BUT, this concept has been outdated by the Cluster Plugin, as it connects all microphones on added devices on the "ALLMIC" pulseaudio node which is connected to the listening node of vosk to process voice commands from the entire Cluster.

So in short, let the default unchanged and just add your satellite device to the cluster nodelist.

Denis4l commented 1 year ago

I like things «in short» :-) But I wonder if actually the pva really starts because I have no voice coming out of the speakers. In the logs it does, but I thought because of this network issue it stoped...

File ~/.cache/pva/vcards.cache konnte nicht angelegt werden! java.io.FileNotFoundException: ~/.cache/pva/vcards.cache (Aucun fichier ou dossier de ce type) java.io.FileNotFoundException: ~/.cache/pva/vcards.cache (Aucun fichier ou dossier de ce type) at java.base/java.io.FileOutputStream.open0(Native Method) at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293) at java.base/java.io.FileOutputStream.(FileOutputStream.java:235) at java.base/java.io.FileOutputStream.(FileOutputStream.java:184) at io.Dos.writeFile(Dos.java:165) at io.Dos.writeFile(Dos.java:185) at server.PVA.main(PVA.java:1258) start TimerTask start IMAPTask start PluginLoader loading plugin classes Class DiskFree Constructor called Plugin #1: plugins.files.DiskFree Class LoadTask Constructor called Plugin #2: plugins.files.LoadTask Class Netflix Constructor called Plugin #3: plugins.files.Netflix Class SpeechGuard Constructor called Plugin #4: plugins.files.SpeechGuard PVA:main:init audio start server Error: /home/denis/.config/pva/kspass.txt (Aucun fichier ou dossier de ce type) java.lang.NullPointerException: Cannot invoke "javax.net.ServerSocketFactory.createServerSocket(int)" because "" is null java.lang.NullPointerException: Cannot invoke "javax.net.ServerSocketFactory.createServerSocket(int)" because "" is null at server.Server.makeSSLSocket(Server.java:78) at server.Server.(Server.java:28) at server.PVA.main(PVA.java:1302) java.lang.NullPointerException: Cannot invoke "javax.net.ssl.SSLServerSocket.accept()" because "this.server" is null at server.Server.startServing(Server.java:125) at server.PVA.main(PVA.java:1303) java.lang.NullPointerException: Cannot invoke "javax.net.ssl.SSLServerSocket.accept()" because "this.server" is null

Cyborgscode commented 1 year ago

I see a lot a problems here:

"/.cache/pva/vcards.cache" Does your user have write access here? Is the directory present?

"/home/denis/.config/pva/kspass.txt" that gets autocreated by the "pva" script. If this fails, the keystore for the ssl cert is not created therefor we don't get a server socket due to missing ssl support.

can you verify, that ~/.config/pva/ is existing and has write access for your user?

Cyborgscode commented 1 year ago

My guess is, you started the server by calling start.sh instead of calling "pva" . It would explain all the error messages.

Denis4l commented 1 year ago

right.. oups ! But, I did called pva right now and I think I had missed something during installation cause none of this dir or file are presents in my home. I did not pay attention cause it looks like everything starts anyway. These files msut have been created during first start right ? You say by opva script. Ok. I had lauch pva as myself (I mean no sudo or su something). By the way : pva script ask for a model argument say with option "-m fr" right ?

If, instead of changing /etc/pva/conf.d files I put them and customize them in $HOME/.config/pva ?

Cyborgscode commented 1 year ago

right.. oups ! But, I did called pva right now and I think I had missed something during installation cause none of this dir or file are presents in my home. I did not pay attention cause it looks like everything starts anyway. These files msut have been created during first start right ? You say by opva script. Ok. I had lauch pva as myself (I mean no sudo or su something). By the way : pva script ask for a model argument say with option "-m fr" right ?

I assume that you did not link the model to the vosk model file in /usr/share/pva


$ ls -la /usr/share/pva/
insgesamt 156
drwxrwxr-x.  12 root root  4096 27. Mär 15:47 .
drwxr-xr-x. 620 root root 20480 19. Mai 10:27 ..
drwxrwxr-x.   3 root root  4096 30. Dez 2020  com
-rwxr-xr-x.   1 root root   152 29. Dez 13:49 compile.sh
...
lrwxrwxrwx.   1 root root    18 20. Dez 2021  model -> vosk-model-de-0.21
...

If, instead of changing /etc/pva/conf.d files I put them and customize them in $HOME/.config/pva ?

Yes, no problem.

Denis4l commented 1 year ago

No the link was done :

ls -l /usr/share/pva/ total 80 drwxrwxr-x 1 root root 14 23 mai 09:56 com -rwxr-xr-x 1 root root 152 29 déc. 13:49 compile.sh drwxr-xr-x 1 root root 192 23 mai 09:56 data drwxrwxr-x 1 root root 400 23 mai 09:56 hash drwxrwxr-x 1 root root 230 23 mai 09:56 io drwxr-xr-x 1 root root 92 23 mai 09:56 lib lrwxrwxrwx 1 root root 38 23 mai 14:15 model -> /opt/assistantvocal/vosk-model-fr-0.22 drwxr-xr-x 1 root root 266 23 mai 09:56 plugins -rwxr-xr-x 1 root root 3385 17 mars 11:34 pva -rw-r--r-- 1 root root 14214 20 déc. 2021 pva.conf.default -rwxrwxr-x 1 root root 3193 14 juil. 2022 pva.py -rwxr-xr-x 1 root root 978 11 juil. 2022 pvatrayicon.py -rw-r--r-- 1 root root 24934 26 sept. 2022 README.md -rw-r--r-- 1 root root 539 22 mai 12:38 ReleaseNotes.txt drwxr-xr-x 1 root root 628 23 mai 09:56 server -rwxr-xr-x 1 root root 1871 27 mars 15:47 shutdown.sh -rwxr-xr-x 1 root root 126 11 juil. 2022 start.sh -rwxr-xr-x 1 root root 112 11 juil. 2022 timer.sh drwxr-xr-x 1 root root 42 23 mai 09:56 utils

Denis4l commented 1 year ago

Yes, no problem.

So it is possible to decline everything, languages included for every user of the machine and kee a default language in etc/vpa ?

Cyborgscode commented 1 year ago

you can overwrite ANY config as you like.