13

I'm working with a Pi running Raspbian. Is there a way to open the network list with a command from the terminal? This is the list I mean:

Screenshot of Wi-Fi network list

I have searched in the file ~/.config/lxpanel/LXDE-pi/panels/panel is defined the menu bar (sizes, icons, applications, etc ...). I think this is the code that defines the icon:

Plugin { 
 type=dhcpcdui
  Config { } 
}
6
  • Are you looking to get around not having a mouse and open the list as if you had clicked it with a mouse or do you want to list the available networks via the command line? Jun 8, 2017 at 7:52
  • Yes, to open it without the mouse. Jun 8, 2017 at 8:31
  • What will that give you that you can't from Darth Vader's answer below? Anything you can do with the applet you can do from the commandline (which does not require a mouse). Jun 8, 2017 at 9:11
  • Yes, I can modify the file that has named me 'Darth Vader', but the problem is that I can not find the command that I have to execute to display the list of networks. Jun 8, 2017 at 9:29
  • it is the first command in Darth Vader's answer iwlist wlan0 scan. This may also help raspberrypi.org/documentation/configuration/wireless/… Jun 8, 2017 at 9:31

2 Answers 2

11

I think the command you are looking for is:

iwlist wlan0 scan

Which will show a list of available Wi-Fi networks.

If you are connected to a network already you can see a list of the other devices on the network with:

nmap

To launch the terminal using a keyboard you can create a keyboard shortcut such as Ctrl+Alt+t. To do this first run:

nano ~/.config/openbox/lxde-rc.xml

This will allow you to modify the ~/.config/openbox/lxde-rc.xml file.

Anywhere between the <keyboard> and </keyboard> tags add:

<!-- Launch terminal when ctr-alt-t is pressed -->
  <keybind key="C-A-t">
    <action name="Execute"><command>lxterminal</command></action>
  </keybind>

If you put this piece of code just before the </keyboard> tag it should look something like this:

<!-- Launch gnome-screenshot when Print is pressed -->
  <keybind key="Print">
    <action name="Execute"><command>gnome-screenshot</command></action>
  </keybind>
<!-- Launch terminal when ctr-alt-t is pressed -->
  <keybind key="C-A-t">
    <action name="Execute"><command>lxterminal</command></action>
  </keybind>
</keyboard>
4
  • What I am looking for is to open the dialog of the list of networks by command, to be able to execute that command from a script of 'python'. And the problem is that I do not know which process I should launch. Jun 8, 2017 at 8:40
  • If you want to script something reliably use the command line not the gui. Jun 8, 2017 at 19:42
  • 2
    Weird thing, iwlist wlan0 scan shows only the network I am connected to, not all.
    – Suncatcher
    Jun 30, 2018 at 20:30
  • 1
    @Suncatcher Try running the command as root. See my answer.
    – Dogweather
    Oct 8, 2018 at 23:26
6

Use iwlist as root to get a fresh scan. It gives a lot of output. Here's a way to get just a list of available networks:

$ sudo iwlist wlan0 scanning | grep ESSID
                ESSID:"Daisycat"
                ESSID:"AI Lab"
                ESSID:"E4A451"
                ESSID:"EB4E7F"
                ESSID:"Lan Solo"
                ESSID:"3FA29B"
                ESSID:"BaronTweet"
                ESSID:"E15F8D"
                ESSID:"Malik3199 2.4G"
                ESSID:""

From the manual page:

Triggering scanning is a privileged operation (root only) and normal users can only read left-over scan results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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