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

error getting wi fi information #15

Open
ruiemcardoso opened this issue Oct 31, 2017 · 10 comments
Open

error getting wi fi information #15

ruiemcardoso opened this issue Oct 31, 2017 · 10 comments

Comments

@ruiemcardoso
Copy link

ruiemcardoso commented Oct 31, 2017

i made a shell script which consists in a loop that returns wi fi readings, and it works well for about a minute, but after that i get the following message: "command failed: Device or resource busy (-16)".

i think this may be related to the fact that as we are using the computer's wi fi sensor, when it gets another task, it may not be able to continue providing us the information

The .sh file has this code:

num=1

 > medidaswifi.txt

while(num=1); do

	echo "New measurement" >> medidaswifi.txt

	date +%s >> medidaswifi.txt
	iw dev wlp3s0 scan | egrep "signal|wlp3s0" | sed -e "s/\tsignal: //" -e "s/\wlp3s0 //" >> medidaswifi.txt

	echo "\n\n" >> medidaswifi.txt
	

done
@ruiemcardoso
Copy link
Author

ruiemcardoso commented Oct 31, 2017

I forgot to mention that I'm running ubuntu natively

@oscar-lima
Copy link
Collaborator

  1. please put an example of medidaswifi.txt
  2. the output of the command
iw dev wlp3s0 scan

@oscar-lima
Copy link
Collaborator

in python try:

import os
wifi_readings = os.popen("iwlist wlp4s0 scanning | egrep 'Address|Signal'").read()

then process wifi readings to get only the info that you need

for example to remove spaces between lines:

import re
re.sub(' +',' ','The     quick brown    fox')

@oscar-lima
Copy link
Collaborator

@ruiemcardoso
Copy link
Author

We used the python code
import os wifi_readings = os.popen("iwlist wlp4s0 scanning | egrep 'Address|Signal'").read()

and there's a problem: the wifi_readings string only has information about one of the access points.

@oscar-lima
Copy link
Collaborator

try disconnecting from the wifi, you will then get many

@socrob socrob deleted a comment from ruiemcardoso Nov 1, 2017
@ruiemcardoso
Copy link
Author

indeed, we get more access points but in order to remotely control the robot we need to be connected to wi fi

@oscar-lima
Copy link
Collaborator

yes, you need a usb to wifi pendrive

@ruiemcardoso
Copy link
Author

My group has been getting wi fi info this way, but we just noticed that the method used gives us the same information several times, needing too much time to change (10/20 sec)

@oscar-lima
Copy link
Collaborator

try out the method used in https://github.com/RMiyagusuku/ros-wifi-localization/blob/master/rss/src/rss/RSSImeasurement.py

but just the code that gets the readings ; )

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