Skip to content

Unable to set IP Address #40

@Lythinari

Description

@Lythinari

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions