koenvervloesem / humble-explorer

Cross-platform, command-line and human-friendly Bluetooth Low Energy scanner

Home Page:https://humble-explorer.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No screen after installing on Ubuntu 22.04 LTS

ozett opened this issue · comments

commented

installed like doku said on an brand new and fresh ubuntu 22.04 LTS.
bt-adapter show up.
but after calling "humble-explorer" the screen stays dark.
how to debug?

image

commented

also the keypresses c,t,pg-up/pg-down,q do nothing. only the mouse hides for a second..

I see you have installed and are running the package as root. Have you tried instaling and running it as your normal user olaf?

commented

i tried running it as normal user first.
some packages complaint to be installed in /~/.local/bin and that not beeing in the path.
i checked with the .profile settings, but the location seemed to be in my userpath.
as it is a brandnew install i did not want to bother with that and tried as root.

but same effect on both accounts, no screen coming up.

That's weird, as I'm primarily developing and testing humble-explorer on an Ubuntu 22.04 LTS machine. I've just installed it on another one for the first time and it works out-of-the-box:

koan@x1:~$ pip3 install humble-explorer
Defaulting to user installation because normal site-packages is not writeable
Collecting humble-explorer
  Downloading humble_explorer-0.4.0-py3-none-any.whl (12 kB)
