1

If you do sudo iwlist wlan0 scan freq 2412 or sudo iw wlan0 scan freq 2412 you will get a full scan and not a channel scan.

I think there maybe a bug in the RPi implementation of iw.

Has anyone had success with this function on the Pi?

padapa
  • 119
  • 5
  • 2
    Just tested it on Raspbian Stretch and the iwlist command results in an error.iw seems to be working fine here. Several APs working on a different frequency are left out. BTW: there is no such thing as a 'RPi implementation of iw'. Raspbian uses the same source as Debian. – Dirk Aug 04 '18 at 14:04
  • 1
    @Dirk: Same (functional) sources as Debian, yes, but as the environment is different that's not a guarantee that it will work exactly the same across all platforms. And IIRC, the "Debian way" of extensively testing software, some of that process may have been been delegated to The Organization. In any event, I recall reading of other misfires with "iw-related" code. [Maybe this is helpful?](https://raspberrypi.stackexchange.com/questions/39601/make-iw-work-on-raspbian) – Seamus Aug 04 '18 at 15:33
  • 1
    @Seamus - not really. several years old, probably older Raspbian, older iw, different, etc, etc. It works her e just fine on a Pi3B. If OP has a problem then he would have to give a lot more info about his setup – Dirk Aug 04 '18 at 16:16

1 Answers1

0

After working with one of the iw dev team, he shared a command option that works every time.

Adding the "flush" option works with the RPi-3b I am using.

sudo iw scann freq 2412 flush

It does not work with a Lenovo/IBM Thinkpad I have with an old 54g WiFi card in it.

It appears there maybe a caching issue for them to address on some implementations.

padapa
  • 119
  • 5
  • 1
    -1 The command you have given does not work. It has a typo and lacks of a device. It should at least look `sudo iw dev wlan0 scan freq 2412`. On my RPi 3B with *Raspbian Stretch Lite 2018-06-27* it works no matter if I use `flush` or not. It filters networks with channel 1 (freq 2412) but not from the 5 GHz band. – Ingo Aug 25 '18 at 09:16
  • Yes, It looks like I typoed the answer. In the "sudo iw scann freq 2412 flush" answer the scan had an extra "n" in it. The "dev" is not required. Of course locking the scan to channel 1 does not do anything in the 5GHz band as the lowest channel in 5GHz is channel 36. Thanks for catching it. – padapa Sep 03 '18 at 13:25
  • Best you edit your answer and correct it. – Ingo Sep 03 '18 at 16:19