Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wakaama-dev] lwm2m client bootstrapping failure and segfaulting


Hi again,

For simplicity, I made a small modification to tests/util/connection.h, and tests/client/lwm2mclient.c so that it's easier to do bootstrapping by the client. With this patch, a client need not give -p option on the commandline, as just the -b option suffices. That way, the default commandline options remain consistent and (perhaps) less confusing as well.

Once the patches are applied, a user invoking the client by typing "./lwm2mclient -b", the default server port is automatically switched from 5683 to 5685 for bootstrapping.

Patches are attached with this email, if they're found useful in future.

Regards,
Bill

On 03/03/16 16:34, Bill Silverajan wrote:
Hi David,

Thanks, that helped. Also, an additional step required to get the
vanilla installation up and running is to edit bootstrap_server.ini so
that the testlwm2mclient entry has Server=1 in its section, to reflect
the running local lwm2mserver automatically.

With these, I was able to get everything up and running now.

Regards,
Bill



On 03/03/16 11:51, Navarro, David wrote:
Hi,

By de fault the lwm2mclient tries to contact a server at
localhost:5683. The "-b" option just tells him this server is a
bootstrap server. But your bootstrap server starts on port 5685 by
default. Here your client requests the bootstrap information from the
LWM2M server which ignores the request. Hence the client exits.
The segfault is due to bad cleaning of the client's objects. Ugly but
harmless as its is a test application issue.

Bootstrap server and lwm2mserver command lines are correct. For the
lwm2mclient use the following:
~/wakaama-master/tests/client$ ./lwm2mclient -4 -b -p 5685

The "-p 5685" option tells the client that the default server is at
localhost:5685.

Regards,
David Navarro

-----Original Message-----
From: wakaama-dev-bounces@xxxxxxxxxxx
[mailto:wakaama-dev-bounces@xxxxxxxxxxx] On Behalf Of Bill Silverajan
Sent: Wednesday, 2 March, 2016 21:54
To: wakaama-dev@xxxxxxxxxxx
Subject: [wakaama-dev] lwm2m client bootstrapping failure and segfaulting


Hi,

I checked out the latest code from github today and compiled the
bootstrap server, lwm2m server and lwm2m client for Ubuntu 15.04
desktop. Then I proceeded to simply launch all 3 in their own
terminals, with default options, but with IPv4, in this sequence:

~/wakaama-master/tests/bootstrap_server$ ./bootstrap_server -4

~/wakaama-master/tests/server$ ./lwm2mserver -4

~/wakaama-master/tests/client$ ./lwm2mclient -4 -b


Using wireshark I noticed no CoAP traffic at all between the client
and the bootstrap server, but after a short timeout, the client
attempts to contact the lwm2m server directly (and registration fails).

After a short while, the lwm2m client segfaults like so:

lwm2m_step() failed: 0xA3
[BOOTSTRAP] restore security and server objects Segmentation fault
(core dumped)


Is there something I needed to enable during compile- or run-time to
get this simple set-up working? Without bootstrapping, the
registration proceeds without problems.

Regards,
Bill
_______________________________________________
wakaama-dev mailing list
wakaama-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wakaama-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
wakaama-dev mailing list
wakaama-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wakaama-dev

_______________________________________________
wakaama-dev mailing list
wakaama-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/wakaama-dev
--- connection.h	2016-03-02 11:34:49.000000000 +0200
+++ connection.h	2016-03-03 14:30:17.305241573 +0200
@@ -29,6 +29,10 @@
 
 #define LWM2M_STANDARD_PORT_STR "5683"
 #define LWM2M_STANDARD_PORT      5683
+#define LWM2M_DTLS_PORT_STR     "5684"
+#define LWM2M_DTLS_PORT          5684
+#define LWM2M_BSSERVER_PORT_STR "5685"
+#define LWM2M_BSSERVER_PORT      5685
 
 typedef struct _connection_t
 {
--- lwm2mclient.c	2016-03-02 11:34:49.000000000 +0200
+++ lwm2mclient.c	2016-03-03 16:37:29.360550929 +0200
@@ -79,6 +79,7 @@
 #define DEFAULT_SERVER_IPV6 "[::1]"
 #define DEFAULT_SERVER_IPV4 "127.0.0.1"
 
+bool serverPortChanged = false;
 int g_reboot = 0;
 static int g_quit = 0;
 
@@ -792,6 +793,9 @@
         {
         case 'b':
             bootstrapRequested = true;
+	    if (!serverPortChanged){
+	      serverPort = LWM2M_BSSERVER_PORT_STR;
+	    }
             break;
         case 'c':
             batterylevelchanging = 1;
@@ -810,6 +814,7 @@
             break;
         case 'p':
             serverPort = optarg;
+	    serverPortChanged = true;
             break;
         case '4':
             data.addressFamily = AF_INET;

Back to the top