iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* how to get scanned network strength over dbus
@ 2025-04-12 18:48 KeithG
  2025-04-12 20:23 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: KeithG @ 2025-04-12 18:48 UTC (permalink / raw)
  To: iwd

I am trying to get a listing of ssid Dbm values for my UI. I an trying
to write a python script to do that and ran across the ones in the iwd
directrory
https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/test
I copied get-diagnostics and ran it and it works for the conneced
network. How do I get the dBm values for all scanned networks?
# python3 get-diagnostics.py /net/connman/iwd/0/3
ConnectedBss : a6:2e:48:fd:9e:73
RSSI : -57 dBm
TxBitrate : 292500 Kbps
RxBitrate : 292500 Kbps

but I want this for all the scanned networks... Is this possible
across the dBus?
if I disconnect the network and try again, I get this:
# python3 get-diagnostics.py /net/connman/iwd/0/3
Traceback (most recent call last):
  File "/root/bob/get-diagnostics.py", line 27, in <module>
    diagnostics = device.GetDiagnostics()
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 634,
in call_blocking
    reply_message = self.send_message_with_reply_and_block(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotFound: No
matching method found

I get something similar if I put the ascii name of the network there as well:
# python3 get-diagnostics.py /net/connman/iwd/0/3/73706735_psk

Is there a way?

Keith

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to get scanned network strength over dbus
  2025-04-12 18:48 how to get scanned network strength over dbus KeithG
@ 2025-04-12 20:23 ` Denis Kenzior
  2025-04-12 20:59   ` KeithG
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2025-04-12 20:23 UTC (permalink / raw)
  To: KeithG, iwd

Hi Keith,

On 4/12/25 1:48 PM, KeithG wrote:
> I am trying to get a listing of ssid Dbm values for my UI. I an trying
> to write a python script to do that and ran across the ones in the iwd
> directrory
> https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/test
> I copied get-diagnostics and ran it and it works for the conneced

diagnostics is for the connected BSS (not network per se, there may be multiple 
BSSes in a network).

> network. How do I get the dBm values for all scanned networks?
> # python3 get-diagnostics.py /net/connman/iwd/0/3
> ConnectedBss : a6:2e:48:fd:9e:73
> RSSI : -57 dBm
> TxBitrate : 292500 Kbps
> RxBitrate : 292500 Kbps
> 
> but I want this for all the scanned networks... Is this possible
> across the dBus?

If you don't need to know the signal strength of individual BSSes, then
                 array(on) GetOrderedNetworks()

is what you want.  See doc/station-api.txt


Regards,
-Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to get scanned network strength over dbus
  2025-04-12 20:23 ` Denis Kenzior
@ 2025-04-12 20:59   ` KeithG
  0 siblings, 0 replies; 3+ messages in thread
From: KeithG @ 2025-04-12 20:59 UTC (permalink / raw)
  To: Denis Kenzior; +Cc: iwd

Denis,

Thanks for the help, but I figured it out. The script in the directory
'list-devices' illustrated how to do it.

aside:
Our UI is dependent on some of the output and format of some of the
connmanctl commands.
We wanted to remove that component and I was able to construct a
python script that mimics
'connmanctl services' and 'connmanctl services <service>'

This was able to get us going. I noted that the Pi boots significantly
faster without connman. We now use
systemd-networkd and iwd and have a python script working to start an
ap0 if the wlan0 disconnects
and then shuts it down if iwd reconnects to a known network.

Keith

On Sat, Apr 12, 2025 at 3:23 PM Denis Kenzior <denkenz@gmail.com> wrote:
>
> Hi Keith,
>
> On 4/12/25 1:48 PM, KeithG wrote:
> > I am trying to get a listing of ssid Dbm values for my UI. I an trying
> > to write a python script to do that and ran across the ones in the iwd
> > directrory
> > https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/test
> > I copied get-diagnostics and ran it and it works for the conneced
>
> diagnostics is for the connected BSS (not network per se, there may be multiple
> BSSes in a network).
>
> > network. How do I get the dBm values for all scanned networks?
> > # python3 get-diagnostics.py /net/connman/iwd/0/3
> > ConnectedBss : a6:2e:48:fd:9e:73
> > RSSI : -57 dBm
> > TxBitrate : 292500 Kbps
> > RxBitrate : 292500 Kbps
> >
> > but I want this for all the scanned networks... Is this possible
> > across the dBus?
>
> If you don't need to know the signal strength of individual BSSes, then
>                  array(on) GetOrderedNetworks()
>
> is what you want.  See doc/station-api.txt
>
>
> Regards,
> -Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-12 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12 18:48 how to get scanned network strength over dbus KeithG
2025-04-12 20:23 ` Denis Kenzior
2025-04-12 20:59   ` KeithG

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).