bleNIMA help

Every part of bleNIMA, step by step, with what you see on the screen. The screenshots are of made-up devices: an nRF52840 DK running the Zephyr shell and MCUmgr, and a small mesh network.

Getting started

Download bleNIMA for your computer from its page: the -setup.exe or the .msi for Windows 10 and 11, the .dmg for macOS on Apple Silicon and Intel, and the AppImage, .deb or .rpm for Linux. It uses the computer's own Bluetooth: there is no dongle to buy.

Not signed yet. Windows may say "Windows protected your PC": click More info, then Run anyway. macOS may say the app is damaged or cannot be checked: move it to Applications, then run xattr -cr /Applications/bleNIMA.app in Terminal. On Linux, make the AppImage runnable with chmod +x.

bleNIMA's welcome page: its logo and version, its GitHub and help addresses, the radio, what New tab opens, and the New scanner button
The welcome page: what bleNIMA is, the radio, and a button for the scanner

With no tab open, the welcome page shows the Bluetooth radio bleNIMA found, and what File > New tab and the + button open: the Scanner, a Device simulator, and the Mesh network. There is one scanner and one Mesh tab at most. Device and terminal tabs open from the scanner. Help > Check for updates looks on GitHub for a newer bleNIMA.

The scanner

New scanner, or Ctrl+Shift+N, opens the scanner, and it starts listening. Each device the computer hears is a row: its name and address, its RSSI, how often it advertises, how many adverts came, and what its advert says, such as a company, a service or a beacon.

The Scanner tab with six devices, nRF52840 DK, Thermo Sensor, ESP32-C3 SMP, Mesh Light, an iBeacon and HR Monitor, each with its RSSI, interval, adverts and what it says; nRF52840 DK picked, with Connect and Terminal, its address, PDU, RSSI and TX power, and its advert's structures
The scanner: every device around, and one's advert in words and bytes

Pick a device to see its advert on the right: each AD structure in words, then the bytes. iBeacon, Eddystone and AltBeacon are read out. On Windows the bytes are the advert as it was sent; on macOS and Linux bleNIMA makes them again from what the OS read.

  • Filter by name, address, company or service, by RSSI, or to the named, connectable or starred devices. The star keeps a device in the list as a favourite.
  • Sort keeps the list in the order devices were first heard, unless you choose RSSI, name or last heard.
  • RSSI plot (Ctrl+Shift+G) draws each device's RSSI over time.
  • Active scan asks for scan responses; passive only listens. Coded PHY hears long range adverts too, where the adapter has it. What an adapter or an OS cannot do is greyed out, saying why.
  • CSV saves the list. Stop (Shift+F5) and Start (F5) pause and go on.

Connect, or a double-click, opens a device tab. Terminal opens it straight in its terminal.

A device: its GATT table

A device tab connects, reads the GATT table, and keeps the connection: when the device goes, it connects again as soon as it is heard, and the log says how long it was gone.

The device tab of nRF52840 DK connected with MTU 247 and PHY 2M: the device information card, the services from Generic Access to the Nordic UART Service, and Battery Level picked, notifying, with its plot over twelve seconds
A device's GATT table, its information read out, and a value plotted live

The toolbar shows the MTU, the PHY each way, and the connection interval, latency and timeout, with a preset to ask for: balanced, throughput or low power. The card on top has the device's name, battery, maker, model, serial and firmware, read by themselves when it connects; Settings says where it goes, or hides it.

Services and characteristics have their standard names, and their values are in words: Heart Rate, Blood Pressure, Glucose, Cycling Power, Current Time and many more. Pick one to:

  • Read, Write and Notify or Indicate, with a form for the standard values, such as setting the time or an alert.
  • Choose how its value shows: hex, text, or any number format, either byte order. The choice stays for the next time.
  • Plot what comes, live, and see every value with its time.
  • Read its descriptors, in words too.

On Windows, Pair pairs and bonds, and Windows asks for a passkey itself when the device needs one.

The terminal

The Terminal view (Ctrl+Shift+T) is a real terminal, as in terNIMA, on a write and a notify characteristic. It finds the Nordic UART Service, HM-10 and Microchip's Transparent UART by itself, so the Zephyr shell works at once; any other pair can be chosen.

The Terminal view writing to UART RX and showing UART TX: the nRF Connect SDK boot banner, then kernel version, device list and bt info typed at the uart prompt
The Zephyr shell over the Nordic UART Service, in a real terminal

