EasyCwmp - easycwmp
View Issue Details
0000346easycwmp[All Projects] Helppublic2018-07-19 09:262018-08-10 12:54
arukona 
 
normalminoralways
newopen 
ARMlinux
0000346: easycwmp client stuck and not making connection with ACS server
Hi,

I have cross compiled easycwmp client and all dependencies for
arm-cortexa9-linux-gbueabi. I've followed instruction given here
http://www.easycwmp.org/install.html# [^] for EasyCwmp install for
other Linux distributions.

I have copied required libraries / binaries etc to hardware box
and started genieacs and easycemp client. The easycwmp client got
stuck and logs on the screen as below.

root@phyFLEX-i:~ /usr/sbin/easycwmpd -f -b
2018-07-19 06:54:12 [easycwmp] NOTICE - add event '0 BOOTSTRAP'
2018-07-19 06:54:12 [easycwmp] NOTICE - external script init
config_init_local(59):: easycwmp.@local[0].interface=eth0
config_init_local(69):: easycwmp.@local[0].port=7547
config_init_local(87):: easycwmp.@local[0].ubus_socket=/var/run/ubus.sock
config_init_local(75):: easycwmp.@local[0].username=easycwmp
config_init_local(81):: easycwmp.@local[0].password=easycwmp
config_init_local(109):: easycwmp.@local[0].authentication=Digest
config_init_local(98):: easycwmp.@local[0].logging_level=3
config_init_acs(174):: easycwmp.@acs[0].url=http://192.168.0.210:7547/ [^]
config_init_acs(180):: easycwmp.@acs[0].username=easycwmp
config_init_acs(186):: easycwmp.@acs[0].password=easycwmp
config_init_acs(192):: easycwmp.@acs[0].periodic_enable=1
config_init_acs(198):: easycwmp.@acs[0].periodic_interval=100
config_init_acs(205):: easycwmp.@acs[0].periodic_time=0001-01-01T00:00:00Z
2018-07-19 06:54:13 [easycwmp] NOTICE - add event '0 BOOTSTRAP'
2018-07-19 06:54:13 [easycwmp] NOTICE - init periodic inform: reference time = n/a, interval = 100
2018-07-19 06:54:13 [easycwmp] NOTICE - external: execute update_value_change
2018-07-19 06:54:13 [easycwmp] NOTICE - daemon started
2018-07-19 06:54:13 [easycwmp] NOTICE - external: execute inform device_id
cwmp_init_deviceid(642): in device you must define product_class
2018-07-19 06:54:13 [easycwmp] NOTICE - external script exit

After seeing the code it seems the client (easycwmpd) is waiting for
easycwmp --json-input to exit and but it is not and as a result it is in infinite loop

root@phyFLEX-i:~ ps -aef | grep easycwmp
root 4288 4130 0 06:54 pts/4 00:00:00 /usr/sbin/easycwmpd -f -b
root 4289 4288 0 06:54 pts/4 00:00:00 /bin/sh /usr/sbin/easycwmp --json-input
root 4302 4297 0 06:55 pts/6 00:00:00 grep easycwmp

Also some information as below based on similar issue in easycwmp support site

root@phyFLEX-i:~ easycwmp --json-input
easycwmp>
{"command": "inform", "class": "device_id"}
easycwmp> (<--------blank no output here)



root@phyFLEX-i:~ easycwmp --json-input
easycwmp>
{"command": "get", "class": "value"}
easycwmp> (<--------blank no output here)

Please suggest what I'm missing it to make client communicate with server

Also one information that on my box for dependencies (curl, json-c, libubox, ubus, uci, microxml) the make install is not executed as compilation is done on virtual machine with required toolchain so I copied required libraries and binararies and created softlinks as suggested to install webpage

Please provide valuable feedback / pointer to proceed further.

Thanks,
No tags attached.
Issue History
2018-07-19 09:26arukonaNew Issue
2018-07-20 11:30mohamed.kallelNote Added: 0000889
2018-07-20 12:38arukonaNote Added: 0000890
2018-07-20 13:11mohamed.kallelNote Added: 0000891
2018-07-20 13:18arukonaNote Added: 0000892
2018-07-20 14:54arukonaNote Added: 0000893
2018-07-20 15:47mohamed.kallelNote Added: 0000894
2018-07-20 16:36arukonaNote Added: 0000895
2018-08-06 07:45arukonaNote Added: 0000896
2018-08-06 16:40mohamed.kallelNote Added: 0000897
2018-08-06 17:56mohamed.kallelNote Edited: 0000897bug_revision_view_page.php?bugnote_id=897#r370
2018-08-07 10:05arukonaNote Added: 0000898
2018-08-07 11:22arukonaNote Deleted: 0000898
2018-08-09 09:19arukonaNote Added: 0000899
2018-08-10 08:58arukonaNote Added: 0000900
2018-08-10 09:18arukonaNote Added: 0000901
2018-08-10 09:18arukonaNote Edited: 0000901bug_revision_view_page.php?bugnote_id=901#r372
2018-08-10 09:19arukonaNote Edited: 0000901bug_revision_view_page.php?bugnote_id=901#r373
2018-08-10 09:20arukonaNote Edited: 0000901bug_revision_view_page.php?bugnote_id=901#r374
2018-08-10 09:20arukonaNote Edited: 0000901bug_revision_view_page.php?bugnote_id=901#r375
2018-08-10 09:21arukonaNote Edited: 0000901bug_revision_view_page.php?bugnote_id=901#r376
2018-08-10 12:54arukonaNote Edited: 0000901bug_revision_view_page.php?bugnote_id=901#r377

Notes
(0000889)
mohamed.kallel   
2018-07-20 11:30   
you have some issue in json package. may be there is some scripts from json package are not installed.

To guaranty that your easycwmp is well installed, you should got output of the following command:

Linux$ easycwmp inform
{ "parameter": "Device.DeviceInfo.SpecVersion", "value": "1.0" }
{ "parameter": "Device.DeviceInfo.ProvisioningCode", "value": "" }
{ "parameter": "Device.DeviceInfo.Manufacturer", "value": "" }
{ "parameter": "Device.DeviceInfo.ManufacturerOUI", "value": "" }
{ "parameter": "Device.DeviceInfo.ProductClass", "value": "" }
{ "parameter": "Device.DeviceInfo.SerialNumber", "value": "" }
{ "parameter": "Device.DeviceInfo.HardwareVersion", "value": "" }
{ "parameter": "Device.DeviceInfo.SoftwareVersion", "value": "" }
{ "parameter": "Device.ManagementServer.ConnectionRequestURL", "value": "" }
{ "parameter": "Device.ManagementServer.ParameterKey", "value": "" }
(0000890)
arukona   
2018-07-20 12:38   
Hi,

Thanks for your response.

On the box, I am able to get following output for the command you suggested to execute.

phyFLEX-i.MX6 login: root
root@phyFLEX-i:~ easycwmp inform
{ "parameter": "Device.DeviceInfo.SpecVersion", "value": "1.0" }
{ "parameter": "Device.DeviceInfo.ProvisioningCode", "value": "" }
{ "parameter": "Device.DeviceInfo.Manufacturer", "value": "easycwmp" }
{ "parameter": "Device.DeviceInfo.ManufacturerOUI", "value": "FFFFFF" }
{ "parameter": "Device.DeviceInfo.ProductClass", "value": "easycwmp" }
{ "parameter": "Device.DeviceInfo.SerialNumber", "value": "FFFFFF123456" }
{ "parameter": "Device.DeviceInfo.HardwareVersion", "value": "example_hw_version" }
{ "parameter": "Device.DeviceInfo.SoftwareVersion", "value": "example_sw_version" }
{ "parameter": "Device.ManagementServer.ConnectionRequestURL", "value": "http:\/\/192.168.0.200:7547\/" }
{ "parameter": "Device.ManagementServer.ParameterKey", "value": "" }
root@phyFLEX-i:~
root@phyFLEX-i:~
root@phyFLEX-i:~

and there is no connection b/w client and server. Please provide your valuable feedback / pointer
(0000891)
mohamed.kallel   
2018-07-20 13:11   
Try now the following command

Linux$ easycwmp --json-input

And then input the following json message:

easycwmp>
{"command": "inform"}

you should got the same output you did with "easycwmp inform"
(0000892)
arukona   
2018-07-20 13:18   
I am not getting any output in this case, it is blank, please refer below

root@phyFLEX-i:~
root@phyFLEX-i:~ easycwmp --json-input
easycwmp>
{"command": "inform"}
easycwmp>

Please advice
(0000893)
arukona   
2018-07-20 14:54   
This is what json related files on my box, just in case if it helps

root@phyFLEX-i:~ find / -name json*
/opt/dev/easycwmp/src/json.c
/opt/dev/easycwmp/src/json.h
/usr/lib/python2.6/json
/usr/lib/python3.1/json
/usr/include/json
/usr/include/json-c
/usr/include/json-c/json-c
/usr/include/json-c/json.h
/usr/include/json-c/json_c_version.h
/usr/include/json-c/json_visit.h
/usr/include/json-c/json_tokener.h
/usr/include/json-c/json_inttypes.h
/usr/include/json-c/json_object_iterator.h
/usr/include/json-c/json_object.h
/usr/include/json-c/json_util.h
/usr/include/json-c/json_config.h
/usr/include/json-c/json_pointer.h
/usr/local/include/libubox/json_script.h
root@phyFLEX-i:~
root@phyFLEX-i:~ find / -name libjson*
/usr/lib/libjson-c.la
/usr/lib/libjson-c.so
/usr/lib/libjson-c.so.4.0.0
/usr/lib/libjson-c.so.4
/usr/lib/libjson-c.a
/usr/local/lib/libjson_script.so
root@phyFLEX-i:~

and the soft link I created as part of install

