-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue - State.Dead #13
Comments
Hi Ivan, Which board/Fw are you using? Thanks |
I'm using a sample board: STEVAL-STLCX01V1 I'm going to copy here all my class. It is a Service:
And here is the relevant section of the LogCat:
|
the BlueMicrosystem 2.2 is quite old firmware.. you should update it. by the way could be that you call 2 times connect? (first time at: 03-29 14:51:13.379, second time at minute: 14:51:18.399) The only way, that I know, to recover an status 133 is to avoid to go in that state :) instead of using the handler with the self posting runnable you should use the listeners.
Said this, I don't know why your SensorTile disconnect and did not connect again in 5seconds.. Giovanni |
I do not try to connect in those lines. Those are SDK's Logs. So I don't think the problem is on the flow... And yes the strangest thing is that it can't reconnect again, i must disconnect alimentation and reconnect again. Do you have something more to suggest to me? |
look this line:
do you know why are you printing 2 times the "onStateChange" line? look to this line: if(mNode != null) {
Log.d(TAG, "mNode != null");
if(!mNode.isConnected()) {
Log.d(TAG, "!mNode.isConnected()");
isConnected = true;
gotFeatures = false;
mNode.connect(getApplicationContext());
mNode.addNodeStateListener(new Node.NodeStateListener() {
@Override
public void onStateChange(Node node, Node.State newState, Node.State prevState) {
Log.d(TAG,"onStateChange - Node.State: " + newState.name());
}
});
} your current state is "connecting" from this line:
so the isConnected return false, you call connect and you add a second listener that print the state change for the second time.. Can you use the BlueMS app or the example app and see if you have the same behaviours? ps: I'm able to recognise the differences between logs and code lines ;) |
So.. should i declare the listener globally and add and remove later calling the variable, or just adding once? The "problem" is that i need to keep on the time based handler. I changed my code with the 1st case, calling remove and after add just for some tests, and it have again the same problems:
|
I think you are still call connection when the node is connecting: can you use the BlueMS or the example app to see if the fw disconnect also with that applications? Giovanni |
I see that you are calling the method By the way it shouldn't have any effect. Look here to understand how to enable the notification |
Sorry but it's all there. I don't use any more calls except what you can see there. In the code above there is all my use (again, in a Service started by a BroadcastReceiver) Yes I call setEnable:
Only here. I think it's right because I receive by Logs the gesture events. For the previous question: It happened 1 time in 4/5 times in your application. I can't say if it was just a case. |
try to enable swap the order of this lines: featureAccelerationEvent.detectEvent(FeatureAccelerationEvent.DetectableEvent.ORIENTATION, true);
mNode.enableNotification(featureAccelerationEvent); |
…onnected. The existing implementation was defintely broken (see STMicroelectronics#1 STMicroelectronics#13 STMicroelectronics#19)
Thanks in advance.
My problem is that I am able to connect the Node, but after a few seconds in goes in a cycle of two states:
State --> Connecting, State --> Dead
And repeat... infinitely.
How could I to fix that?
The text was updated successfully, but these errors were encountered: