Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using wifi-scan with ev3dev I see "No associated station" #30

Open
prasun-raha opened this issue Mar 18, 2021 · 5 comments
Open

Using wifi-scan with ev3dev I see "No associated station" #30

prasun-raha opened this issue Mar 18, 2021 · 5 comments

Comments

@prasun-raha
Copy link

prasun-raha commented Mar 18, 2021

I have a slightly modified version of the ev3dev from http://rubirobot.ru/.
When I execute the compiled code above I get "No associated station" comment on my robot.

Here's some excerpts from my trials

robot@ev3dev:~/wifi-scan$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlx08beac12fd67: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 08:be:ac:12:fd:67 brd ff:ff:ff:ff:ff:ff
3: usb0: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 02:16:53:63:24:98 brd ff:ff:ff:ff:ff:ff
4: usb1: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 22:16:53:63:24:98 brd ff:ff:ff:ff:ff:ff

robot@ev3dev:~/wifi-scan$ sudo ./wifi-scan-station wlx08beac12fd67
This is just example, this is library - not utility
### Close the program with ctrl+c when you're done ###

No associated station
No associated station
No associated station
@bmegli
Copy link
Owner

bmegli commented Mar 21, 2021

Hi @prasun-raha,

Could you share the output of:

iw dev  wlx08beac12fd67 link
iw dev  wlx08beac12fd67 station dump
# no sudo needed
./wifi-scan-station wlx08beac12fd67
sudo ./wifi-scan-all wlx08beac12fd67

@prasun-raha
Copy link
Author

prasun-raha commented Mar 21, 2021

thanks @bmegli here's the response

robot@ev3dev:~/wifi-scan$ sudo iw dev  wlx08beac12fd67 link
Not connected.
robot@ev3dev:~/wifi-scan$ sudo iw dev  wlx08beac12fd67 station dump
robot@ev3dev:~/wifi-scan$ 
robot@ev3dev:~/wifi-scan$ sudo iw dev  wlx08beac12fd67 info
command failed: No such device (-19)

robot@ev3dev:~/wifi-scan$ ./wifi-scan-station wlx08beac12fd67
This is just example, this is library - not utility
### Close the program with ctrl+c when you're done ###

wifi channel : wlx08beac12fd67 
No associated station
No associated station
No associated station
^C
robot@ev3dev:~/wifi-scan$ ./wifi-scan-all wlx08beac12fd67
This is just example, this is library - not utility!

Triggering scan needs permissions.
The program will fail if you don't have them with message:
"Operation not permitted". The simplest way is to use sudo. 

### Close the program with ctrl+c when you're done ###

wifi channel : wlx08beac12fd67 
Unable to get scan data: Operation not permitted

Unable to get scan data: Operation not permitted

It looks like the wlx08beac12fd67 interface is enabled - I am on a ssh terminal connected to it but the interface is not associated with a station. I came to the wifi-scan test after trying to debug why the ev3wifi module was not working as
part of the ev3dev-mapping-modules

@bmegli
Copy link
Owner

bmegli commented Mar 21, 2021

I think that your driver/kernel doesn't support nl80211/cfg80211 for some reason.

Try the iwconfig, e.g.

iwconfig

It is older tool that uses WEXT (Wireless Extensions), now deprecated in favor of iw,
It will probably output you correct data about the connection.

wifi-scan library uses the newer nl80211/cfg80211 interface, the same as iw.

If that is the case (iwconfig works, iw doesn't) this likely means:

  • the problem is with driver or kernel support for nl80211/cfg80211
  • it may be kernel/kernel module configuration issue
  • wifi-scan, iw, and ip may not work correctly until this issue is solved
  1. What is the output of iwconfig
  2. What wireless card do you use?
  3. What is your kernel version (uname -a)?

@prasun-raha
Copy link
Author

prasun-raha commented Mar 22, 2021

It does look like iwconfig is able to find it - any suggestions on next steps?

  1. Output of iwconfig
robot@ev3dev:~/wifi-scan$ sudo iwconfig
usb1      no wireless extensions.

lo        no wireless extensions.

usb0      no wireless extensions.

wlx08beac12fd67  IEEE 802.11bgn  ESSID:"XXXXX"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 28:80:88:39:F6:DD   
          Bit Rate:72.2 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:****-****-****-****-****-****-****-****   Security mode:open
          Power Management:off
          Link Quality=39/100  Signal level=-60 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
  1. The wireless dongle I am using is edimax EW-7811Un V2
  2. kernel version
robot@ev3dev:~/wifi-scan$ uname -a
Linux ev3dev 4.14.117-ev3dev-2.3.5-rrsport-1.0-ev3+ #32 PREEMPT Sat Jan 16 08:23:28 +05 2021 armv5tejl GNU/Linux

@bmegli
Copy link
Owner

bmegli commented Mar 23, 2021

This is not really issue of this library but layer below it.

I would investigate it in the following way:

  1. Identify driver used by the wireless device (e.g. with lsmod)
  2. Identify origin of the driver

Since this is custom build (rrsport) of custom build (ev3dev), you could ask the rrsport author first.

This issue suggests that the driver was specifically added to rubirobot.

  1. Try to resolve the problem with recommended mainstream linux tools (iw in this case)

This means making it work so that iw reports correctly you wireless connection status.

This may include any number of actions like:

  • checking if rubirobot works correctly with iw for other devices
  • finding the correct driver
  • building the driver (kernel module)
  • building with correct configuration
  • making sure kernel configuration is correct
  • blacklisting some drivers so that other load
  • ...

Also dmesg may be your friend (there may be some messages in kernel log suggesting problems).


Trying to do it by yourself may be a major investment of time so weigh if it is worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants