ARMmbed / mbed-client-classic

DEPRECATED: mbed Client adaptation layer for mbed OS Classic
https://cloud.mbed.com/docs/current
Apache License 2.0
0 stars 5 forks source link

IPv6 and nano stack support in mbed5 of LWM2M client OS layer m2mconnectionhandlerpimpl.cpp for #40

Closed EduardPon closed 8 years ago

EduardPon commented 8 years ago

The mbed5 version of the LWM2M client OS layer [https://github.com/ARMmbed/mbed-client-classic/blob/master/source/m2mconnectionhandlerpimpl.cpp] refers to support of LwIP IPv4 only.

Line 125:

if (_network_stack != M2MInterface::LwIP_IPv4) {
        tr_error("ConnectionHandler: Unsupported network stack, only IPv4 is currently supported");
}

We need a version that supports IPv6 and the nano stack?

ciarmcom commented 8 years ago

ARM Internal Ref: IOTCLT-1047

yogpan01 commented 8 years ago

Hi, In mbed OS 5.1.x , you dont have to change this parameter, for making it work for Nanostack, you can leave it as it is and if you have configured your Network Interface to Mesh/Thread then mbed Client will use that interface. For mbed OS 5.2 , we will fix this so that this parameter needs to be configured as it was earlier.

EduardPon commented 8 years ago

Ok, thanks in advance.

EduardPon commented 8 years ago

Hallo yogpan01,

Because we are using the Mesh/Thread, the function *thread_tasklet_get_ip_address(char address, int8_t len)** returns an incomplete address.

Looks like the K64 has an issue contacting the router announcement service. With a switch in between my PC (running the router announcement service) and the K64, it fails. [DBG ][main]: IP address ::1042:1aff:fea3:b01

This is what I should expect, connect my PC directly with K64: [DBG ][main]: IP address aabb::1042:1aff:fea3:b01

Router announcement service: netsh interface ipv6 add route aabb::/64 "Local Area Connection 3" publish=yes

So what can be the issue? Thanks in advance.

EduardPon commented 8 years ago

Some logging:

[DBG ][nsif]: MeshInterfaceNanostack::register_rf()
[DBG ][nsif]: ethernet_phy_status_cb(, 0)
[DBG ][nsif]: Ethernet: Link down.
[DBG ][m6LEth]: MeshWired::init()
[DBG ][m6LEth]: MeshWired::init()2
[DBG ][m6La]: init()
[DBG ][m6LND]: wired_tasklet_init()1
[DBG ][m6LND]: wired_tasklet_init()2
[DBG ][m6LND]: wired_tasklet_network_init()1 dev_id 0
[DBG ][m6LEth]: MeshWired::init()3
[DBG ][m6LEth]: MeshWired::init()4
[DBG ][m6LEth]: MeshWired::init()5
[DBG ][nsif]:  MeshInterfaceNanostack::actual_connect()
[DBG ][m6La]: connect()
[INFO][m6LND]: Start 6LoWPAN ND Bootstrap
iND]: Start 6LoWPAN ND Bootstrap
connect()2
[DBG ][nsif]: ethernet_phy_status_cb(, 0)
[DBG ][nsif]: Ethernet: Link up.
[INFO][Eth ]: Ethernet cable connected.
[DBG ][m6LND]: app_parse_network_event() 0
[INFO][m6LND]: 6LoWPAN ND bootstrap ready

[ERR ][m6LND]: ND Address read fail<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

[DBG ][m6LND]: MAC 64-bit: 12:42:1a:a3:0b:01:00:00
[DBG ][m6LND]: IID (Based on MAC 64-bit address): 10:42:1a:ff:fe:a3:0b:01
[DBG ][nsif]:  MeshInterfaceNanostack::actual_connect()3
[DBG ][main]: Network stack initialized successfully
[DBG ][m6LEth]: getOwnIpAddress()
[DBG ][main]: IP address ::1042:1aff:fea3:b01
SeppoTakalo commented 8 years ago

Hi @EduardPon Can you provide some more details about your setup so we can verify if this issue exist?

EduardPon commented 8 years ago

Problem is fixed by enabling the dynamic bootstrap, the stack waits for Router advertisements and use that for configuring the ip address.