Skip to main content
BlufiClient talks to an ESP32 that runs Espressif’s BluFi service. Use it to read the device’s firmware version and WiFi state, list the networks it sees, and send it WiFi credentials. It uses the Lager Box’s own Bluetooth adapter. A BluFi device is not a net.

Import

Methods

The request*() methods send a request and return at once. The device answers through a notification, so wait a short time before you call the matching get*() method. requestDeviceScan() waits for the list itself, up to timeout seconds.

Example: Provision a Device

Constants

lager.blufi also exports the exceptions BluetoothError, ConnectionError, RoleError and SecurityError.

Notes

  • A BluFi device is found by its BLE name, not by a saved net
  • The client starts its own event-loop thread, which ends with the script
  • The CLI equivalent is lager blufi, which runs the same sequences on the box and prints the results