How to scan for wireless networks?

Note iwlist is not installed by default.

ifconfig wlan0 down
iw phy phy0 interface add scan0 type station
ifconfig scan0 up
iwlist scan0 scan
iw dev scan0 del
ifconfig wlan0 up
killall -HUP hostapd
opkg update
opkg install iwinfo
iwinfo wlan0 scan