Collecting textual>=0.6.0
  Downloading textual-0.9.1-py3-none-any.whl (290 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 290.6/290.6 KB 1.0 MB/s eta 0:00:00
Collecting bleak>=0.19.0
  Downloading bleak-0.19.5-py3-none-any.whl (132 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.9/132.9 KB 1.4 MB/s eta 0:00:00
Collecting bluetooth-numbers<2.0,>=1.0.0
  Downloading bluetooth_numbers-1.0.0-py3-none-any.whl (462 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 462.5/462.5 KB 1.4 MB/s eta 0:00:00
Collecting async-timeout<5,>=3.0.0
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting dbus-fast<2.0.0,>=1.22.0
  Downloading dbus_fast-1.83.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.6/4.6 MB 2.3 MB/s eta 0:00:00
Collecting rich>12.6.0
  Downloading rich-13.0.0-py3-none-any.whl (238 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 238.1/238.1 KB 1.9 MB/s eta 0:00:00
Collecting nanoid>=2.0.0
  Downloading nanoid-2.0.0-py3-none-any.whl (5.8 kB)
Collecting importlib-metadata<5.0.0,>=4.11.3
  Downloading importlib_metadata-4.13.0-py3-none-any.whl (23 kB)
Requirement already satisfied: zipp>=0.5 in /usr/lib/python3/dist-packages (from importlib-metadata<5.0.0,>=4.11.3->textual>=0.6.0->humble-explorer) (1.0.0)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in ./.local/lib/python3.10/site-packages (from rich>12.6.0->textual>=0.6.0->humble-explorer) (0.9.1)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /usr/lib/python3/dist-packages (from rich>12.6.0->textual>=0.6.0->humble-explorer) (2.11.2)
Installing collected packages: nanoid, rich, importlib-metadata, bluetooth-numbers, async-timeout, textual, dbus-fast, bleak, humble-explorer
  Attempting uninstall: rich
    Found existing installation: rich 12.5.1
    Uninstalling rich-12.5.1:
      Successfully uninstalled rich-12.5.1
  Attempting uninstall: bluetooth-numbers
    Found existing installation: bluetooth-numbers 0.1.2
    Uninstalling bluetooth-numbers-0.1.2:
      Successfully uninstalled bluetooth-numbers-0.1.2
  Attempting uninstall: textual
    Found existing installation: textual 0.1.18
    Uninstalling textual-0.1.18:
      Successfully uninstalled textual-0.1.18
  Attempting uninstall: bleak
    Found existing installation: bleak 0.15.1
    Uninstalling bleak-0.15.1:
      Successfully uninstalled bleak-0.15.1
Successfully installed async-timeout-4.0.2 bleak-0.19.5 bluetooth-numbers-1.0.0 dbus-fast-1.83.1 humble-explorer-0.4.0 importlib-metadata-4.13.0 nanoid-2.0.0 rich-13.0.0 textual-0.9.1

Can you do the following:

  • Deinstall all packages shown in your first screenshot as root
  • Install the package with pip3 install humble-explorer as your user olaf and show the output, like I did above.
commented

i have a dual-boot for win/linux. must restart all an come back in some minutes...

commented

a drag-n-drop list for uninstalling the dependencies would be nice..
i tried my best by hand

uninstall as root
grafik
install as user
grafik
exit
olaf@olaf-OptiPlex-3020:~$ pip3 install humble-explorer
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: humble-explorer in ./.local/lib/python3.10/site-packages (0.4.0)
Requirement already satisfied: bluetooth-numbers<2.0,>=1.0.0 in ./.local/lib/python3.10/site-packages (from humble-explorer) (1.0.0)
Requirement already satisfied: textual>=0.6.0 in ./.local/lib/python3.10/site-packages (from humble-explorer) (0.9.1)
Requirement already satisfied: bleak>=0.19.0 in ./.local/lib/python3.10/site-packages (from humble-explorer) (0.19.5)
Requirement already satisfied: dbus-fast<2.0.0,>=1.22.0 in ./.local/lib/python3.10/site-packages (from bleak>=0.19.0->humble-explorer) (1.83.1)
Requirement already satisfied: async-timeout<5,>=3.0.0 in ./.local/lib/python3.10/site-packages (from bleak>=0.19.0->humble-explorer) (4.0.2)
Requirement already satisfied: rich>12.6.0 in ./.local/lib/python3.10/site-packages (from textual>=0.6.0->humble-explorer) (13.0.0)
Requirement already satisfied: nanoid>=2.0.0 in ./.local/lib/python3.10/site-packages (from textual>=0.6.0->humble-explorer) (2.0.0)
Requirement already satisfied: importlib-metadata<5.0.0,>=4.11.3 in ./.local/lib/python3.10/site-packages (from textual>=0.6.0->humble-explorer) (4.13.0)
Requirement already satisfied: zipp>=0.5 in /usr/lib/python3/dist-packages (from importlib-metadata<5.0.0,>=4.11.3->textual>=0.6.0->humble-explorer) (1.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in ./.local/lib/python3.10/site-packages (from rich>12.6.0->textual>=0.6.0->humble-explorer) (2.14.0)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in ./.local/lib/python3.10/site-packages (from rich>12.6.0->textual>=0.6.0->humble-explorer) (0.9.1)
olaf@olaf-OptiPlex-3020:~$ ^C

commented

while fighting with ubuntu to get the screenshot app to the favorits,
the errors occur in the window:

BleakDBusError: [org.freedesktop.DBus.Error.TimedOut] Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms)
olaf@olaf-OptiPlex-3020:~$ ^C
olaf@olaf-OptiPlex-3020:~$ 

``  
commented

first error was, that the BT-dongle that worked under ubuntu 16.04 is not longer recognized in 22.04.
not bluethoot- no explorer.

found another usb-stick, but that show another error in ubuntu 22.04

olaf@olaf-OptiPlex-3020:~$ humble-explorer 
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/olaf/.local/lib/python3.10/site-packages/humble_explorer/app.py:180 in │
│ on_mount                                                                     │
│                                                                              │
│   177 │   │                                                                  │
│   178 │   │   # Set up Bleak scanner and start BLE scan                      │
│   179 │   │   self.scanner = BleakScanner(**self.scanner_kwargs)             │
│ ❱ 180 │   │   await self.start_scan()                                        │
│   181 │                                                                      │
│   182 │   def on_checkbox_changed(self, message: Checkbox.Changed) -> None:  │
│   183 │   │   """React when the checkbox is ticked or unticked.              │
│                                                                              │
│ ╭─────────────────────────── locals ────────────────────────────╮            │
│ │  self = BLEScannerApp(                                        │            │
│ │         │   title='HumBLE Explorer 0.4.0 - 0 / 0 (Scanning)', │            │
│ │         │   classes={'-dark-mode'}                            │            │
│ │         )                                                     │            │
│ │ table = DataTable()                                           │            │
│ ╰───────────────────────────────────────────────────────────────╯            │
│                                                                              │
│ /home/olaf/.local/lib/python3.10/site-packages/humble_explorer/app.py:267 in │
│ start_scan                                                                   │
│                                                                              │
│   264 │   │   """Start BLE scan."""                                          │
│   265 │   │   self.scanning = True                                           │
│   266 │   │   self.set_title()                                               │
│ ❱ 267 │   │   await self.scanner.start()                                     │
│   268 │                                                                      │
│   269 │   async def stop_scan(self) -> None:                                 │
│   270 │   │   """Stop BLE scan."""                                           │
│                                                                              │
│ ╭─────────────────────────── locals ───────────────────────────╮             │
│ │ self = BLEScannerApp(                                        │             │
│ │        │   title='HumBLE Explorer 0.4.0 - 0 / 0 (Scanning)', │             │
│ │        │   classes={'-dark-mode'}                            │             │
│ │        )                                                     │             │
│ ╰──────────────────────────────────────────────────────────────╯             │
│                                                                              │
│ /home/olaf/.local/lib/python3.10/site-packages/bleak/__init__.py:156 in      │
│ start                                                                        │
│                                                                              │
│   153 │                                                                      │
│   154 │   async def start(self):                                             │
│   155 │   │   """Start scanning for devices"""                               │
│ ❱ 156 │   │   await self._backend.start()                                    │
│   157 │                                                                      │
│   158 │   async def stop(self):                                              │
│   159 │   │   """Stop scanning for devices"""                                │
│                                                                              │
│ ╭─────────────────────── locals ───────────────────────╮                     │
│ │ self = <bleak.BleakScanner object at 0x7fbd28825d80> │                     │
│ ╰──────────────────────────────────────────────────────╯                     │
│                                                                              │
│ /home/olaf/.local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scan │
│ ner.py:191 in start                                                          │
│                                                                              │
│   188 │   │   │   │   self._handle_device_removed,                           │
│   189 │   │   │   )                                                          │
│   190 │   │   else:                                                          │
│ ❱ 191 │   │   │   self._stop = await manager.active_scan(                    │
│   192 │   │   │   │   adapter_path,                                          │
│   193 │   │   │   │   self._filters,                                         │
│   194 │   │   │   │   self._handle_advertising_data,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ adapter_path = '/org/bluez/hci0'                                         │ │
│ │      manager = <bleak.backends.bluezdbus.manager.BlueZManager object at  │ │
│ │                0x7fbd28827520>                                           │ │
│ │         self = <bleak.backends.bluezdbus.scanner.BleakScannerBlueZDBus   │ │
│ │                object at 0x7fbd288266e0>                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/olaf/.local/lib/python3.10/site-packages/bleak/backends/bluezdbus/mana │
│ ger.py:368 in active_scan                                                    │
│                                                                              │
│   365 │   │   │   │   │   │   member="StartDiscovery",                       │
│   366 │   │   │   │   │   )                                                  │
│   367 │   │   │   │   )                                                      │
│ ❱ 368 │   │   │   │   assert_reply(reply)                                    │
│   369 │   │   │   │                                                          │
│   370 │   │   │   │   async def stop() -> None:                              │
│   371 │   │   │   │   │   # need to remove callbacks first, otherwise we get │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │                      adapter_path = '/org/bluez/hci0'                    │ │
│ │            advertisement_callback = <bound method                        │ │
│ │                                     BleakScannerBlueZDBus._handle_adver… │ │
│ │                                     of                                   │ │
│ │                                     <bleak.backends.bluezdbus.scanner.B… │ │
│ │                                     object at 0x7fbd288266e0>>           │ │
│ │                callback_and_state = CallbackAndState(                    │ │
│ │                                     │   callback=<bound method           │ │
│ │                                     BleakScannerBlueZDBus._handle_adver… │ │
│ │                                     of                                   │ │
│ │                                     <bleak.backends.bluezdbus.scanner.B… │ │
│ │                                     object at 0x7fbd288266e0>>,          │ │
│ │                                     │   adapter_path='/org/bluez/hci0'   │ │
│ │                                     )                                    │ │
│ │           device_removed_callback = <bound method                        │ │
│ │                                     BleakScannerBlueZDBus._handle_devic… │ │
│ │                                     of                                   │ │
│ │                                     <bleak.backends.bluezdbus.scanner.B… │ │
│ │                                     object at 0x7fbd288266e0>>           │ │
│ │ device_removed_callback_and_state = DeviceRemovedCallbackAndState(       │ │
│ │                                     │   callback=<bound method           │ │
│ │                                     BleakScannerBlueZDBus._handle_devic… │ │
│ │                                     of                                   │ │
│ │                                     <bleak.backends.bluezdbus.scanner.B… │ │
│ │                                     object at 0x7fbd288266e0>>,          │ │
│ │                                     │   adapter_path='/org/bluez/hci0'   │ │
│ │                                     )                                    │ │
│ │                           filters = {                                    │ │
│ │                                     │   'Transport':                     │ │
│ │                                     <dbus_fast.signature.Variant ('s',   │ │
│ │                                     le)>,                                │ │
│ │                                     │   'DuplicateData':                 │ │
│ │                                     <dbus_fast.signature.Variant ('b',   │ │
│ │                                     True)>                               │ │
│ │                                     }                                    │ │
│ │                             reply = <dbus_fast.message.Message object at │ │
│ │                                     0x7fbd288643a0>                      │ │
│ │                              self = <bleak.backends.bluezdbus.manager.B… │ │
│ │                                     object at 0x7fbd28827520>            │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/olaf/.local/lib/python3.10/site-packages/bleak/backends/bluezdbus/util │
│ s.py:20 in assert_reply                                                      │
│                                                                              │
│   17 │   │   AssertionError: if the message type is not ``MessageType.METHOD │
│   18 │   """                                                                 │
│   19 │   if reply.message_type == MessageType.ERROR:                         │
│ ❱ 20 │   │   raise BleakDBusError(reply.error_name, reply.body)              │
│   21 │   assert reply.message_type == MessageType.METHOD_RETURN              │
│   22                                                                         │
│   23                                                                         │
│                                                                              │
│ ╭─────────────────────────── locals ───────────────────────────╮             │
│ │ reply = <dbus_fast.message.Message object at 0x7fbd288643a0> │             │
│ ╰──────────────────────────────────────────────────────────────╯             │
╰──────────────────────────────────────────────────────────────────────────────╯
BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress
olaf@olaf-OptiPlex-3020:~$ 


What does bluetoothctl -v say?

commented

switched bluetooth off in unbuntu,
changed the dongle back to my first one,
than switched BT back on.

i love linux, but the desktop will ever be an adventure

now it works as expected...

screenshot
grafik

also a miracle to my why the echo-dot shows up here and was not shown on my experiments with espresence or OMG...

commented

i like the scrolling, but would love an filter to exclude all apple devices
and only have scrolling the devices/features of interest...

great tool. thx

I'm glad you've got it working now.

More filtering features are on the roadmap, yes.

commented

Great tool, 👍
i doscovered a amazon echo, which never showed up on ESPRESENCE or OMG.
dont know why, but i am willing to investigate more on my BT devices with your explorer.

BT protocols seems too complicated, as the hack-paper stated, but one needs more understanding of service-ids and some protocol fields to give my devices a "face" and more "meaning " to that data.
https://www.armis.com/research/blueborne/