Code Monkey home page Code Monkey logo

adafruit-bluefruit-le-desktop's Introduction

Adafruit Bluefruit LE Desktop Application

Desktop application to interact with Bluefruit LE and other Bluetooth low energy devices on Mac OSX, Windows, and Linux. Allows you to connect to a BLE device, view the services and characteristics, interact with a BLE UART, use a control pad, color picker, and view orientation from a BNO-055 sensor. Created using Electron and noble.

Adafruit Bluefruit LE Application

Note that this program is currently in beta and might have bugs or issues. Feel free to raise problems you find as new issues on this repository!

Installation

For ease of installation pre-built binary releases are available in the releases tab of this repository. Pick the right binary for your platform, Windows x64 (win32-x64), Mac OSX (darwin-x64), or Linux (linux-x64). See below for more detailed install instructions for each platform.

Windows

Bluetooth low energy support has typically been problematic on Windows because of a lack of APIs to access BLE devices. However the noble library added support for Windows by talking directly to a USB BLE device and working around the lack of BLE support in the OS. This means the Adafruit Bluefruit LE desktop app will only work with the following USB BLE adapters:

  • CSR8510 (USB VID 0x0a12, PID 0x0001)
    • This is the recommended adapter and the only one that has been tested.
  • BCM920702 Bluetooth 4.0 (USB VID 0x0a5c, PID of 0x21e8)

Unfortunately any other BLE adapter, including one that might be built in to your laptop or computer, will not work. You must be using one of the USB BLE adapters above.

You'll need to be running Windows 7 or greater to use the application. Note that only Windows 7 has been tested at the moment.

