Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Wakaama & Leshan bootstrap setup

Hi Simon

Thanks a lot for the example. It works.

2015-12-03 17:52 GMT+08:00 Simon Bernard <contact@xxxxxxxxxxxxxxx>:
Hi
 The only way, to add config to leshan-bs-server is to directly use REST API. We are working on a very simple web ui. Waiting this one was available, I use this kind of python script.

# This is an example to boostrap a device "testsecure" to the leshan sandbox with no credential. (no_sec mode)
import requests
import json

BASE_URL = "http://localhost:8083/"
url = "" + "api/bootstrap/testsecure"  # here your endpoint name
data = "" {"0": {"shortId": 123,
                          "lifetime": 20,
                          "defaultMinPeriod": 1,
                          "defaultMaxPeriod": None,
                          "disableTimeout": None,
                          "notifIfDisabled": True,
                          "binding": "U"}},
        "security": {"0":{"uri": "coap://leshan.eclipse.org:5683",
                          "bootstrapServer": False,
                          "securityMode": "NO_SEC",
                          "publicKeyOrId": [],
                          "serverPublicKeyOrId" : [],
                          "secretKey": [],
                          "smsSecurityMode": "NO_SEC",
                          "smsBindingKeyParam" : [],
                          "smsBindingKeySecret" : [],
                          "serverSmsNumber" : "+3343577464",
                          "serverId" : 123,
                          "clientOldOffTime" : 1},
                     "1":{"uri": "coap://127.0.0.1:5683",
                          "bootstrapServer": True,
                          "securityMode": "NO_SEC",
                          "publicKeyOrId": [],
                          "serverPublicKeyOrId" : [],
                          "secretKey": [],
                          "smsSecurityMode": "NO_SEC",
                          "smsBindingKeyParam" : [],
                          "smsBindingKeySecret" : [],
                          "serverSmsNumber" : "+3343577911",
                          "serverId" : 911,
                          "clientOldOffTime" : 20}}}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url, data="" headers=headers)
print r.status_code
print r.content

I join another example to bootstrap to a local device management server with psk.

HTH
Simon


Le 03/12/2015 07:43, Ricky Liu a écrit :
I use wakaama client to connect leshan bs server. But get this error.

11:12:35.445 [pool-2-thread-4] ERROR org.eclipse.leshan.server.californium.impl.BootstrapResource - No bootstrap config for testlwm2mclient

I trace leshan code that default bootstrap info should be in "data/bootstrap.data" but it's empty.

Is there any doc that explain how to fill this file?  Is there any example "data/bootstrap.data" for wakaama setting?

Thank you in advance.



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


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




--
RickyLiu

Back to the top