Skip to main content

freakble

A simple tool to send messages and commands into FreakWAN over Bluetooth low energy. It's tested under Linux, MacOS and Windows.

Installation

Using pipx

The best way to install freakble is using pipx:

$ pipx install freakble

For the GUI you can optionally install themes using:

$ pipx install 'freakble[themes]'

Using pip

When using pip it's suggested to work inside a virtualenv.

$ 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:
  gui      Start freakble GUI.
  repl     Start a REPL with the device.
  scan     Scan to find BLE devices.
  send     Send one or more words over BLE to a specific device.
  version  Return freakble version.

send

The send command is used to send a message to the board. You need to know the address of the device. You can specify the address of a device using the --device flag or the environment variable FREAKBLE_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)]
  --timeout FLOAT     Bluetooth LE connection timeout  [default: (10 secs)]
  --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 FREAKBLE_DEVICE environment variables to set the device address, and to not have to provide it in each commands that need a device address.

For example, using send, if one of your device is called FW_vuzasu you can do:

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

FreakWAN supports commands starting with ! character (see the list on FreakWAN README):

$ freakble send '!bat'
battery 99%, 4.20 volts

If you don't know what to say, you can always tempt the fates! :)

freakble send "$(fortune)"

Please note that this command handle also disconnection from Bluetooth LE so it runs in a few seconds.

scan

The scan command is used to discover Bluetooth LE devices.

Usage: freakble scan [OPTIONS]

  Scan to find BLE devices.

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

For example:

$ freakble scan
AB:AB:AB:AB:AB:AB (rssi:-52) FW_timatu
AF:AF:AF:AF:AF:AF (rssi:-57) FW_vuzasu

repl

The repl command connects to the specified device and stats an interactive shell with it. The complete usage is:

Usage: freakble repl [OPTIONS]

  Start a REPL with the device.

Options:
  --device TEXT    ble device address  [required]
  --timeout FLOAT  Bluetooth LE connection timeout  [default: (10 secs)]
  --help           Show this message and exit.

For example:

$ export FREAKBLE_DEVICE=$(freakble scan | grep FW | cut -d' ' -f1)
freakble 0.3.0a0 on linux
Connecting to AB:AB:AB:AB:AB:AB...
Φ]

Φ] is the freakble prompt.

You can then talk to the device remembering that commands start with ! and the text you write if it's not a command is sent as a message in the network.

For example, the following text is sent as a message in the network:

Φ] Hello there!
Φ]

Instead commands make you able to get info or configure your FreakWAN node:

Φ] !help
Commands: !automsg !pw !sp !cr !bw !freq !preset !ls !font !last !addkey !delkey !keys !usekey !nokey
Φ] !bat
battery volts: 4.2

Pressing TAB key or ! will show the autocompletion menu.

To exit from the interactive shell use CTRL + D or CTRL + C

gui

The gui command starts a GUI of freakble. If you don't set the device address it will start with the following scan interface:

A screenshot of the scan inferface of the gui.

after choosing a device you can click to the connect button to get a graphical REPL:

A screenshot of the graphical REPL of freakble.

License

freakble is licensed under BSD-3-Clause license.

Metadata

Release files for freakble 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for freakble 0.6.2
File Size Uploaded Provenance Actions
freakble-0.6.2.tar.gz 12.3 kB Without provenance Details for freakble-0.6.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for freakble 0.6.2
File Interpreter ABI Platform Actions
freakble-0.6.2-py3-none-any.whl Python 3 none any Details for freakble-0.6.2-py3-none-any.whl

Total release size: 24.1 kB

Release files / freakble-0.6.2.tar.gz

Download URL freakble-0.6.2.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ff6daae49cc2b627ccba36142afd1653c06b8fb032fe21edb3759b1409029afc
BLAKE2b-256 checksum
How to use checksums
1d8e150a29b8b84ea510739fe4aff14f28b1419ecc9eb2dbac3bc041eee73ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.2 Linux/6.1.0-5-amd64

Release files / freakble-0.6.2-py3-none-any.whl

Download URL freakble-0.6.2-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4eb961af0f60c0f6faae0b5c0cd04e184547ed1a6b3b67747a7aba0d96fdb76
BLAKE2b-256 checksum
How to use checksums
4158be782a83aa719597f881151f3fbf3c27c0729fc11fc92d4ebb8de039ee71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.2 Linux/6.1.0-5-amd64

Security for freakble 0.6.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page