mintuz / BB8-Commander

A Node CLI Tool for the Sphero BB8 Robot every loves.
MIT License
70 stars 17 forks source link

BB8 remains orange for a while after disconnection #28

Open JBX028 opened 8 years ago

JBX028 commented 8 years ago

Hi, When I disconnect my BB8 with the "disconnect" command, he become black up to the moment where I press ctrl-c and he remains orange for a while (I do not know exactly how many time). Is there anything to do to prevent this inconsistency and keep my bb8 off after the ctrl-c ? Thanks!

JBX028 commented 8 years ago

Hi,

Is there any reason why the disconnected command is executed within the rollback of the "connect" function? Why not just call disconnect with function "alreadyConnected" instead of connectAndSendCommand ?

mintuz commented 8 years ago

Good question, that is a bug and probably causing your issue. it should use the alreadyConnected function. I did a refactor last week and missed that.

JBX028 commented 8 years ago

Hi, I tried locally to adapt the script in order to avoid to call the disconnected function inside the callback of the connect function but without more success. I am still not able to disconnect my BB8 properly as soon as I started even just once, one of the BB8 commander command...

JBX028 commented 8 years ago

Hi, One more message regarding this issue. I don't think this is related to BB8-commander because even by creating a script like the one below, my BB8 did not disconnected properly:

var sphero = require("sphero");
var bb8 = sphero("<<MY_UID>>");

bb8.disconnect(function() {
  console.log("disconnected");
});

I have seen someone with the same issue as me that logged an issue on the official sphero sdk repository but no one responded so far. Am I the only one with this issue ? - because this is strange that if all users were impacted, we would be just few to report this problem. I posted the same question on the official repo.

Sud-Puth commented 8 years ago

Hi,

I have seen this issue. This is not from the BB8-Commander project but as you said the main sphero SDK. The disconnect wouldn't disconnect for me for some reason but when I do it from the other official apps, it does disconnect.

On Mon, Sep 19, 2016 at 12:09 PM, Baillargeaux notifications@github.com wrote:

Hi, One more message regarding this issue. I don't think this is related to BB8-commander because even by creating a script like the one below, my BB8 did not disconnected properly:

var sphero = require("sphero"); var bb8 = sphero("<>");

bb8.disconnect(function() { console.log("disconnected"); });

I have seen someone with the same issue as me that logged an issue on the official sphero sdk repository but no one responded so far. Am I the only one with this issue ? - because this is strange that if all users were impacted, we would be just few to report this problem. I posted the same question on the official repo.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mintuz/BB8-Commander/issues/28#issuecomment-248038231, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJcu8zuKOMnk14ypBD9A6kvfVjQUV3Zks5qrrPJgaJpZM4JyDZ8 .

JBX028 commented 7 years ago

Hi,

For the ones that would be interested I found a way to fully disconnect my bb8 device. Below the steps to follow:

1/ Send the disconnect command with your BB8 on your charging station. 2/ Remove your BB8 from his charging station, and push him in order to have your BB8 that starts to turn around for several seconds. 3/ From that point, if you decide to restart the express server, the connection with your device will shut down automatically after couple of seconds. To avoid this issue, run for 5 seconds the disco command, then stop it with crtl-c and then you can start your express server and this time the connection will never stop.

There is definitively a bug in the way the sdk handles the connection with BB8 but by following these steps, I am now able to disconnect/rerun it properly. I have tried to slightly adjust all those steps but this is really by following the ones above that the result is always 100% the one I expect.

Hope this will help the ones that are face to this same issue.

Regards,