root@phyFLEX-i:~ ll /usr/include/json
lrwxrwxrwx 1 root root 19 Jul 12 14:02 /usr/include/json -> /usr/include/json-c
root@phyFLEX-i:~
(0000894)
mohamed.kallel   
2018-07-20 15:47   
what is your default sh ?

ls -l /bin/sh
(0000895)
arukona   
2018-07-20 16:36   
Here it is

root@phyFLEX-i:~ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jul 20 10:31 /bin/sh -> bash
root@phyFLEX-i:~
(0000896)
arukona   
2018-08-06 07:45   
Hi,

Request your help in debugging this or let me know some pointer

Thanks,
(0000897)
mohamed.kallel   
2018-08-06 16:40   
(edited on: 2018-08-06 17:56)
You have some issue with your json installation on your linux
The json.sh (from json-c package) seems does not work properly on your linux platform for some reasons.
you have to check that

(0000899)
arukona   
2018-08-09 09:19   
Hi,

Since I copied executable and library manually so there was issue with default PATH variable. When I edited it for correct path(s) the tr069 client is able to make connection with genieacs ACS server

HTTP inform sent by client is responded back by server but in keep alive mode when client is trying to send empty http request it results into
* The requested URL returned error: 400

For more detail refer below and let me know any pointer to debug this further.

--- RECEIVED HTTP RESPONSE ---
2018-08-09 07:15:49 [easycwmp] NOTICE - receive InformResponse from the ACS
2018-08-09 07:15:49 [easycwmp] NOTICE - send empty message to the ACS
+++ SEND EMPTY HTTP REQUEST +++
> POST / HTTP/1.1
Host: 192.168.0.210:7547
User-Agent: easycwmp
Content-Type: text/xml; charset="utf-8"
Content-Length: 0

* The requested URL returned error: 400
2018-08-09 07:15:49 [easycwmp] NOTICE - LibCurl Error: The requested URL returned error: 400
2018-08-09 07:15:49 [easycwmp] NOTICE - sending http message failed
cwmp_handle_messages(351): sending http message failed
cwmp_inform(315): handling xml message failed
2018-08-09 07:15:49 [easycwmp] NOTICE - external: execute apply service
2018-08-09 07:15:49 [easycwmp] NOTICE - external script exit
(0000900)
arukona   
2018-08-10 08:58   
Hi,

Let me know some pointer to debug this further as I am not able to understand that why client is not able to send empty http request when he just sent one http request as part of Inform so communication is through b/w client and server.

Regards,
(0000901)
arukona   
2018-08-10 09:18   
(edited on: 2018-08-10 12:54)
Also I see on successful case (simulated client and server on x86 platform) the logs in geniacs as below. Difference I see in content of InformEvent being

"1 BOOT,2 PERIODIC" - in Success case and "0 BOOTSTRAP,1 BOOT" as in failure case. I hope this is okay?

Success case (client & server on x86 platform)
----------------------------------------------

2018-08-10T05:36:55.194Z [INFO] 192.168.0.211 FFFFFF-easycwmp-FFFFFF123456: Inform; cpeRequestId="1" informEvent="1 BOOT,2 PERIODIC" informRetryCount=0
2018-08-10T05:38:13.019Z [INFO] 192.168.0.211 FFFFFF-easycwmp-FFFFFF123456: Inform; cpeRequestId="2" informEvent="2 PERIODIC" informRetryCount=0

whereas for unsuccessful case (client on ARM based platform)
-------------------------------------------------------------

2018-08-10T05:46:51.750Z [INFO] 192.168.0.200 FFFFFF-easycwmp-FFFFFF123456: Inform; cpeRequestId="1" informEvent="0 BOOTSTRAP,1 BOOT" informRetryCount=0
2018-08-10T05:46:51.765Z [ERROR] 192.168.0.200 FFFFFF-easycwmp-FFFFFF123456: Invalid session
2018-08-10T05:46:59.202Z [INFO] 192.168.0.200 FFFFFF-easycwmp-FFFFFF123456: Inform; cpeRequestId="2" informEvent="" informRetryCount=1
2018-08-10T05:46:59.213Z [ERROR] 192.168.0.200 FFFFFF-easycwmp-FFFFFF123456: Invalid session

One more difference I see on easycwmp client log for success case is the comment starting with "* Found...."

Success case
------------

+++ SEND EMPTY HTTP REQUEST +++
* Found bundle for host 192.168.0.211: 0x5590c1226020 [can pipeline]
* Re-using existing connection! (#0) with host 192.168.0.211
* Connected to 192.168.0.211 (192.168.0.211) port 7547 (#0)
> POST / HTTP/1.1

and this is not the case in failure case

Failure case
-------------

+++ SEND EMPTY HTTP REQUEST +++
> POST / HTTP/1.1
Host: 192.168.0.210:7547
User-Agent: easycwmp
Content-Type: text/xml; charset="utf-8"
Content-Length: 0

Please provide your input to proceed further