Skip to main content

A simple tool to send messages into FreakWAN over Bluetooth low energy.

Project description

freakble

A simple tool to send messages into FreakWAN over Bluetooth low energy.

This is still a work in progress and it's not complete.

Installation

Using pipx

The best way to install freakble is using pipx:

$ pipx install freakble

Using pip

$ python -m pip install freakble

From source

freakble uses Poetry as dependency management and packaging tool, you need to install it first.

Then:

  1. Clone this repository.
  2. From the root of the repository run:
    $ poetry build
    
  3. Install using pipx or pip (it's better to use pipx):
    $ pipx install dist/freakble-0.1.0-py3-none-any.whl
    

Usage

Usage: freakble [OPTIONS] COMMAND [ARGS]...

  A simple tool to send messages into FreakWAN.

Options:
  --adapter TEXT  ble adapter  [default: (hci0)]
  --help          Show this message and exit.

Commands:
  deep-scan  Scan to find services of a specific device.
  scan       Scan to find BLE devices.
  send       Send one or more messages over BLE to a specific device.
  version    Scan to find services of a specific device.

send

The send command is used to send a message to the board. You need to know the address of the device.

The complete usage is:

Usage: freakble send [OPTIONS] [WORDS]...

  Send one or more words over BLE to a specific device.

Options:
  --loop              send forever the message
  --device TEXT       ble device address  [required]
  --sleep-time FLOAT  sleep between messages sent with --loop  [default: (1
                      sec)]
  --help              Show this message and exit.

For example:

$ freakble send --device AA:AA:AA:AA:AA:AA Hello, there!

where you have to substitute AA:AA:AA:AA:AA:AA with your device's address.

The --loop flag will make freakble to send continuosly the message until CTRL + C is pressed. The resend interval is defaults to 1 sec and can be changed using --sleep-time.

$ freakble send --device AA:AA:AA:AA:AA:AA --loop FREAKNET

A photo of a LYLIGO TTGO LoRa v2 1.6 showing the text: you> FREAKNET in multiple lines.

You can use environment variables to set the device address, for example if one of your device is called FreakWAN_vuzasu you can do:

$ export FREAKBLE_SEND_DEVICE=$(freakble scan | grep FreakWAN_vuzasu | cut -d' ' -f1)
$ freakble send "La violenza è l'ultimo rifugio degli incapaci. - Iscac Asimov"

scan

The scan command is used to discover BLE devices.

Usage: freakble scan [OPTIONS]

  Scan to find BLE devices.

Options:
  --scan-time FLOAT    scan duration  [default: (5 secs)]
  --service-uuid TEXT  service UUID used to filter  [default: (None)]
  --help               Show this message and exit.

For example:

$ freakble scan
AB:AB:AB:AB:AB:AB (RSSI=-52): FreakWAN_timatu
AF:AF:AF:AF:AF:AF (RSSI=-57): FreakWAN_vuzasu

Please note that the address are invented.

deep-scan

The deep-scan command is used to find services of a specific device.

Usage: freakble deep-scan [OPTIONS]

  Scan to find services of a specific device.

Options:
  --device TEXT      ble device address  [required]
  --scan-time FLOAT  scan duration  [default: (5 secs)]
  --help             Show this message and exit.

License

freakble is licensed under BSD-3-Clause license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freakble-0.2.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

freakble-0.2.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page