Introducing Bloop: CLI commands for working with Intel Edison

Having helped hundreds of people learn to use Intel Edison, I wanted to use my learning to help make everyone’s life easier . I also wanted to streamline the build / deploy process as well as the process of locating Edison on the local network (via Bonjour) or connecting to Edison via Micro-USB serial terminal.

So I created Bloop.

Here are the features and benefits to you, an Edison developer (using a Mac only, at this time):

  • bloop c: Never have to type in “screen /dev/cu.usbserial-XXXXX 115200 -L” ever again, simply type “bloop c” to do this automatically.
  • bloop list: Print out all Edison devices attached via USB Serial / Micro-USB
    • ex: /dev/cu.usbserial-XXXXX
  • bloop scan: Never have to use Bonjour Browser to detect Edison on the local network, simply type “bloop scan.” Add -r to show the raw output of the scan (otherwise, bloop scan simply returns the name of the first Edison it locates on the network).
  • bloop ssh: Instantly initiate an ssh attempt with an Edison on your local network. Add -e to select a specific Edison by name (useful with many Edisons on the local network) or -u to specify a user other than “root.”
  • bloop push: Instantly generate a command to copy your working directory to Edison’s /node_app_slot/ folder via scp. Like ssh, you can add -e or -u.
  • bloop clean: There is a problem with “Screen” which frequently results in detached screen processes resulting in confusing “Could not find a PTY” errors and “Resource busy.” Bloop clean instantly purges all those sessions and allows developers to connect again via bloop c. If you run “bloop c -f” these sessions will be purged automatically before attempting to initiate a new session.

I am very excited about bloop because I feel it will significantly ease the process for new developers (and all developers) to use Intel Edison. The ‘bloop push’ command, especially, allows you to use Sublime Text or your Node development environment of choice. Enjoy and file any bugs you find. Would like to create an equivalent Windows library at some point.

Install it globally by executing:

$ sudo npm install -g bloop

Notes for getting Bleno and Intel Edison working together

Problem: Bleno makes a single call and then stops working after running as a Node.js script on Edison. After that, it is impossible to connect to the service and read characteristics. The issue seems to be that “bluetoothd” (running in the background) creates it’s own GATT server which stops you from creating your own…you have to therefore kill off the process. See this bug for more details.

You can either do “killall bluetoothd” on the command line or, for a “more permanent solution,” use:

systemctl disable bluetooth

I had the most success when using an iOS device with the LightBlue iOS app installed to scan.If you want to get really fancy with Edison you might try something like this:

exports.killBluetoothd = function() {
    console.log('Unblocking BLE');
    function puts(error, stdout, stderr) { sys.puts(stdout) }
    exec("killall bluetoothd", puts);

Bluetooth Smart / BLE Scanning on OSX + Xcode 6

Starting to play around with BLE development with Intel Edison, here are some useful tools for scanning and discovering local BLE services for developers.

I am using an older MacBook Pro and I frequently encountered problems connecting to and reading BLE characteristics. Of the below options, I have had the best success using the LightBlue iOS app (NOT the OS X app). I suspect I might get different results if I tried these scanners with my newer Mac Air.

First, there is Xcode’s Bluetooth tools. You can get them by opening Xcode and selecting “Xcode -> Open Developer Tools -> More Tools” and then downloading the “Hardware IO” libraries after logging in with your developer credentials.
[Read more…]

Kirkland Startup Weekend Maker Edition Winners!