2

Is there some way I can detect available WiFi networks, which are open, using Python? I know I can do it on my Ubuntu box, but I haven't received my Pi yet, so I haven't been able to run the same code on it.

Thanks!

PS - Here's the code I use on Ubuntu.

from gi.repository import NetworkManager, NMClient

nmc = NMClient.Client.new()
devs = nmc.get_devices()

for dev in devs:
    if dev.get_device_type() == NetworkManager.DeviceType.WIFI:
        for ap in dev.get_access_points():
            print ap.get_ssid()
0

there's no module 'gi' installed on raspi by default, but nobody can stop you from installing it manually. other than that, there's a nice command iwlist that shows a lot of information about available networks, so I suppose in the unlikely event you cannot install 'gi' on raspberry, you may just run iwlist from python and catch/parse the output.

  • Ah, nice! Well. Gotta wait for another week before I get my Pi. Thanks a ton! – Rudi Mk May 30 '13 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.