Enter sends CR, LF or both, and Local echo shows what you type when the device does not send it back. Long writes are cut to fit the MTU.

The log

The Log view (Ctrl+Shift+J) has everything that happened on the connection, with times: each read, write and notification in words and in bytes, subscriptions, errors in words, and when it was lost and back.

The Log view: the device information read when it connected, then Battery Level notified every 300 ms, each line with its time, kind, characteristic, value in words and bytes
The log: every read, write and notification, in words and bytes

Type in the filter to see only the lines that have it (Ctrl+Shift+F). Save log writes it to a file, and Edit > Clear (Ctrl+Shift+K) empties it.

Tests

The Tests view has four, each with what it found at the end:

TestWhat it does
ThroughputCounts the bytes the device notifies, second by second, and lost packets when the device counts them. A write flood sends packets the size of the MTU as fast as the OS takes them.
LatencyWrites, and times the notification that answers, round after round.
Connection soakDisconnects and connects again, cycle after cycle, and times each connection to the end of discovery.
Send and expectA script of what to send and what to expect back, with a pass or fail report.

Firmware update: MCUmgr

A device with MCUmgr's SMP service, as Zephyr and nRF Connect SDK build it, has the MCUmgr view. Read image slots shows each image's slots, with their version, state, size and hash.

The MCUmgr view: image 0 slot 0 at version 1.4.2, active, confirmed and bootable, and slot 1 at 1.5.0, bootable, with Test and Erase; an SMP buffer of 2475 bytes, four times; and Pick an image under Update
Firmware update over MCUmgr: the image slots, and an update in one go
  • Test marks a slot's image to run once at the next reset; Confirm keeps the one that runs. Erase empties a slot that is not active.
  • Pick an image takes a signed MCUboot image, such as Zephyr's zephyr.signed.bin, and reads its version from its header.
  • Update does it all in one go: it uploads, marks the image to test, resets the device, waits for it to come back, checks that the new image runs, and confirms it, with each step shown. Only a newer version lets the device refuse an older one.
  • Reset device and Echo check that MCUmgr answers. The pieces of an upload fit the device's SMP buffer, as its MCUmgr parameters say.

Pairing and bonds

On Windows, Device > Pair and Unpair act on the device in front, and Device > Bonded devices lists every device Windows has a bond with, to take one away. Windows asks for a passkey itself when a device needs one. On macOS and Linux, pair in the OS's Bluetooth settings.

The device simulator

A Device simulator tab makes bleNIMA a device, to test a phone app or a central's firmware. It has two parts, as views, on one page or in two columns, as Settings says:

The Device simulator's GATT server with the Nordic UART Service and Heart Rate, and Heart Rate Measurement picked, notifying 80 bpm every second with live values
bleNIMA as a device: a GATT server from presets, with live values
  • Advertiser: iBeacon, Eddystone URL, manufacturer data, or AD structures by hand, with the bytes on the air. Its transmit power, a Bluetooth 5 extended advert and its PHYs can be chosen where the adapter has them.
  • GATT server: services by hand, picked by UUID or by name, or from 22 presets, such as the Nordic UART Service, Battery, Heart Rate, Environmental Sensing or Fitness Machine. Values are notified on a timer, by hand, or live, made up as a real device sends them. Every read, write and subscribe is in its log.

One device simulator serves at a time: starting one stops the one that serves. It runs on Windows for now.

Bluetooth mesh

File > New tab > Mesh network opens bleNIMA's mesh network: bleNIMA is its provisioner, and talks to its nodes through a proxy node over GATT. The first time, it makes a new network with its own keys. It is kept in mesh.toml in the config folder, with each node's device key: keep that file to yourself, as its keys let anyone into the network.

Provisioning a device

Devices that wait to be provisioned, advertising the Mesh Provisioning Service, are listed on the left with their Device UUID and where their OOB information is. Provision connects to one over PB-GATT, and asks what it can do.

The Provision Mesh Light dialog: one element, so address 0x0005, with the BTM_ECDH_P256_HMAC_SHA256_AES_CCM algorithm; No OOB chosen, Output OOB offered, and Static and Input OOB greyed out as the device has neither
Provisioning: the OOB methods the device has
MethodWhat you do
No OOBNothing: no value is checked, so any device in range could have answered. A device that takes only OOB authentication does not offer it.
Static OOBType the device's static value, as hex: 16 bytes, or 32 for the HMAC-SHA256 algorithm.
Output OOBThe device blinks, beeps, vibrates or shows a number or letters: type in what it put out.
Input OOBbleNIMA shows a number or letters: push the device's button or twist its knob that many times, or type the value into it.

