Giter Site home page Giter Site logo

dmtrkovalenko / blendr Goto Github PK

View Code? Open in Web Editor NEW
278.0 4.0 6.0 2.23 MB

The hacker's BLE (bluetooth low energy) browser terminal app

License: BSD 3-Clause "New" or "Revised" License

Rust 97.20% Shell 2.80%
bluetooth browser diy-electronics tui tui-rs

blendr's Introduction

blendr

Mood: Blue Crates.io (version) Crates.io

Blendr is a terminal UI app for browsing BLE (Bluetooth Low Energy) devices. It allows you to inspect, search, connect, and analyze data coming from BLE devices directly from your terminal.

It was designed for day-to-day use by BLE engineers so the core features are useful search, direct connection to any characteristic and device with one command, and displaying your custom services names in the UI. Learn more

demo

And it's just perfect to hack your neighbor's toothbrush ๐Ÿ˜‰

Installation

Cargo cli

cargo install blendr --locked

For Unix OS you can run the following, it will install the binary for your system and provide man reference.

curl --proto '=https' --tlsv1.2 -sLSf "https://github.com/dmtrKovalenko/blendr/blob/main/install.sh?raw=true" | sh

For windows, it is required to download and run binary executable directly. Open latest release page and download binary executable for your OS

MacOS Permissions

To use Bluetooth on MacOS Big Sur (11) or later, you need to enable the Bluetooth permission for your terminal. You can do the latter by going to System Preferences โ†’ Security & Privacy โ†’ Privacy โ†’ Bluetooth, clicking the '+' button, and selecting 'Terminal' (or iTerm or whichever terminal emulator app you use).

Bluetooth settings screenshot

Usage

Get the help information with either man blendr or blendr --help it will print all the available options and characteristics. To get started and learn about the biggest features watch this 2 minutes demo:

video preview

License

This project is licensed under the terms of BSD-3-Clause license

blendr's People

Contributors

chrysn avatar dmtrkovalenko avatar dzamlo 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

blendr's Issues

`cargo install blendr` fails compiling `blendr` crate

Repro:

  1. Run cargo install blendr

Expected: blendr installs

Instead: blendr compilation fails with following error

Details
error[E0271]: type mismatch resolving `<IntoIter<Line<'_>> as IntoIterator>::Item == Line<'_>`
   --> /home/adziahel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/blendr-1.1.1/src/tui/connection_view.rs:292:29
    |
292 |                 text.extend(output.into_iter());
    |                      ------ ^^^^^^^^^^^^^^^^^^ expected `ratatui::text::Line<'_>`, found `ratatui::text::line::Line<'_>`
    |                      |
    |                      required by a bound introduced by this call
    |
    = note: `ratatui::text::line::Line<'_>` and `ratatui::text::Line<'_>` have similar names, but are actually distinct types
note: `ratatui::text::line::Line<'_>` is defined in crate `ratatui`
   --> /home/adziahel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/text/line.rs:8:1
    |
8   | pub struct Line<'a> {
    | ^^^^^^^^^^^^^^^^^^^
note: `ratatui::text::Line<'_>` is defined in crate `ratatui`
   --> /home/adziahel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.21.0/src/text/line.rs:6:1
    |
6   | pub struct Line<'a> {
    | ^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `ratatui` are being used?
note: the method call chain might not have had the expected associated types
   --> /home/adziahel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/blendr-1.1.1/src/tui/connection_view.rs:292:36
    |
292 |                 text.extend(output.into_iter());
    |                             ------ ^^^^^^^^^^^ `IntoIterator::Item` is `Line<'_>` here
    |                             |
    |                             this expression has type `Text<'_>`
note: required by a bound in `extend`
   --> /home/adziahel/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/collect.rs:377:31
    |
377 |     fn extend<T: IntoIterator<Item = A>>(&mut self, iter: T);
    |                               ^^^^^^^^ required by this bound in `Extend::extend`

For more information about this error, try `rustc --explain E0271`.
error: could not compile `blendr` (bin "blendr") due to previous error
error: failed to compile `blendr v1.1.1`, intermediate artifacts can be found at `/tmp/cargo-installb8EvBv`

A list of issues from a test drive

This looks like exactly what I needed for a new BLE MCU project I'm developing so fortuitous timing in your release. Testing this out on Windows 10 (terminal didn't matter. Tested with Windows terminal (wt) + powershell 7, wt + windows powershell, wt + cmd, powershell 7 on default host console), I found a couple of immediate issues

Duplicated key presses

All inputs are being duplicated / reacted to twice.
Filtering Example (typed /test)
image
This is also present using the arrow keys to navigate the device list so trying to select a device can be very frustrating

Pairing

The device I'm working with requires that the connection is encrypted and blendr (seemingly) doesn't even try to pair. This results in a failed connection which is also not visible inside blendr. It just permanently shows
image
At the very least "Just Works" pairing would be enough for early dev but support for the full set would be great
https://www.bluetooth.com/blog/bluetooth-pairing-part-4/

Device list re- sorting during scan

During a scan, devices in the discovered list move. This makes connecting to the right one in a busy BLE environment extremely difficult (I have >50 devices in range)

u and r keys don't appear to work

Potentially this is related to the duplicated input, but right now "Hide unknown" and "restart scan" don't appear to do anything

"Unknown device"

Currently "unknown device" has no identity information. I have a couple of devices that are only identified by the fixed 48-bit MAC address. They're not standards compliant in any way, they're just known test addresses in my "lab" for running on device BLE checks against.

Would be good to be able to filter by MAC as well as displaying it. Some of my devices have duplicate names (for... reasons)

Characteristic Notification/Indication history

I haven't got this far yet (see pairing) and this is a bit of a wishlist item, but one thing I would really like to have is a log of (multiple) characteristic notifications. Several sensors I use transmit updates at a moderate frequency via notifications and being able to observe/record the history would be great

Allow to write to characteristics

Currently, it is only possible to read a characteristic. It would be nice to be able to write too.

It should be possible to enter data in multiple format:

  • UTF-8 String
  • Hexadecimal

I don't know what the interface would look like.

Install on macOS doesn't work

Using:

curl --proto '=https' --tlsv1.2 -sLSf "https://github.com/dmtrKovalenko/blendr/blob/main/install.sh?raw=true" | sh

results in an executable called $HOME/.local/bin i.e., blendr is not put in bin, but is called bin

The script needs the single line:

install_dir="$HOME/.local/bin"

replaced with the two lines:

mkdir -p "$HOME/.local/bin"
install_dir="$HOME/.local/bin/" NOTE the trailing slash

Note also that the path to blendr is not added to $PATH

Otherwise, blendr seems to work very well, thank you. :-)

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.