hybridgroup / cylon-sphero-ble

Cylon.js driver for the Sphero BB-8 & Sphero Ollie robots
http://cylonjs.com
Other
27 stars 7 forks source link

Can't seem to run the javascript under Windows #10

Closed Ganize closed 8 years ago

Ganize commented 8 years ago

image

And here is my code for my javascript.

var Cylon = require('cylon');

Cylon.robot({ connections: { bluetooth: { adaptor: 'central', uuid: 'e0464036b175', module: 'cylon-ble'} },

devices: { bb8: { driver: 'bb8', module: 'cylon-sphero-ble'} },

work: function(my) { my.bb8.color(0x00FFFF);

after(500, function() {
  my.bb8.color(0xFF0000);
});

after(1000, function() {
  my.bb8.roll(60, 0);
});

after(2000, function() {
  my.bb8.roll(60, 180);
});

after(3000, function() {
  my.bb8.stop();
});

} }).start();

Please help me any kind soul out there :(

deadprogram commented 8 years ago

Hi, @Ganize looks like you are running under Microsoft's shell language "JScript" not Node.js as required. You might want to run your program from the command line using the node command.

Have you installed the needed Windows prereqs & supported HW as we have been discussing in https://github.com/hybridgroup/cylon-sphero-ble/issues/9 yet?

Ganize commented 8 years ago

I have installed the prereqs and the error has been cleared. However, i can't seem to run the "JScript" with the node command.

deadprogram commented 8 years ago

JScript and Node are completely different, so you will not be able to run one with the other.

You will almost certainly need to run from the command line, from within whatever directory you have installed your Node.js modules into.

Ganize commented 8 years ago

I know that both the JScript and Node are different. So this is what i did. But i still have the same issues...

image

Ganize commented 8 years ago

image

They say that my usb bluetooth 4.0 devices not found. How do i solve this issues

deadprogram commented 8 years ago

Did you install and configure Zadig? http://zadig.akeo.ie/

Also do you have a Bluetooth 4.0 adaptor (aka BLE adaptor) that is compatible and configured for use with Zadig?

These are both requirements for running Noble on Windows.

Ganize commented 8 years ago

i do not have the Bluetooth 4.0 adaptor, however i am not able to find the bb8 even though i have paired the bb8 with my laptop.

For the zadig how do i configure it? Do you have a tutorial that i can follow?

deadprogram commented 8 years ago

You do not need to pair Ollie or BB-8, you should unpair them, in fact. Bluetooth Classic uses pairing, but Bluetooth LE does not.

This is a pretty good video that might help: https://www.youtube.com/watch?v=mL9B8wuEdms

Ganize commented 8 years ago

Ok thanks for the video, it was good :+1: Anyway what is the driver that i should choose for my bb8?

image

deadprogram commented 8 years ago

Remember right now you are trying to configure the BLE adaptor itself, not your robot.

You could try the "Intel Bluetooh 4.0 + High Speed Adaptor", however not sure if it will work.

The ones that are known to work are listed here https://github.com/sandeepmistry/node-bluetooth-hci-socket#windows

Ganize commented 8 years ago

Okay, i will try with "Intel Bluetooth 4.0 + High Speed Adaptor" however it doesn't work.

is it that i have the run the command line "npm install bluetooth-hci-socket" to get the socket?

deadprogram commented 8 years ago

More like you have to have a compatible hardware adaptor, which you do not appear to have, and than configure it with Zadig. Once you do that, the adaptor should show up to Noble, and then Noble can try to use that adaptor to communicate with the BB-8.

JustInDevelopment commented 8 years ago

My apologies about joining the conversation late here. @Ganize are you using a usb bluetooth dongle? Please keep in mind that the zadig software is meant for a usb bluetooth dongle not the onboard that would be built in from what I understand. For more information on zadig please reference http://zadig.akeo.ie/

Ganize commented 8 years ago

I see. how about if i download the bluetooth adapter will i be able to configure it with the zadig?

JustInDevelopment commented 8 years ago

The adapter would have to be a physical part that you plug into your usb port. I'm not sure but you could try to run linux in busybox or vmware and attempt to follow the linux instructions for this to work. It could be worth a shot.

deadprogram commented 8 years ago

Exactly what @JustInDevelopment said, the Bluetooth adaptor you need is something like http://www.amazon.com/Importer520-Bluetooth-Adapter-Chipset-Windows/dp/B00CG94OW8 aka based on the CSR8510 chipset.

Ganize commented 8 years ago

Okay @deadprogram. Is this http://www.amazon.com/IOGEAR-Bluetooth-Micro-Adapter-GBU521/dp/B007GFX0PY workable for me to show up to the Noble and then i will be able to use the adapter to communicate with my bb8?

deadprogram commented 8 years ago

I could not easily tell if that adaptor is based on the CSR chipset, but this one is: http://www.amazon.com/Anxus-Bluetooth-Adapter-Csr8510-Controller/dp/B014FDKENA along with the first link I sent you.

Ganize commented 8 years ago

I see, thanks a lot :)

Anyway just a simple question to ask you @deadprogram. Do you mean that after i have configure the adapter from the tools zadig and my adapter is able to communicate with the bb8. I will be able to awaken the bb8 by running the JScript given from the cylon.js?

deadprogram commented 8 years ago

If by "Jscript", you actually mean "Run JavaScript under Node.js", then it should work on your OS.

Ganize commented 8 years ago

Okay, i just want to check if this is compatible? https://www.google.com.sg/search?q=csr+v4.0+dongle&client=ms-android-samsung&prmd=vin&source=lnms&tbm=isch&sa=X&ved=0ahUKEwia_a6prvbKAhVRcY4KHc9aAngQ_AUICCgC&biw=360&bih=559#imgrc=bwf-WuNoq4LYtM%3A.

And this work for windows 8.1 right

deadprogram commented 8 years ago

That looks like it should work... not sure you need 50 of them :)

Ganize commented 8 years ago

What do you mean by 50 of them?

deadprogram commented 8 years ago

That link displayed a link that had lots of 50.

Ganize commented 8 years ago

Hi @deadprogram. What is the problem that the javascript is loading so long?

image

It could discovery my bb8 but it is taking quite a long time to finish it loading

Ganize commented 8 years ago

After i have discovery the bb8, what is the next steps that i should do to awaken the bb8?

Cause i am afraid that i will do something wrong haha

Ganize commented 8 years ago

Just to add on. What exactly is the problem that they say 'peripeheral' can't be found.

image

@deadprogram @JustInDevelopment

deadprogram commented 8 years ago

The program advertisment-discovery.js runs endlessly, scanning for new devices to appear. Once you find the device you are looking for, you would CTRL-C.

Did you pass the ADDRESS to the Node program, like this:

ADDRESS="YOURIDHERE" node examples/color.js
Ganize commented 8 years ago

How do i pass the address to the node program?

Ganize commented 8 years ago

Hi @deadprogram, i could the bb8 to be working.

image

However, is there any ways for me to turn it off?

deadprogram commented 8 years ago

That's great, @Ganize just ctrl-c the program, and after a few minutes the BB-8 will turn completely off.

Ganize commented 8 years ago

I see, thanks a lot for your help for the past few days :+1: @deadprogram.

So now i can write my own Script to run the bb8 right?

Ganize commented 8 years ago

Hi @deadprogram sorry to disturb you again.

Connecting Sphero with the leap motion using the cylon.js how does it work?

deadprogram commented 8 years ago

Since you do have this working under Windows, I am going to close this issue. If you need support for using Cylon.js with Leap Motion under Windows, please open a new issue here:

https://github.com/hybridgroup/cylon-leapmotion

Thanks!