leshan: Problem of sending msg to client on Linux Platform

i’m using the client and server demo (). in the server demo,i add this to get some info from client (https://github.com/eclipse/leshan/wiki/Getting-Started-:-Server).

public void registered(Registration registration, Registration previousReg,
            Collection<Observation> previousObsersations) {
    System.out.println("new device: " + registration.getEndpoint());
    try {
        **ReadResponse response = server.send(registration, new ReadRequest(3,0,13));**
        if (response.isSuccess()) {
            System.out.println("Device time:" + ((LwM2mResource)response.getContent()).getValue());
        }else {
            System.out.println("Failed to read:" + response.getCode() + " " + response.getErrorMessage());
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

this works fine on windows,but failed on linux(centos /ubuntu)… : (

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

No, It still does not work with linux.

I use leshan only on linux and the sandbox https://leshan.eclipse.org/#/clients is on linux too. I don’t think the issue is relative to linux…

Could you share your logs ?

You can activate more logs.

  1. for Leshan Server Demo, add a logback-config.xml file in your working directory
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%d %p %C{0} - %m%n</pattern>
		</encoder>
	</appender>

	<root level="WARN">
		<appender-ref ref="STDOUT" />
	</root>
	
	<logger name="org.eclipse.leshan" level="DEBUG"/><!-- default value is INFO -->
	<logger name="org.eclipse.leshan.server.security.SecurityCheck" level="DEBUG"/>
	<logger name="org.eclipse.leshan.core.model.LwM2mModel" level="TRACE"/>

        <!-- All above is the default config, the line below is to search something in DTLS stack -->
        <logger name="org.eclipse.californium" level="DEBUG"/>
</configuration>
  1. for leshan-client-demo, add this jvm params to your command line : -Dorg.slf4j.simpleLogger.defaultLogLevel=debug