1

I am doing a little project, in this project I am running one endpoint on my pc and sending and receiving some events from a raspberry pi(both with java code). I was receiving and sending events without any problem until yesterday. Now when I try to send an event it doesn't reach the destination, only sometimes when i run the code the events are being received. Both endpoints are attaching the user without problems on kaa and sending events as well but not receiving. This is the log from the raspberry pi, which is the endpoint sending the event:

http://pastebin.com/iQCJKhmG

Log from kaa

https://drive.google.com/open?id=0B9lKSxYrllLpdFhVcm53NHZmc1U

1 Answers1

0

The problem can be in key generation during initialization of kaa client for your endpoint apps. Based on kaa client initialization the application can generate on first startup public and private keys for the endpoint to access the server. Please see the example of how it can be initialized in java with keys generating to keys_for_java_event_demo folder:

// Setup working directory for endpoint
KaaClientProperties endpointProperties = new KaaClientProperties();
endpointProperties.setWorkingDirectory("keys_for_java_event_demo");

// Create the Kaa desktop context for the application
DesktopKaaPlatformContext desktopKaaPlatformContext = new DesktopKaaPlatformContext(endpointProperties);

// Create a Kaa client and add a listener which creates a log record
// as soon as the Kaa client is started.
final CountDownLatch startupLatch = new CountDownLatch(1);

final SimpleKaaClientStateListener listener = new SimpleKaaClientStateListener() {
    @Override
    public void onStarted() {
        LOG.info("--= Kaa client started =--");
        startupLatch.countDown();
    }

    @Override
    public void onStopped() {
        LOG.info("--= Kaa client stopped =--");
    }

};

KaaClient kaaClient = Kaa.newClient(desktopKaaPlatformContext, listener, true);

//Start the Kaa client and connect it to the Kaa server.
kaaClient.start();

startupLatch.await();

If you just restart an app that keys won't be generated again because of existing the previous ones, so just try to delete the keys folders before restarting your applications. Another thing is that you should generate and replace SDK for each client app every time when you make some changes for event class families. Please see more information on Kaa documentation page related to event managing.

eGoLai
  • 360
  • 1
  • 3
  • 16