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

Unable to set IP Address #40

Open
Lythinari opened this issue Nov 3, 2023 · 0 comments
Open

Unable to set IP Address #40

Lythinari opened this issue Nov 3, 2023 · 0 comments

Comments

@Lythinari
Copy link

Id just like to prefix this with the fact that Im using a cheap ONVIF camera.
But wondering whether Im doing something wrong, response returns "false" however I cant connect to the camera on the new IP address.

Ive have managed to do other Get calls, but unable to perform this Set call.

dev, err := onvif.NewDevice(onvif.DeviceParams{
	Xaddr:      "192.168.1.10:8899",
	Username:   "admin",
	Password:   "",
	HttpClient: new(http.Client),
})
if err != nil {
	panic(err)
}


prefxedIpv4Address := xsdonvif.PrefixedIPv4Address{Address: "192.168.1.2", PrefixLength: 24}

ipv4NetworkInterfaceSetConfiguration := xsdonvif.IPv4NetworkInterfaceSetConfiguration{Enabled: true, Manual: prefxedIpv4Address, DHCP: true}

networkInterfaceSetConfiguration := xsdonvif.NetworkInterfaceSetConfiguration{Enabled: true, IPv4: ipv4NetworkInterfaceSetConfiguration}

setNetworkInterfaces := device.SetNetworkInterfaces{InterfaceToken: "eth0", NetworkInterface: networkInterfaceSetConfiguration}

setNetworkInterfaceResponse, err := sdk.Call_SetNetworkInterfaces(ctx, dev, setNetworkInterfaces)
if err != nil {
	log.Println(err)
} else {
	fmt.Println(setNetworkInterfaceResponse)
}
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

1 participant