bleNIMA picks the stronger algorithm the device has, and the first addresses free for its elements. A wrong value stops it with "the OOB value was wrong". Once provisioned, the device is a node, on the left under Nodes.

The proxy

bleNIMA connects by itself to a proxy of the network: one that advertises the network's ID, or a node's identity, as a node does for a minute after it was provisioned. It learns the network's IV index from the proxy's beacon, and asks it for what is addressed to bleNIMA. Proxies on the left lists those heard, to connect to another; Disconnect stops it.

A node's page

The Mesh network tab connected to a proxy: two nodes, Desk lamp and Room sensor, Mesh Light waiting to be provisioned, and Desk lamp's page with its device key, its application key, and its two elements with their models
A node's page: its composition, keys and models

Pick a node to configure it, with its device key:

  1. Read composition: its company, product and version, its features, and each element with its models.
  2. Add to the node gives it an application key. Which has it? lists the keys it has.
  3. Open a model to bind it to the application key, set where it publishes, and subscribe it to group addresses, from 0xC000.
  4. Reset node makes it leave the network and forget its keys. Forget only takes it off bleNIMA's list, for a node that is gone.

Talking to its models

Desk lamp's elements and models, and the clients for element 1: Generic OnOff with On, Off and Get, Generic Level, Light Lightness and Light CTL with Set and Get, Health with faults, test, attention and period, and Any message with its address, key, opcode and parameters
The clients: Generic OnOff and Level, the lights, Sensor and Health

The clients send with the application key, to the element, or to a group in Send to: Generic OnOff and Level, Light Lightness, CTL and HSL, Sensor and Health, acknowledged or not. Any message sends any opcode and parameters, with the device key or an application key. The answer shows on the page, and every message sent and received is in the tab's Log, in words and bytes.

What each OS lets an app do

OSWhat bleNIMA does there
Windows 10 and 11All of it: adverts as sent, the device simulator, pairing and bonds, passive scans, the Coded PHY and extended adverts where the adapter has them.
macOSScanning, connecting, the terminal, tests, MCUmgr and mesh. macOS gives a device a UUID of its own, not its address.
LinuxThe same, with BlueZ. Pair with bluetoothctl or the desktop's Bluetooth settings.

No OS lets an app choose a connection's PHY: the device's firmware asks for 2M or Coded, and the OS agrees where its adapter has that PHY. What cannot be done is greyed out in the app, saying why.

Settings and the keyboard

File > Settings (Ctrl+,) has the theme, where the device information card goes, what comes back at startup (the tabs, their connections, the window), how a device simulator's parts are laid out, and the check for a newer bleNIMA. View > Command palette (Ctrl+Shift+P) finds any command by part of its name.

DoKeys
New scannerCtrl+Shift+N
Close the tabCtrl+Shift+W
Next tab, the one beforeCtrl+Tab Ctrl+Shift+Tab
Start and stop scanningF5 Shift+F5
RSSI plotCtrl+Shift+G
A device's terminal, its logCtrl+Shift+T Ctrl+Shift+J
Find, clearCtrl+Shift+F Ctrl+Shift+K
Bigger and smaller textCtrl+= Ctrl+- Ctrl+0
Command paletteCtrl+Shift+P

On macOS, Cmd takes the place of Ctrl, and Cmd+N, Cmd+W, Cmd+F and Cmd+K need no Shift.

When something goes wrong

  • It says Bluetooth is off, or there is no adapter. Turn Bluetooth on in the OS's settings, and open the tab again.
  • A device is not in the list. It is not advertising, or a phone is connected to it: most devices stop advertising while connected.
  • It does not connect, or loses the connection on Windows. Unpair it in Windows' Bluetooth settings and try again: an old bond with keys the device lost stops it.
  • MCUmgr does not answer. The firmware needs MCUmgr over Bluetooth, such as Zephyr's CONFIG_MCUMGR_TRANSPORT_BT.
  • No proxy of the mesh network is heard. A node needs the GATT Proxy feature on to be one, as Zephyr's CONFIG_BT_MESH_GATT_PROXY does.
  • Provisioning says the confirmation does not match. The OOB value was wrong: provision again, and type what the device puts out.
  • Anything else: ask, or report a bug on GitHub.