You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a program that can set the WiFi network of a camera connected via ethernet without having to use the camera's configuration utility. I have multiple different brand ONVIF cams so that would be convenient. I have seen the ability to set a network in other ONVIF/IP cam control software, so I'm sure it's possible.
I looked through the ONVIF documentation and found the GetDot11Status and SetNetworkInterfaces commands, which weren't implemented in the library. Luckily, it didn't seem that difficult to add them in using the existing functions for reference. But now that I did, it's not working!
I know this isn't the library's fault, but I'm hoping someone here knows what I'm doing wrong on a protocol level... Since clearly the data itself is getting to the camera, it's just not doing what I want.
In the case of GetDot11Status, it works, but the ONE piece of info I want, the SSID, is just left blank. In the case of SetNetworkInterfaces, it gives me an error code even though I'm sure I'm giving it the right data based on the spec here.
functionparseSoap(o){//Builds XML string recursivelylets='',k;for(kino)s+=`<tds:${k}>${typeofo[k]=='object'?parseSoap(o[k]):o[k]}</tds:${k}>`;returns;}cam.services.device.getDot11Stat=asyncfunction(t){returnawaitonvif._OnvifSoap.requestCommand(this.oxaddr,'GetDot11Status',this._createRequestSoap(parseSoap({GetDot11Status:{InterfaceToken:t}})));}cam.services.device.setNetwork=asyncfunction(o){returnawaitonvif._OnvifSoap.requestCommand(this.oxaddr,'SetNetworkInterfaces',this._createRequestSoap(parseSoap({SetNetworkInterfaces:o})));}//Note: InterfaceToken hard-coded based on token given in getZeroConfiguration, it's always "eth0"console.log(cam.services.device.getDot11Stat("eth0"));//Works, but SSID field blankconsole.log(cam.services.device.setNetwork({InterfaceToken:"eth0",NetworkInterface:{IPv4:{DHCP:true},Extension:{Dot11:{SSID:"TestNetwork",Mode:"Infrastructure",Security:{Mode:"WEP",PSK:{Passphrase:"Password123"}}}}}}));//Causes 400 error "IPv4 invalid"
The text was updated successfully, but these errors were encountered:
I'm trying to make a program that can set the WiFi network of a camera connected via ethernet without having to use the camera's configuration utility. I have multiple different brand ONVIF cams so that would be convenient. I have seen the ability to set a network in other ONVIF/IP cam control software, so I'm sure it's possible.
I looked through the ONVIF documentation and found the
GetDot11Status
andSetNetworkInterfaces
commands, which weren't implemented in the library. Luckily, it didn't seem that difficult to add them in using the existing functions for reference. But now that I did, it's not working!I know this isn't the library's fault, but I'm hoping someone here knows what I'm doing wrong on a protocol level... Since clearly the data itself is getting to the camera, it's just not doing what I want.
In the case of GetDot11Status, it works, but the ONE piece of info I want, the SSID, is just left blank. In the case of SetNetworkInterfaces, it gives me an error code even though I'm sure I'm giving it the right data based on the spec here.
The text was updated successfully, but these errors were encountered: