![]() To connect to your Sphero 1.0/2.0 or SPRK, you first need to pair it. If you are receiving an error such as "Cannot open /dev/rfcomm0", then try running your program using "sudo". Note that running the rfcomm command itself to create the port, may require running under sudo. The udev rule above will allow any user who is a member of the dialout group to access any port that is added by connecting by running the rfcomm command. KERNEL="rfcomm*", NAME="%k", GROUP="dialout" You might need to add a udev rule in order to properly set permissions for your program to be able to access the Bluetooth interface. The serialport address displayed for the Sphero should look something like this: /dev/rfcomm0 Make sure to notice the serialport address Blueman displays after the Sphero connects, as this will be the one used in your code. You can connect and disconnect the Sphero from a serialport interface by right clicking on it inside the Blueman list of devices and selecting RN-SPP or disconnect, respectively (after it has been setup and added permanently to the list). Once the Sphero appears in the list of devices, select it, click on setup and follow the instructions. Make sure the Sphero is flashing its color code. When the installation is complete, open the program and search for devices. In Ubuntu this is pretty easy, just open the Ubuntu Software Center, type the program name and install it from there. To make things easy install Blueman Bluetooth Manager. So, your Sphero port will be at /dev/tty.Sphero-XXX-XXX-XXX The previous example is for a Sphero with a Red, Green and Blue (RGB) color code. Note, your device will likely be different depending on its preset color code (the three colors your Sphero cycles through when you first turn it on). Once you've successfully paired your Sphero, open your terminal, go to your /dev folder and locate the serial device connection (or use ls -a /dev | grep tty.Sphero) for your newly paired Sphero it should look something like tty.Sphero-RGB-AMP-SPP. From this menu, locate your Sphero in the Devices list and click the Pair button to pair it with your computer. To pair your device on OS X, open the Bluetooth settings in System Preferences > Bluetooth. To connect to your BB-8 or Ollie, you will need to be running Windows 8.1+. Use this value to connect to your BB-8 or Ollie. In the above output, the device address is f3f26d557108 (or alternately f3:f2:6d:55:71:08). Peripheral discovered (f3f26d557108 with address, connectable true, RSSI -37: node_modules/noble/examples/advertisement-discovery.js Once you have Noble installed, you can use the advertisement-discovery.js program to determine the device address: $ node. To connect to your BB-8 or Ollie, you first need to determine the MAC address. In the above output, the device UUID is 944f561f8cf441f3b5405ed48f5c63cf. Peripheral discovered (944f561f8cf441f3b5405ed48f5c63cf with address, connectable true, RSSI -73:Ĭan I interest you in any of the following advertised services: Once you have Noble installed, you can use the advertisement-discovery.js program to determine the device's UUID: $ node. To connect to your BB-8 or Ollie, you first need to determine its UUID. To use Sphero.js with your Sphero or SPRK, you must also install the Node.js serialport module () from Connecting to BB-8/Ollie OS X Run the following command: $ npm install sphero serialport The Sphero 1.0/2.0 and the SPRK use a Bluetooth Classic interface, also known as "Bluetooth 2.0/3.0". To use Sphero.js with your BB-8 or Ollie, you must also install the Node.js noble module () from Installation for Sphero 1.0/2.0 & SPRK Run the following command: $ npm install sphero noble You must have a hardware adapter that supports the Bluetooth 4.x+ standard to connect your computer to your BB-8 or Ollie. The BB-8 and Ollie use a Bluetooth Low Energy (LE) interface, also known as "Bluetooth Smart" or "Bluetooth 4.0/4.1". When running these examples, don't forget to pass the port as an ENV variable like this: PORT=/your/port node example.js For more examples, check out the examples dir, or the JavaScript SDK documentation on the Sphero developer portal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |