1HIVE
2====
3
4Welcome to the Bumble Hive.
5This is a collection of apps and virtual devices that can run entirely in a browser page.
6The code for the apps and devices, as well as the Bumble runtime code, runs via [Pyodide](https://pyodide.org/).
7Pyodide is a Python distribution for the browser and Node.js based on WebAssembly.
8
9The Bumble stack uses a WebSocket to exchange HCI packets with a virtual or physical
10Bluetooth controller.
11
12The apps and devices in the hive can be accessed by following the links below. Each
13page has a settings button that may be used to configure the WebSocket URL to use for
14the virtual HCI connection. This will typically be the WebSocket URL for a `netsim`
15daemon.
16There is also a [TOML index](index.toml) that can be used by tools to know at which URL to access
17each of the apps and devices, as well as their names and short descriptions.
18
19!!! tip "Using `netsim`"
20    When the `netsimd` daemon is running (for example when using the Android Emulator that
21    is included in Android Studio), the daemon listens for connections on a TCP port.
22    To find out what this TCP port is, you can read the `netsim.ini` file that `netsimd`
23    creates, it includes a line with `web.port=<tcp-port>` (for example `web.port=7681`).
24    The location of the `netsim.ini` file is platform-specific.
25
26    === "macOS"
27        On macOS, the directory where `netsim.ini` is stored is $TMPDIR
28        ```bash
29            $ cat $TMPDIR/netsim.ini
30        ```
31
32    === "Linux"
33        On Linux, the directory where `netsim.ini` is stored is $XDG_RUNTIME_DIR
34        ```bash
35            $ cat $XDG_RUNTIME_DIR/netsim.ini
36        ```
37
38
39!!! tip "Using a local radio"
40    You can connect the hive virtual apps and devices to a local Bluetooth radio, like,
41    for example, a USB dongle.
42    For that, you need to run a local HCI bridge to bridge a local HCI device to a WebSocket
43    that a web page can connect to.
44    Use the `bumble-hci-bridge` app, with the host transport set to a WebSocket server on an
45    available port (ex: `ws-server:_:7682`) and the controller transport set to the transport
46    name for the radio you want to use (ex: `usb:0` for the first USB dongle)
47
48
49Applications
50------------
51
52  * [Scanner](web/scanner/scanner.html) - Scans for BLE devices.
53
54Virtual Devices
55---------------
56
57  * [Speaker](web/speaker/speaker.html) - Virtual speaker that plays audio in a browser page.
58  * [Heart Rate Monitor](web/heart_rate_monitor/heart_rate_monitor.html) - Virtual heart rate monitor.
59
60