Skip to contentSkip to conversation

Hack ath9k driver for wifi time of flight measurement

ath9k-devel 王峰 3 participants 3 messages May 6, 2016 – May 10, 2016

lore
Share & tools
lore

王峰

author
#0 lore raw

Hi All,

I am pretty new to ath9k driver. But I read a recent paper by MIT that the channel state information (CSI) of wifi can be used for precision positioning. They used Intel 5300 wifi module which has CSI tool support. Some of the ath9k devices, such as ar9462, ar9380 etc are also supported by an open source CSI tool. So I want to use them to reproduce MIT's method.

I have already built a wifi CSI test system with two computers using ath9k driver. They can get the CSI readings out fine (carrier phase). But I need to be able to control the band (2.4G, 5G) and channel of the wifi. Preferably loop through 2.4 and 5G bands, and every channel of them. For each channel, I need to read CSI for both computer while one is transmitting and other is listening then reverse the transmitting and listening. What is the easiest thing to do to?

The ath9k CSI tool can be found here:

http://pdcc.ntu.edu.sg/wands/Atheros/

MIT's cool method for accurate wifi positioning can be found here:

http://people.csail.mit.edu/deepak/Slides/NSDI2016_Chronos.pdf

Thanks in advance and Best regards,

Everett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20160506/27b9db72/attachment.htm

#1 lore raw

Hello Everett,
I'm currently heading towards the same experiment setup for another usecase. I use two tl-wn722n with ath9k_htc attached to a raspberry pi.

I talked to Mathy Vanhoef (Mathy.Vanhoef at cs.kuleuven.be) and he confirmed what i already thought while checking the transceiver block diagram and Adrian Chadd wrote in the freebsd spectral wiki page.

You can either get spectral information of demodulate the frame for beeing processed through the protocol stack.

He recommends either one of the following setups, which intuitively come to mind:
1. Detect the start of packets based on the increased signal strength that can be seen in the spectral scan samples.
2. Use two devices as receiver. One decodes the frames, the other captures spectral scan. Synchronize the captures based on the MAC timestamps produced by both chips.

In my eyes a hybrid solution, doing a measurement start with a frame, synchronizing on that and then performing the actual measurement is the way to go. Starting the measurement from within the firmware on the chip is necessary in my eyes for reliable synchronization due to the unpredictability and delays if events are processed on linux processor.
You may know this paper: dl.acm.org/ft_gateway.cfm?id=2000029 . Domenico Giustiniano did a busy loop within the driver code to solve the problem with unpredictable scheduling. He is currently working on a broadcom platform with a custom firmware

There is a tx99 mode
http://www.spinics.net/lists/linux-wireless/msg113353.html, which may be the TX operation i would prefere.
Having the tx99 mode in ath9k_htc, too would be helpful.

Greetings,

V. Schnitzbauer

Zitat von ?? <[email protected]>:

Quoted 39 lines

Hi All,

I am pretty new to ath9k driver. But I read a recent paper by MIT that the channel state information (CSI) of wifi can
be used for precision positioning. They used Intel 5300 wifi module which has CSI tool support. Some of the
ath9k devices, such as ar9462, ar9380 etc are also supported by an open source CSI tool. So I want to use them
to reproduce MIT's method.

I have already built a wifi CSI test system with two computers using ath9k driver. They can get the CSI readings
out fine (carrier phase). But I need to be able to control the band (2.4G, 5G) and channel of the wifi. Preferably loop through 2.4 and 5G bands, and every channel of them. For each channel, I need to read CSI for both computer
while one is transmitting and other is listening then reverse the transmitting and listening. What is the
easiest thing to do to?

The ath9k CSI tool can be found here:

http://pdcc.ntu.edu.sg/wands/Atheros/

MIT's cool method for accurate wifi positioning can be found here:

http://people.csail.mit.edu/deepak/Slides/NSDI2016_Chronos.pdf

Thanks in advance and Best regards,

Everett

#2 lore raw

Hi,

2016-05-07 9:16 GMT+02:00 <[email protected]>:

Quoted 3 lines

...
1. Detect the start of packets based on the increased signal strength that can be seen in the spectral scan samples.

Are you sure that this is possible? In my observation your spectral sample stream get interrupted by an decoded frame.
The start of the frame is not visible and there is a small gap between the last spectral sample and the start of the decoded frame.

If you merge the power information of the spectral samples and frame it looks like http://imgur.com/xAWleMY

X-axis: subcarrier frequencies 1 per px, y-axis: time, 1 pixel = 115us, captured tl-wn722n with ath9k_htc v1.4
Not sure about the overlap at the end of the frame, probably my tx_time calculation is not accurate enough.

Quoted 3 lines

2. Use two devices as receiver. One decodes the frames, the other captures spectral scan. Synchronize the captures based on the MAC timestamps produced by both chips.

Please share how it is possible to convince the hardware not to decoded the frame and give only spectral samples instead.

Quoted 4 lines

You may know this paper: dl.acm.org/ft_gateway.cfm?id=2000029 . Domenico Giustiniano did a busy loop within the driver code to solve the problem with unpredictable scheduling. He is currently working on a broadcom platform with a custom firmware

The full text paper is also available:

http://dl.acm.org/citation.cfm?id=2079306
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.381.1215&rep=rep1&type=pdf

Quoted 1 line

...

Best,

Robert