View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000277 | easycwmp | Help | public | 2017-08-08 12:28 | 2017-08-09 11:41 |
Reporter | andy_yang | Assigned To | mohamed.kallel | ||
Priority | immediate | Severity | block | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Platform | openwrt | OS | openwrt | OS Version | linux.2.6 |
Summary | 0000277: AddObject method return 9005: 'Invalid parameter name' when Add a WANConnectionDevice object. | ||||
Description | I don't know how to AddObject method, I try write a function "wan_device_add_instances_wancxdev" in the common_execute_method_obj "$DMROOT.WANDevice.1.WANConnectionDevice." to Add a WANConnectionDevice object. But, the result is the easycwmp return 9005: 'Invalid parameter name'. please refere to my script file "wan_device" in the attachment! Thanks! | ||||
Steps To Reproduce | 1.ACS send AddObject method 2.check | ||||
Additional Information | < HTTP/1.1 200 OK < Content-Type: text/xml; charset="utf-8" < Content-Length: 387 < +++ RECEIVED HTTP RESPONSE +++ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand="1">2</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body><cwmp:InformResponse><MaxEnvelopes>1</MaxEnvelopes></cwmp:InformResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> --- RECEIVED HTTP RESPONSE --- 2017-08-08 18:30:20 [easycwmp] NOTICE - receive InformResponse from the ACS 2017-08-08 18:30:20 [easycwmp] NOTICE - send empty message to the ACS +++ SEND EMPTY HTTP REQUEST +++ > POST /ACS-server/ACS HTTP/1.1 Host: 192.168.4.11:9090 User-Agent: easycwmp Content-Type: text/xml; charset="utf-8" Content-Length: 0 < HTTP/1.1 200 OK < Content-Type: text/xml; charset="utf-8" < Content-Length: 690 < +++ RECEIVED HTTP RESPONSE +++ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand="1">-15950</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><cwmp:AddObject><ObjectName xsi:type="cwmp:ObjectNameType">InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.</ObjectName><ParameterKey xsi:type="cwmp:ParameterKeyType"></ParameterKey></cwmp:AddObject></SOAP-ENV:Body></SOAP-ENV:Envelope> --- RECEIVED HTTP RESPONSE --- 2017-08-08 18:30:21 [easycwmp] NOTICE - received AddObject method from the ACS 2017-08-08 18:30:21 [easycwmp] NOTICE - external: execute add object InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1. 2017-08-08 18:30:21 [easycwmp] NOTICE - Fault in the param: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1., Fault code: 9005 2017-08-08 18:30:21 [easycwmp] NOTICE - send Fault: 9005: 'Invalid parameter name' +++ SEND HTTP REQUEST +++ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <soap_env:Envelope xmlns:soap_env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap_enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cwmp="urn:dslforum-org:cwmp-1-0"> <soap_env:Header> <cwmp:ID soap_env:mustUnderstand="1">-15950</cwmp:ID> </soap_env:Header> <soap_env:Body> <soap_env:Fault> <faultcode>Client</faultcode> <faultstring>CWMP fault</faultstring> <detail> <cwmp:Fault> <FaultCode>9005</FaultCode> <FaultString>Invalid parameter name</FaultString> </cwmp:Fault> </detail> </soap_env:Fault> </soap_env:Body> </soap_env:Envelope> --- SEND HTTP REQUEST --- > POST /ACS-server/ACS HTTP/1.1 Host: 192.168.4.11:9090 User-Agent: easycwmp Content-Type: text/xml; charset="utf-8" SOAPAction: Content-Length: 760 < HTTP/1.1 200 OK < Content-Type: text/xml; charset="utf-8" < Content-Length: 0 < +++ RECEIVED EMPTY HTTP RESPONSE +++ | ||||
Tags | No tags attached. | ||||
e-mail notification | |||||
|
wan_device (4,502 bytes)
#!/bin/sh # Copyright (C) 2015 PIVA Software <www.pivasoftware.com> # Author: MOHAMED Kallel <mohamed.kallel@pivasoftware.com> ############################# # Entry point functuons # ############################# prefix_list="$prefix_list $DMROOT.WANDevice." entry_execute_method_list="$entry_execute_method_list entry_execute_method_root_WANDevice" entry_execute_method_list_forcedinform="$entry_execute_method_list_forcedinform entry_execute_method_root_WANDevice" entry_execute_method_root_WANDevice() { case "$1" in ""|"$DMROOT."|"$DMROOT.WANDevice."*) common_execute_method_obj "$DMROOT.WANDevice." "0" common_execute_method_obj "$DMROOT.WANDevice.1." "0" common_execute_method_obj "$DMROOT.WANDevice.1.WANConnectionDevice." "1" "wan_device_add_instances_wancxdev $1" "" "wan_device_browse_instances_wancxdev $1" return 0 ;; esac return $E_INVALID_PARAMETER_NAME; } sub_entry_wandevice_wanconnectiondevice() { local j="$2" local iface="$3" local protocol="$4" local default="$5" case_param "$1" belongto "$DMROOT.WANDevice.1.WANConnectionDevice.$j." && { common_execute_method_obj "$DMROOT.WANDevice.1.WANConnectionDevice.$j." "0" case $protocol in IP) common_execute_method_obj "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANIPConnection." "0" common_execute_method_obj "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANIPConnection.1." "0" common_execute_method_param "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANIPConnection.1.ConnectionStatus" "0" "wan_device_get_ipcx_status" common_execute_method_param "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANIPConnection.1.ExternalIPAddress" "0" "wan_device_get_ipcx_ipaddr $iface" "" "" "$default" common_execute_method_param "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANIPConnection.1.MACAddress" "0" "wan_device_get_ipcx_macaddr $iface" ;; PPP) common_execute_method_obj "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANPPPConnection." "0" common_execute_method_obj "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANPPPConnection.1." "0" common_execute_method_param "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANPPPConnection.1.Enable" "1" "wan_device_get_ipcx_macaddr $iface" "wan_device_set_wan_ppp_enable $iface" "xsd:boolean" common_execute_method_param "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANPPPConnection.1.Username" "1" "$UCI_GET network.$iface.username" "wan_device_set_wan_ppp_cfg network.$iface.username" common_execute_method_param "$DMROOT.WANDevice.1.WANConnectionDevice.$j.WANPPPConnection.1.Password" "1" "" "wan_device_set_wan_ppp_cfg network.$iface.password" ;; esac return 0 } return $E_INVALID_PARAMETER_NAME; } ####################################### # Data model add instances # ####################################### wan_device_add_instances_wancxdev() { echo "wan_device_add_instances_wancxdev">/tmp/test.txt return 0; } ####################################### # Data model browse instances # ####################################### wan_device_browse_instances_wancxdev() { local map maps=`wan_device_get_interface_maps` for map in $maps; do local iface=${map%%:*} map=${map#*:} local j=${map%%:*} map=${map#*:} local protocol=${map%%:*} local default=${map#*:} sub_entry_wandevice_wanconnectiondevice "$1" "$j" "$iface" "$protocol" "$default" done return 0; } ####################################### # Data model parameters functions # ####################################### wan_device_get_interface_maps() { #should return a list like this: "<interface1>:<instance1>:<protocol>:<default interface? 1 : 0> <interface2>:<instance>:<protocol>:<default interface? 1 : 0>" echo "mng:1:IP:1 wan:2:PPP:0" } wan_device_get_ipcx_status() { echo "Connected" } wan_device_get_ipcx_ipaddr() { local val iface="$1" network_get_ipaddr val "$iface" echo "$val" } wan_device_get_ipcx_macaddr() { local val iface="$1" if [ -z "$default_wan_device_mng_interface_mac" ]; then val=`$UCI_GET network.$iface.macaddr` else val=$default_wan_device_mng_interface_mac fi echo $val } wan_device_get_wan_ppp_enable() { local iface="$1" local val=`$UCI_GET network.$iface.auto` echo ${val:-1} } wan_device_set_wan_ppp_enable() { local iface="$1" local val="$2" common_set_bool "network.$iface.auto" "$val" "1" "0" local e="$?" [ "$e" != "0" ] && return $e return 0 } wan_device_set_wan_ppp_cfg() { local cfg="$1" local val="$2" $UCI_SET $cfg="$val" return 0 } |
|
when ACS send AddObject method again! I found that the easycwmp return 9002: 'Internal error'. It's so strange!!! +++ RECEIVED HTTP RESPONSE +++ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand="1">-15970</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><cwmp:AddObject><ObjectName xsi:type="cwmp:ObjectNameType">InternetGatewayDevice.WANDevice.1.WANConnectionDevice.</ObjectName><ParameterKey xsi:type="cwmp:ParameterKeyType"></ParameterKey></cwmp:AddObject></SOAP-ENV:Body></SOAP-ENV:Envelope> --- RECEIVED HTTP RESPONSE --- 2017-08-08 18:42:54 [easycwmp] NOTICE - received AddObject method from the ACS 2017-08-08 18:42:54 [easycwmp] NOTICE - external: execute add object InternetGatewayDevice.WANDevice.1.WANConnectionDevice. 2017-08-08 18:42:54 [easycwmp] NOTICE - Fault in the param: InternetGatewayDevice.WANDevice.1.WANConnectionDevice., Fault code: 9002 2017-08-08 18:42:54 [easycwmp] NOTICE - send Fault: 9002: 'Internal error' +++ SEND HTTP REQUEST +++ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <soap_env:Envelope xmlns:soap_env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap_enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cwmp="urn:dslforum-org:cwmp-1-0"> <soap_env:Header> <cwmp:ID soap_env:mustUnderstand="1">-15970</cwmp:ID> </soap_env:Header> <soap_env:Body> <soap_env:Fault> <faultcode>Server</faultcode> <faultstring>CWMP fault</faultstring> <detail> <cwmp:Fault> <FaultCode>9002</FaultCode> <FaultString>Internal error</FaultString> </cwmp:Fault> </detail> </soap_env:Fault> </soap_env:Body> </soap_env:Envelope> --- SEND HTTP REQUEST --- > POST /ACS-server/ACS HTTP/1.1 Host: 192.168.4.11:9090 User-Agent: easycwmp Content-Type: text/xml; charset="utf-8" SOAPAction: Content-Length: 752 |
|
Your add obj function: wan_device_add_instances_wancxdev() should echo at the end the instance number of the new added object. Please follow the example of add_wifi_iface() in the TR181 WiFi param: https://github.com/pivasoftware/easycwmp/blob/master/ext/openwrt/scripts/functions/tr181/wifi |
|
OK! thanks, I have solved my problem. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-08-08 12:28 | andy_yang | New Issue | |
2017-08-08 12:28 | andy_yang | File Added: wan_device | |
2017-08-08 12:37 | andy_yang | Note Added: 0000754 | |
2017-08-09 11:15 | mohamed.kallel | Note Added: 0000755 | |
2017-08-09 11:26 | andy_yang | Note Added: 0000756 | |
2017-08-09 11:41 | mohamed.kallel | Status | new => resolved |
2017-08-09 11:41 | mohamed.kallel | Resolution | open => no change required |
2017-08-09 11:41 | mohamed.kallel | Assigned To | => mohamed.kallel |