Once you have the USB BLE adapter you will need to use Zadig tool to configure the device to use a WinUSB driver (note that Windows won't be able to use the BLE adapter after making this change). To use Zadig tool download it, make sure your BLE adapter is plugged in, and run the program. Then select the Options -> List All Devices menu item:

Zadig step 1

Find the BLE adapter in the device drop down list, in this case a CSR8510, and then select a WinUSB driver in the combobox on the right side of the green arrow. Click the Replace Driver button like below:

Zadig step 2

Zadig tool will replace the driver for the device with a WinUSB driver. When it finishes you should see a successful install dialog like below:

Zadig step 3

You should now be ready to use the Bluefruit LE application. Download the latest win32-x64 release (sorry there is currently no 32-bit Windows binary available yet) of the application from the releases page. Unzip the archive and double click the able.exe inside to start the application.

Driver Uninstall

If you'd ever like to revert back to the normal driver for the BLE adapter you can use device manager to find the device, right click it and select 'Uninstall' like below:

Zadig uninstall

Be sure to check the 'Delete the driver software for this device.' option so the WinUSB driver is not installed again when the device is connected to the computer (don't worry this won't delete the WinUSB driver from Zadig tool, you can always use Zadig tool to setup the BLE adapter with WinUSB again).

Mac OSX

On Mac OSX you only need to ensure your device supports Bluetooth 4.0/low energy. Most MacBooks since ~2012 should have BLE support. Then download the latest darwin-x64 release of the application from the releases page. Unzip the archive and run the able application.

Linux

On Linux you need to meet the requirements for noble on Linux which include at least a Linux kernel version 3.6 or higher. In addition you'll want to ensure bluez is installed. On a Debian/Ubuntu system make sure the following packages are installed:

sudo apt-get install bluetooth bluez-utils libbluetooth-dev libudev-dev

Or on a Fedora or other RPM-based system install these packages:

sudo yum install bluez bluez-libs

Then download the latest linux-x64 release of the application from the releases page. Unzip the archive, open a terminal, navigate to the location of the files and run the able application. Note that you should run the application as a root user using sudo:

sudo ./able

Also if you have multiple Bluetooth adapters the first one will be chosen (hci0). You can set an explicit BLE adapter by following the steps from the noble library to set the NOBLE_HCI_DEVICE_ID environment variable, like to use hci1:

sudo NOBLE_HCI_DEVICE_ID=1 ./able

Compiling From Source

To build the application from its source you will need to setup your machine to compile native node.js application code. Be warned that this is a somewhat involved process on platforms like Windows! If you just want to run the application grab one of the pre-built binaries from the releases.

First you will need node.js version 0.12.7 installed. Later versions might work but have not been tested. Node.js 4.0.0 is unfortunately not yet supported by many of the native dependencies.

First follow all of the steps for installing node-gyp to compile native modules for your platform. On Linux you'll need to install a compiler toolchain from your package manager. On Mac OSX you'll need to install the XCode command line tools. On Windows you'll need to install Visual Studio 2013 community edition, Python 2.7, and follow all of the steps to setup environment variables, etc. Do not move on until node-gyp has been installed!

Next clone the repository for this application to get the latest source code.

!! WINDOWS WARNING !!

On Windows there is an unfortunate problem with node.js and npm where dependency file paths can exceed the 255 character platform limits of Windows and fail to install. The issue has a long history but is unfortunately still a problem as of 2015. The best way to work around this issue is to install the source code into a subdirectory of the C:\ drive, like under C:\able. If you don't do this you will see cryptic errors with missing modules during packaging of the application.

!! WINDOWS WARNING !!

Now install gulp to run the build scripts for the source:

npm install -g gulp

Note on Ubuntu you probably need to use sudo when running npm install -g, see this issue. For other platforms like Mac OSX or Windows do not use sudo to run npm as root.

Install the dependencies for building the application by navigating to the folder with the source and running the npm install command:

npm install

Now you're ready to build the source using gulp commands. To build a complete package for your platform use the package command:

gulp package

This will install the application dependencies, compile any native node modules (being careful to ensure they are built to work with Electron), convert the application's React JSX code to javascript, and then package everything up with Electron. After the package command finishes there will be a zip file created for your platform, like able-darwin-x64-0.1.0-beta.zip for Mac OSX with version 0.1.0-beta of the code. There will also be a folder created like able-darwin-x64, and inside this folder is the contents of the zip file.

You can either run the packaged application code from the zip or folder above, or you can run the unpackaged application code with Electron manually. The unpackaged application code will reside in the app subfolder, and it contains the following folders:

  • assets - Binary assets for the application like icons, 3D models, etc.
  • css - Cascading style sheets used by Bootstrap & Bootswatch.
  • dist - ES6 and JSX source that has been 'compiled' to ES5 for Electron to run.
  • fonts - Fonts used by Bootstrap.
  • lib - Third party JavaScript libraries used by the application.

To run Electron against this app code you can use an Electron prebuilt binary that is installed with the application dependencies. From the application folder run:

./node_modules/.bin/electron app

Note that you must use the Electron version installed by the application. The native dependencies of the app are compiled against a specific Electron version and won't work with other versions!

Running Electron against the app code directly is useful if you're modifying the code. You can change the code and then run Electron with the app to test the changes without having to package all the code up again. However you will need to be careful that if you change any JavaScript source code in the src directory you use the gulp js-build command to 'compile' JSX and ES6 JavaScript code:

gulp js-build

After the js-build command runs it will drop the compiled JavaScript in the app/dist directory so you can run Electron against the app folder to see the changes.

If you are modifying the code you will want to be aware that the code in the src directory uses ES6 and the React framework. You will want to familiarize yourself with using React.

adafruit-bluefruit-le-desktop's People

Contributors

microbuilder avatar tdicola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit-bluefruit-le-desktop's Issues

Indefinite "connecting" state on Windows 8.1

I have the app running on a Windows 8.1 VM (via Parallels Desktop) and it opens and scans for devices just fine. However, when I click on a device to initiate the connection process it hangs indefinitely until I cancel it...

screen shot 2015-10-15 at 4 17 23 pm

Has anyone seen similar behavior? Any additional info is greatly appreciated.

I plan on further debugging the issue by:

  • Getting my hands on a native Windows machine (no VM)
  • Running the app from source via the electron command directly

No LF or CR sent

I'm using this with a Bluefruit UART Friend connected to the serial console on an ODROID XU4. I can connect and send and receive, but it appears that no LF or CR is sent to acknowledge the EOL. So, text is sent and received, but commands will not execute. If I hit Enter instead of pressing Send button, the entire program window appears to flash and clear.

libgconf-2.so.4: cannot open shared object file

Installed the pre-requisites and executed the binary. This error was shown.

./able: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory

Xubuntu 18.04

Better packaging workflow needed

Need to improve packaging workflow to automate these steps:

  • Overwriting Electron LICENSE file with repo's LICENSE file (that includes the Electron and other dependency licenses).
  • Automate setting icon of win32 and osx executables.
  • OSX appears to have bug where del module doesn't recursively delete the old app folder? Need to investigate to confirm and fix.

Simplified version for begginers ?

Hi !
I've been able to connect my ble device with your software. I m trying to interact with my device directly through the console terminal with noble, but I ve not been able to succeed so far ...

Could you please provide the minimal code necessary to recognize ble devices and establish connection ?

That would help me a lot !!!

Feature Request: Hexadecimal and ASCII text

Hi,

I really like this application in that it resembles the Bluefruit App on the iphone. It would be really nice if it could print an hexadecimal values sent over bluetooth like the app.

Thanks

Refactor main.js to reduce complexity.

The program logic/complexity has started to grow large enough that there needs to be a clean separation between internal program state (like the list of devices, selected device, known services, etc) and the IPC interface. There are also a lot of nested callbacks which could be refactored into more clean 'serial' code using promises. Also consider looking at the flux architecture: https://facebook.github.io/flux/docs/overview.html

Auto scorlling

Is it possible to add auto scrolling to the UART section. Also possibly be able to remove the "RECEIVED"

Add documentation

  • Describe how to install from binaries on all platforms.
  • Describe how to build source with gulp & node.

Copy/paste support

It would be handy to have copy/paste support in this app. Unfortunately, that's not enabled by default in Electron; it seems adding support for this would involve adding the appropriate menu and keybindings.

Uable to find able.exe

Link show that download the zip file and Run able.exe.But after downloading i am unable to find the able.exe file.
screen shot 1

Can't compile in Windows 7

This is no longer compiling under Windows 7 even with node.js ver 0.12.7
Is this code still maintained and are there any alternatives ?
Thanks,
-s

Warn if not running as root/sudo on Linux

Must run as root on Linux for noble to work (if not run as root then nothing happens and the adapter is never powered up). Ideally should warn if not run as root on this platform.

error when compile

I get error at step gulp package
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\youbot\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\Users\youbot\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=0.30.4" "--dist-url=https://atom.io/download/atom-shell"
gyp ERR! cwd c:\5k\app\node_modules\noble\node_modules\bluetooth-hci-socket\node_modules\usb
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
[23:57:37] 'rebuild-usb' errored after 20 s
[23:57:37] Error: Command cd app/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb && node-gyp rebuild --target=0.30.4 --dist-url=https://atom.io/download/atom-shell exited with code 1
at ChildProcess. (c:\5k\node_modules\gulp-run\lib\command.js:145:15)
at ChildProcess.g (events.js:199:16)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

I am using windows 10. The binary package work well on my machine. I want to modify your project to fit my purpose but I cannot compile it. I really dont know how to fix. Help me please. Thank you.

A JavaScript error occured in the main process

Following error message while running app in OS X 10.15.4

Uncaught Exception: TypeError: Cannot read property 'toString' of undefined at null.<anonymous> (/private/var/folders/80/_xqwbfy12d9g7gx1k2ry05f40000gp/T/AppTranslocation/365ABDBE-06AD-4050-9D0F-128D7240BF6F/d/able.app/Contents/Resources/app.asar/node_modules/noble/lib/mac/yosemite.js:208:44) at emitOne (events.js:77:13) at emit (events.js:169:7) at null.<anonymous> (/private/var/folders/80/_xqwbfy12d9g7gx1k2ry05f40000gp/T/AppTranslocation/365ABDBE-06AD-4050-9D0F-128D7240BF6F/d/able.app/Contents/Resources/app.asar/node_modules/noble/lib/mac/yosemite.js:35:8) at emitOne (events.js:77:13) at emit (events.js:169:7) at null.<anonymous> (/private/var/folders/80/_xqwbfy12d9g7gx1k2ry05f40000gp/T/AppTranslocation/365ABDBE-06AD-4050-9D0F-128D7240BF6F/d/able.app/Contents/Resources/app.asar/node_modules/noble/lib/mac/yosemite.js:17:59) at emitOne (events.js:77:13) at XpcConnection.emit (events.js:169:7)

[need help] How to adding js library to your source code

Hi,
This is not really an issue, I just need some help here.
I am trying to using your source code for my project, I have a sensor connected with the bluetooth, the sensor send the data to my desktop.
I read your source code and I understand how it works, I can get and process data too.
Now I want to store the sensor data and print it to a pdf file. I found a javascript library that can help me create a pdf (jsPDF), however, I have no idea how to use it with your code (I think it is possible, since your code using javascript too). I have experineces with javascript, but not with react or electron, these are really new to me. So can you give me some advice or instruction how to make it work?
I am really appriciate.

Thank you.

"Bluetooth adapter has not powered on" issue on Mac

HW : MBP 13" 2015 Early
OS : macOS High Sierra (17A362a)

I already turned on bluetooth. but, still doesn't work this application
It caused by enhanced SIP(Rootless)??

(sorry. my english skill is poor...)

Display values in 'Information' pane

It would be useful to try to read the values of any characteristics in the Information pane. This will give the support team useful information like the firmware version being used, etc.

Make UART 'Received' window read only

Currently the 'Received' window accepts user input, and the window should probably be made read-only, and the default textbox selected should default to 'Send'?

How to get data from different components ?

Hi,
I know this is not an issue, but I dont know where to ask my question, React is totally new to me. I search around but there is no thing as good as your code about using bluetooth in windows. I guess I have to learn how to write code in React.
I am using your code as a frame for my software, which to recieve and send data from my destop to my robot.
My question here is: suppose I have a text form in infomation.jsx component, how can I get the value of that text form in the uart.jsx component.
Thanks for your time.

incorrect timestamps on MIDI packets over BLE?

HI,

I've been working on a BLE MIDI controller, based on the Bluefruit LE, using code borrowed from this canonical example: https://github.com/adafruit/Adafruit_BluefruitLE_nRF51/tree/master/examples/midi

On OSX 10.11, I connect to the Bluefruit board using Bluefruit LE Connect.

The MIDI events sent over BLE by the Bluefruit board are read by an OS X application written in Faust (http://faust.grame.fr). While testing, I found my compiled Faust application was not receiving all MIDI events sent by the board, if the time between NOTEON and NOTEOFF messages was very brief (5-6ms).

Later I confirmed that this is only an issue with rapid MIDI notes from the Bluefruit board; Faust can receive MIDI notes with 5ms time spacing (or even less) from other sources. Only the notes I send from the Bluefruit have this problem.

I contacted one of the Faust developers, Stéphan Letz, who looked at the problem ... he is of the belief that either the Bluefruit LE app or the Adafruit BLE-MIDI libraries are causing incorrect timestamps to be put on MIDI events. If so, this may be causing lost notes or timing problems for other uses of BLE MIDI.

I will invite Stéphane to describe the problem in more detail here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.