

























easycwmpd 是 EasyCwmp 这个开源 CWMP(CPE WAN Management Protocol) 客户端软件的核心后台守护进程(daemon)。
easycwmp 支持通过 --json-input 参数,以交互式JSON命令的方式模拟ACS的RPC调用,非常适合用来测试特定参数的 get 和 set 脚本逻辑是否正确。
easycwmpd 通过 ubus 与OpenWrt系统通信。如果 ubus list 输出中看不到 tr069,说明通信可能有问题,可以尝试手动设置 ubus 套接字路径后重启服务:
root@LWrt:~#
root@LWrt:~# cat /etc/config/easycwmp
config local
option enable '1'
option interface 'wan'
option port '7547'
option ubus_socket '/var/run/ubus.sock'
option date_format '%FT%T%z'
option username 'easycwmp'
option password 'easycwmp'
option authentication 'Digest'
option logging_level '3'
config acs
option url 'http://192.168.1.110:8080/openacs/acs'
option username 'easycwmp'
option password 'easycwmp'
option periodic_enable '1'
option periodic_interval '100'
option periodic_time '0001-01-01T00:00:00Z'
config device
option manufacturer 'LWrt'
option oui '9483C4'
option product_class 'Generic'
option serial_number '9483C40C47E6'
option hardware_version 'v0'
option software_version 'r37854-4b24da3b4c5c'
root@LWrt:~#
root@LWrt:~# ps -ef | grep easycwmp
7242 root 8344 S /usr/sbin/easycwmpd -f --boot
31319 root 1424 S grep easycwmp
root@LWrt:~#
root@LWrt:~# easycwmp -h USAGE: /usr/sbin/easycwmp command [parameter] [values] command: get [value|notification|name] set [value|notification] apply [value|notification|object|service] add [object] delete [object] download upload factory_reset reboot inform [parameter|device_id] --json-input invalid action '-h' root@LWrt:~#
root@LWrt:~# easycwmp get value
{ "parameter": "Device.DeviceInfo.SpecVersion", "value": "1.0" }
{ "parameter": "Device.DeviceInfo.ProvisioningCode", "value": "" }
{ "parameter": "Device.DeviceInfo.Manufacturer", "value": "LWrt" }
{ "parameter": "Device.DeviceInfo.ManufacturerOUI", "value": "9483C4" }
{ "parameter": "Device.DeviceInfo.ModelName", "value": "GL-MT300N-V2" }
{ "parameter": "Device.DeviceInfo.ProductClass", "value": "Generic" }
{ "parameter": "Device.DeviceInfo.SerialNumber", "value": "9483C40C47E6" }
{ "parameter": "Device.DeviceInfo.HardwareVersion", "value": "v0" }
{ "parameter": "Device.DeviceInfo.SoftwareVersion", "value": "r37854-4b24da3b4c5c" }
{ "parameter": "Device.DeviceInfo.UpTime", "value": "1328", "type": "xsd:unsignedInt" }
{ "parameter": "Device.DeviceInfo.DeviceLog", "value": "" }
{ "parameter": "Device.DeviceInfo.MemoryStatus.Total", "value": "250556" }
{ "parameter": "Device.DeviceInfo.MemoryStatus.Free", "value": "120244" }
{ "parameter": "Device.DHCPv4.Server.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.Status", "value": "Enabled" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.Interface", "value": "Device.IP.Interface.2." }
{ "parameter": "Device.DHCPv4.Server.Pool.1.MinAddress", "value": "192.168.100.100" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.MaxAddress", "value": "192.168.100.250" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.SubnetMask", "value": "255.255.255.0" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.DNSServers", "value": "" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.IPRouters", "value": "192.168.100.1\/24" }
{ "parameter": "Device.DHCPv4.Server.Pool.1.LeaseTime", "value": "43200", "type": "xsd:int" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.Enable", "value": "0", "type": "xsd:boolean" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.Status", "value": "Disabled" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.Interface", "value": "Device.IP.Interface.3." }
{ "parameter": "Device.DHCPv4.Server.Pool.2.MinAddress", "value": "192.168.110.0" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.MaxAddress", "value": "192.168.110.0" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.SubnetMask", "value": "255.255.255.0" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.DNSServers", "value": "192.168.110.1" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.IPRouters", "value": "192.168.110.93" }
{ "parameter": "Device.DHCPv4.Server.Pool.2.LeaseTime", "value": "0", "type": "xsd:int" }
{ "parameter": "Device.IP.Interface.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.IP.Interface.1.Name", "value": "loopback" }
{ "parameter": "Device.IP.Interface.1.Type", "value": "Loopback" }
{ "parameter": "Device.IP.Interface.1.IPv4AddressNumberOfEntries", "value": "1", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.IPv4Address.1.IPAddress", "value": "127.0.0.1" }
{ "parameter": "Device.IP.Interface.1.IPv4Address.1.AddressingType", "value": "Static" }
{ "parameter": "Device.IP.Interface.1.IPv4Address.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.IP.Interface.1.IPv4Address.1.SubnetMask", "value": "255.0.0.0" }
{ "parameter": "Device.IP.Interface.1.Stats.BytesSent", "value": "68316", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.Stats.BytesReceived", "value": "68316", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.Stats.PacketsSent", "value": "952", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.Stats.PacketsReceived", "value": "952", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.Stats.ErrorsSent", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.Stats.ErrorsReceived", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.Stats.DiscardPacketsSent", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.1.Stats.DiscardPacketsReceived", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.IP.Interface.2.Name", "value": "lan" }
{ "parameter": "Device.IP.Interface.2.Type", "value": "Normal" }
{ "parameter": "Device.IP.Interface.2.IPv4AddressNumberOfEntries", "value": "1", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.IPv4Address.1.IPAddress", "value": "192.168.100.1" }
{ "parameter": "Device.IP.Interface.2.IPv4Address.1.AddressingType", "value": "Static" }
{ "parameter": "Device.IP.Interface.2.IPv4Address.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.IP.Interface.2.IPv4Address.1.SubnetMask", "value": "255.255.255.0" }
{ "parameter": "Device.IP.Interface.2.Stats.BytesSent", "value": "4957296", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Stats.BytesReceived", "value": "878582", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Stats.PacketsSent", "value": "5201", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Stats.PacketsReceived", "value": "4390", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Stats.ErrorsSent", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Stats.ErrorsReceived", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Stats.DiscardPacketsSent", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.2.Stats.DiscardPacketsReceived", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.IP.Interface.3.Name", "value": "wan" }
{ "parameter": "Device.IP.Interface.3.Type", "value": "Normal" }
{ "parameter": "Device.IP.Interface.3.IPv4AddressNumberOfEntries", "value": "1", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.IPv4Address.1.IPAddress", "value": "192.168.110.93" }
{ "parameter": "Device.IP.Interface.3.IPv4Address.1.AddressingType", "value": "DHCP" }
{ "parameter": "Device.IP.Interface.3.IPv4Address.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.IP.Interface.3.IPv4Address.1.SubnetMask", "value": "255.255.255.0" }
{ "parameter": "Device.IP.Interface.3.Stats.BytesSent", "value": "964083", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Stats.BytesReceived", "value": "4870554", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Stats.PacketsSent", "value": "5440", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Stats.PacketsReceived", "value": "6773", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Stats.ErrorsSent", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Stats.ErrorsReceived", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Stats.DiscardPacketsSent", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Interface.3.Stats.DiscardPacketsReceived", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.DiagnosticsState", "value": "None" }
{ "parameter": "Device.IP.Diagnostics.IPPing.Host", "value": "" }
{ "parameter": "Device.IP.Diagnostics.IPPing.NumberOfRepetitions", "value": "3", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.Timeout", "value": "1000", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.DataBlockSize", "value": "64", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.SuccessCount", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.FailureCount", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.AverageResponseTime", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.MinimumResponseTime", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.IP.Diagnostics.IPPing.MaximumResponseTime", "value": "0", "type": "xsd:unsignedInt" }
{ "parameter": "Device.ManagementServer.URL", "value": "http:\/\/192.168.1.110:8080\/openacs\/acs" }
{ "parameter": "Device.ManagementServer.Username", "value": "easycwmp" }
{ "parameter": "Device.ManagementServer.Password", "value": "" }
{ "parameter": "Device.ManagementServer.PeriodicInformEnable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.ManagementServer.PeriodicInformInterval", "value": "100", "type": "xsd:unsignedInt" }
{ "parameter": "Device.ManagementServer.PeriodicInformTime", "value": "0001-01-01T00:00:00Z", "type": "xsd:dateTime" }
{ "parameter": "Device.ManagementServer.ConnectionRequestURL", "value": "http:\/\/192.168.110.93:7547\/" }
{ "parameter": "Device.ManagementServer.ConnectionRequestUsername", "value": "easycwmp" }
{ "parameter": "Device.ManagementServer.ConnectionRequestPassword", "value": "" }
{ "parameter": "Device.ManagementServer.ParameterKey", "value": "" }
{ "parameter": "Device.WiFi.Radio.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.WiFi.Radio.1.Status", "value": "Up" }
{ "parameter": "Device.WiFi.Radio.1.Name", "value": "radio0" }
{ "parameter": "Device.WiFi.Radio.1.SupportedFrequencyBands", "value": "" }
{ "parameter": "Device.WiFi.Radio.1.OperatingFrequencyBand", "value": "" }
{ "parameter": "Device.WiFi.Radio.1.ChannelsInUse", "value": "" }
{ "parameter": "Device.WiFi.Radio.1.Channel", "value": "7", "type": "xsd:unsignedInt" }
{ "parameter": "Device.WiFi.Radio.1.AutoChannelSupported", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.WiFi.Radio.1.AutoChannelEnable", "value": "0", "type": "xsd:boolean" }
{ "parameter": "Device.WiFi.Radio.1.OperatingStandards", "value": "HT20" }
{ "parameter": "Device.WiFi.SSID.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.WiFi.SSID.1.Status", "value": "Up" }
{ "parameter": "Device.WiFi.SSID.1.Name", "value": "phy0-ap0" }
{ "parameter": "Device.WiFi.SSID.1.LowerLayers", "value": "Device.WiFi.Radio.1." }
{ "parameter": "Device.WiFi.SSID.1.SSID", "value": "WelcomeNDS" }
{ "parameter": "Device.WiFi.SSID.1.X_IPInterface", "value": "Device.IP.Interface.2." }
{ "parameter": "Device.WiFi.AccessPoint.1.Enable", "value": "1", "type": "xsd:boolean" }
{ "parameter": "Device.WiFi.AccessPoint.1.Status", "value": "Enabled" }
{ "parameter": "Device.WiFi.AccessPoint.1.SSIDReference", "value": "Device.WiFi.SSID.1." }
{ "parameter": "Device.WiFi.AccessPoint.1.Security.ModesSupported", "value": "None,WEP-64,WEP-128,WPA-Personal,WPA2-Personal,WPA-WPA2-Personal,WPA3-Personal,WP2-WPA3-Personal,WPA-Enterprise,WPA2-Enterprise,WPA-WPA2-Enterprise,WPA3-Enterprise" }
{ "parameter": "Device.WiFi.AccessPoint.1.Security.ModeEnabled", "value": "None" }
{ "parameter": "Device.WiFi.AccessPoint.1.Security.WEPKey", "value": "", "type": "xsd:hexBinary" }
{ "parameter": "Device.WiFi.AccessPoint.1.Security.PreSharedKey", "value": "", "type": "xsd:hexBinary" }
{ "parameter": "Device.WiFi.AccessPoint.1.Security.KeyPassphrase", "value": "" }
root@LWrt:~#
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。