Page 1 of 1

401 basics

Posted: Sunday 22 December 2024 12:48
by bartemannekes
Hi forum,

I am pretty new to domoticz, after quite a few searches on the forum, I remain stuck...

I have an ssh connection to the pi, and i type

Code: Select all

"curl http://192.168.0.212:8080/json.htm?type=command&param=udevice&idx=19&nvalue=0&svalue=33;0"
which keeps on giving "401 Unauthorized"

(when going to

Code: Select all

http://192.168.0.212:8080/json.htm?type=command&param=udevice&idx=19&nvalue=0&svalue=33;0
from safari from another machine, this works, at least when there is a session to domoticz where i am logged in)

in settings, trusted networks, I have "127.0.0.*, 192.168.0.212" and API protection is set to allow basic auth
I have raspberry pi 5, domoticz 2024.7, ip of the pi is 192.168.0.212

Am I doing something very basic wrong in the curl command?
What can I actually do in terms of debugging to understand why I get 401, as far as I understand, it should be allowed as I have the ip in trusted networks?

Thanks a lot for the help

Bart

Re: 401 basics

Posted: Sunday 22 December 2024 19:54
by waltervl
Change the trusted network IP to "127.0.0.*,192.168.0.*"
Also no spaces in this setting, there is now a space afte the comma (could be typing error).

Re: 401 basics

Posted: Monday 23 December 2024 22:30
by skippy711
Just checked and on the settings page it says that the trusted networks should be separated by a semicolon (and not a comma). Perhaps it's worth a try.