GithubHelp home page GithubHelp logo

xieyaxiongfly / atheros-csi-tool-userspace-app Goto Github PK

View Code? Open in Web Editor NEW
56.0 56.0 62.0 1.96 MB

The user-space applications for our Atheros-CSI-Extraction-TOOL

Makefile 0.76% C 98.85% Perl 0.02% Shell 0.01% Python 0.13% C++ 0.14% MATLAB 0.06% Roff 0.04%

atheros-csi-tool-userspace-app's People

Contributors

sunnyszy avatar xieyaxiongfly avatar yjh0502 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

atheros-csi-tool-userspace-app's Issues

cannot receive csi data.

I use a laptop as DP.
OS: Ubuntu 14.10
NIC: Atheros AR9285
After Installation of the Linux Kernel, I check the kernel version, and it returns "4.1.10+".

I use a router as AP with no password.
the Wireless Net parameter:
channel: auto
mode: 11n only (or 11bgn mixed)
bandwidth: auto

When DP ping 192.168.1.1, it returns properly, but recieve application Atheros-CSI-Tool-UserSpace-APP/recvCSI/recv_csi cannot work properly, there‘s no data received, the function read_csi_buf() in main.c always returns 0. I changed Wireless Net parameter, such as channel-1 to 10, mode-11n only or 11bgn mixed, bandwidth-20MHz or 40MHz, but it also doesn't work properly.

Thank you!

Driver capability issue

Hi

I have a problem in running the batch file "start_hostapd.sh".

When I run it, I have the error message "Driver does not support configured HT capability [SHORT-GI-20]".

I guess it has something to do with short GI in 20 MHz, but have no idea how to fix it.

If you know any solution, please kindly let me know.

Thanks!

How to send injection packet without associate the access point?

Hi xie,
I find the sendData code must send the data by associating the access point, if not, the data won't come to the driver. Can you help me to find some method to send data in Not-Associate mode? I want to set the NIC use the command iw dev wlan0 interface add mon0 type monitor and stop the network-manage just like the intel 5300 packet injection setting. But when I do that and use sendData does not call the ath9k driver. ):

CSI on 3x2 links looks very strange

Hi I noticed a very weird issue with the CSI collected in some of my experiments. So I have a 3x3 sender setup and a 3x3 receiver setup. Now when I collect the data, some of the packets have a 3x3x56 structure whereas some have a 3x2x56 structure. This issue has been discussed here before and I believe it's due to the rate selection algorithm . But when I look at the csi for a pakcet with 3x2x56 structure the absolute value of the normalized csi looks like this for a transmitting antenna

abscsi1

This is very strange because the absolute value for the csi shouldn't be sinusoidal like this . This problem is not there when the structure is 3x3 as the csi for another packet that is recorded about only 2ms earlier than the one above for the same transmitting antenna.

abscsi2

The above figure looks fine, as the absolute value is generally a slow changing curve.

Could you help me explain this? Is there anything I'm understanding wrong here ?

For reference, I have added a link to the test file and the packets in question are 28717 and 28725 and the plot is for transmitter 1

https://drive.google.com/open?id=0B4W1uTjVcCFOVnoyUnZINkRxZlE

Thanks
Avishek

Varying dimensions of CSI matrices while moving the receiver

Hi Dr. Xie,

When I am moving the receiver, the CSI matrix (nr_nc_num_tones) will vary in dimension. The sender attached two antennas and the receiver attached three antennas. Most of the received CSI matrices are 3_2_56. However, some are 3_1_56. It also happens when I used the Intel 5300 CSI tool. It seems to depend on the relative positions between antennas of sender and receiver.

Could you please help me explain that? I have no idea why this happens.

Thank you for your brilliant tool. Look forward to your reply.

Shengkai Zhang
Wuhan, HUST

How to Run script file

Can you please explain how to run the script file hostapd. and also send the sample data.

AR9285 not supported?

Hello,

first of all thank you for your great work. I tried to reproduce your tool on 2 Laptops with Ubuntu 14.04 and AR9285. The installation of the kernel seems to be successful. The connection to the local AP also seems to work, although due to an error I had to eliminate the option "[SHORT-GI-20]" in the configuration file "hostapd.conf".
When I run recv_csi, the laptop is waiting to receive data. But if I run the program "send_Data", nothing is received.
Do you have any idea what the problem is? Maybe the AR9285 is not supported? Or is the option [SHORT-GI-20] essential for the task?

Thanks in advance,
Nils

Is there a way to collect scaled CSI values?

I would like to obtain CSI such that its amplitudes correspond to the actual signal power. RSSI is too inaccurate for my need, and I was wondering if anybody was able to obtain reliable abs(CSI) with this platform. Below is an abs from two antennas located very close to another. The range is too wide. It is abs(CSI) on y-axis and nth_sample on x-axis

nothing abs

sounding flag

@xieyaxiongfly
Great thanks for sharing the excellent tools.
Can you recommend some papers or books talking about the sounding flag especially the packet format correlated to the flag?

payload length always the same?

Hello,
does the payload has always the same size (1040 Bytes) when nothing has been changed in sendData.c?

The problem is, that I receive payloads with the size 1924 and they do not content any information about CSI. If I send 100 packets, I receive > or < or = 100 and almost all payloads have the size 1924 Bytes.
What is wrong?

Thanks and best regards

Mac address extraction from received packets while monitoring mode

Hi,
now, I turned receiver mode from managed to "monitor mode" to receive any packet while receiver do not even connect with transmitter(or any AP)
So now, I can receive various packets including packets that destination of them is not receiver itself. However, I can't extract mac address from packet. I think packets are pre-processed from somewhere and "buf_addr" in "recvCSI/csi_fun.c" is processed variouble not including mac_addr or ip addr of transmitter.

If I'm right, How could I extract mac_address? or How could I distinguish various transmitter?
Thank you.

read_csi.c error

I was able to get a CSI data using the tool. However, when I try to use MATLAB code provided, it complains as follows. I initially thought that this was an error due to my mac computer, but I ran this again on linux, but same error has occured. Has anyone experienced this before? I am currently using MATLAB 2017a

Error using read_csi
Requested 4294967299x140673063845944x140675699690528
(17179869184.0GB) array exceeds maximum array size preference.
Creation of arrays greater than this limit may take a long time and
cause MATLAB to become unresponsive. See array size limit or
preference panel for more information.

I also tried running using the read_csi.mexa64 provided by the UserSpace code, and it just crashed the matlab.

set the speed of send packages

How to set the speed of send packages,the sending package is too fast,10000 packages only need 4 seconds,i need it slow.Can anyone know?
he

Processing CSI with matlab

Hi, I had a trouble when I accessed the measured CSI with matlab.

I tried to extract CSI value from the measured CSI binary file, but I failed.

It seems kind of formatting problem.

screenshot from 2018-01-09 16-44-49

It seems work decoding the first packet, but It seems fail to decode from the second packet.

I tried to re-build mex file and run matlab in different environment, but nothing worked.

Here I attach a screenshot.

Is there anything I did wrong or missed?

Broadcast mode in ubuntu and ways to work in 5G

Does the ubuntu version work in broadcast mode?
I follow the procedure and use the script:

service network-manager stop
ifconfig wlan0 down
ifconfig wlan0 hw ether 01:F0:A1:98:42:41
ifconfig wlan0 up
service network-manager start
iwconfigure wlan0 essid Atheros_csi_tool

The previous script does change hw address but the receiver still cannot get CSI data.

Another issue is how to change the frequency to 5G. Any necessary changes are needed in hostapd configure file?

Many thanks.

Phase jump while the receiver moving

Hello,
These days I have some measurements at a parking lot(a flat area and other WiFi signals is very low), the transmitter stay still, the receiver is moving with a constant speed.
I plot out the heatmap of phase based on the packets' sequence, most of the time the phase changes smoothly(after linear regression). But some times there is a obvious jump between two packets, and some times later it will jump back.
00000-01000
You could have a look this figure, X-axis is packets' sequence, Y-axis is the 114 subcarriers.
I have plotted out the critical points. The following figures are the places where the jump happens:
14
15
There is another critical point:
4552
4553
I could not find the reason why the jump happens. In my opinion, the phase should change smoothly while the receiver moving with a constant speed.
The only phenomenon I have found is that the phase flip at the subcarrier whose fading is great, and the flip point of the phase looks like get an extra Pi offset.

Have you met this problem while you perform your experiment? Do you know the reason why and when this jump occurs and do you have solutioins to get rid of it?

It confused my several days and I'm waiting for your reply. Thank you in advance.
Shu

CSI_dev. What does it?

Hi there,

I would use two Atheros NICs on one PC. Therefore, I run two identical recv_data and both try to use the same file /dev/CSI_dev. Is it ok, or have I to separate that file that each NIC and recv_data will have the own CSI_dev file? Is it possible?

And what does this file and who writes data into?

Thanks.

Sample data?

Can you upload some sample data logged by this csi tool? Then the user can try it before assembling this system.

ps: this csi tool is really excellent work, a lot of citations are coming...

assignment from incompatible pointer type [-Wincompatible-pointer-types] using read csi mex file

Hi, I am trying to use your tool to receive CSI but I have some problems using your MATLAB code. The problem is that when I try to make mex file I face the following warnings. After running the code I face the error which tells MATLAB faced an internal error and close the MATLAB. I will appreciate it if you can help me with my problem.
read_csi.c:67:11: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
nr_p = mxGetPr(prhs[1]);
read_csi.c:70:11: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
nc_p = mxGetPr(prhs[2]);
warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
num_tones_p = mxGetPr(prhs[3]);

Plot : CSI Vs No. of Packets

Plotting CSI Vs Packet in MATLAB giving high variance.

main = read_log_file('raw');
struct_array = [main{:}];
csi = [struct_array.csi];
sub56 = csi(2,:,56)
plot(abs(sub56))
xlabel('No. of packets');
ylabel('CSI');

untitled

Can anyone suggest what might have gone wrong? Or what should be done for calibration?

setting up the drivers

Hello,

I have installed the kernel version as documented.

My system comprises of a receiver and transmitter both using AR9820 with 1x1 for now (ultimately, I would like to use 1(tx) x 3(rx)) on a X-200 Thinkpad.

I tried calling sendData ifName mac nPackets, but all of the packets compain "send failed" (I have configured the ifName to be wlan0 on rules.d).

I figured that I have not configured the wifi-cards properly (i.e. monitor mode, injection mode, antenna selection, channel frequency, etc...). Do you have an example of how to setup the hardwares so that the packets can be sent with success?

Thank you

How to Process log file in MATLAB

Hi,
We have successfully logged file with CSI and now want to process it in MATLAB. Can you please guide how to extract CSI from received file using MATLAB scripts or any other option that is available.
We previously used Intel 5300 CSI tool in which we used to obtain dat file and later extract CSI from file using MATLAB scripts provided by the author of CSI tool ,Daniel Halperi.

I have read your user guide but could not get the desired help. It would be very helpful if you provide a little bit guidance about processing of log file obtained using your Atheros tool. Thanks!

Regards,
Asif Hanif
[email protected]

Additive white Gaussian noise filter out

As known, the CSI data is represented as a channel matrix according to MIMO technology.
Therefore, the formula looks like this:
y = H times x + n, where n is an additive white gaussian noise. How can I filter out this noise? This noise can be everything, what generates unexpected data.

Is it possible to filter out it at Atheros CSI tool?

Thank you

CSI

Hi,

I am involved with the project which need to record the CSI. So I am eager to follow your shared experiences. I want to borrow the laptop from university but I need the specified model and brand.

Thank you,
Vida

Why the number of antennas is not corresponding to CSI matrix?

I use TP-link wdr4300 as AP and client. And I set 3 antennas and 1 antenna on AP and client respectively.
But my CSI matrix is 2256.
I also try 1 antenna on both AP and client, but I still get CSI as 2256 matrix.

CSI data from condition of AP and client both with 1 antenna.
image
CSI data from condition of AP with 3 antennas and client with 1 antenna.
image

Did anyone meet this problem?

" Failed to open the device...: No such file or directory "

My laptop has Atheros AR9565 . I have installed linux kernel according to the Atheros-CSI-Tool-User-Guide. And after checking my kernel version i get the following
4.4.0-66-generic

Now, i am not actually sure about whether my installation is successful or not because when i am running main.c for receiving CSI , it says that " Failed to open the device...: No such file or directory" . That means it is not finding "/dev/CSI_dev".

It would be helpful if you can tell where is the problem and what is the solution.

Thank you.

How to get CSI data: with only one WiFi node with running modified driver?

We have the following configuration:

  1. One WiFi node with atheros chip set (93xx, 94xx or 95xx) running the modified driver (in the AP mode). For description let us call this Node A.
  2. Another node with IEEE802.11n (without modified driver). Again, for description let us call this Node B.

We are trying to:

  1. Send packets using ping (or use user space application provided) from Node A to Node B
  2. Gather CSI at Node A itself.

From earlier descriptions we have seen that Node A and Node B has to run the modified atheros driver. How can we enable the following scenario:

  1. Only Node A runs the modified CSI without any modifications on Node B.

OpenWRT, csi-len = 0

Hi there,

I am trying to get this working on a TP-LINK TL-WA901ND v4 Access Point using OpenWRT.

I have sucessfully ported the modified driver from here:
https://github.com/xieyaxiongfly/Atheros-CSI-Tool
to OpenWRT, but was having issues with it.

I have then found
https://github.com/xieyaxiongfly/AtherosCSI_openWRT_version
And am still having the same issues.

I have attached patches for both versions.

According to the openwrt-wiki the AP uses the AR9380 chipset:
https://wiki.openwrt.org/toh/tp-link/tl-wa901nd

Dmesg however reports AR9561:
[ 9.533407] ieee80211 phy0: Atheros AR9561 Rev:0 mem=0xb8100000, irq=47

When using either patch I am allways getting csi_len = 0.

(As you can see I have added it to the output of recv_csi)

Any suggestions, what could be going wrong?

(Both receiver and transmitter use the same hardware with the patch)

Thank you.

root@OpenWrt:~# send_Data wlan0 60:E3:27:4D:C9:63 1000
Packet Length is: 1014,pkt_num is: 1000

root@OpenWrt:~# recv_csi
//
/* Usage: recv_csi <output_file> */
/
/
#Receiving data! Press Ctrl+C to quit!
Recv 1th msg with rate: 0x96 | payload len: 92 | csi len: 0
Recv 2th msg with rate: 0x96 | payload len: 1040 | csi len: 0
Recv 3th msg with rate: 0x96 | payload len: 1040 | csi len: 0
Recv 4th msg with rate: 0x96 | payload len: 1040 | csi len: 0
Recv 5th msg with rate: 0x96 | payload len: 1040 | csi len: 0
Recv 6th msg with rate: 0x96 | payload len: 1040 | csi len: 0
Recv 7th msg with rate: 0x96 | payload len: 1040 | csi len: 0
Recv 8th msg with rate: 0x96 | payload len: 1040 | csi len: 0
Recv 9th msg with rate: 0x96 | payload len: 1040 | csi len: 0
...

560-ath9k_csi_tool.patch.txt
ath9k-openwrt-new.patch.txt

Atheros Card used for Sample File

Hello @xieyaxiongfly,
can you tell me which card you used to record the sample file (sample_bigEndian.dat).
I currently have two WiFi Nic's with an Atheros 9344 running OpenWrt. When im recording CSI information, my phase angles are all over the place. With your sample file this is not the case, the phase angles behave as expected.

Niklas

CSI for openwrt?

Hello!
I would like to know if you have the experience of running CSI-Tool on openwrt system?
Looking forward your reply!
Thanks a lot!

Ping-Pong

The main idea is that we run the ping like this

sudo ./send_data ifName Mac nPkt

Is there a possibility to send the answer from the receiver back to the sender and also write it in log.dat.

For example, if we ping an IP or google.com, we get back bytes of data.
I want to have the same thing by using CSI-Tool. The Problem is that we "ping" just MAC and send the packets which will be written in a .dat file. How can I run CSI-Tool like ping-pong, where pong is the answer of receivers.

Thank you vary much.

AR_hw_upload_flag

Hi,
I was testing your driver-code on ubuntu, on AR-9382 chipset,. I realized that in the function csi_record_status,, hw_upload_flag, and hw_upload_data_type is always 0. I'm guessing this means that the CSI is never reported to the MAC. So, is there any way to explicitly turn-on these flags?
So, is this specific to the chipset I am using or is there anyway i can force the chipset to report the CSI data to the MAC? Also, the RX_not_sounding flag is 1.

Receiving probe request/response packet in monitoring mode

Hello,

I want to receive probe request/response packets in monitoring mode.
Now, I'm already in monitoring mode and tremendous packets comes in.
However, I couldn't find any probe r/r packets at all.
I both check it with "Wireshark" and Wireshark can capture probe r/r packets.
So, How could I capture both normal data packets and probe request/response packets?
Thank you for your help.

Jaewon Kim

Please help to find solution

First of all, I would like to explain our scenario of the measurement setup.

  1. We want to use the tool as ping-pong and then we to do analyzing of CSI data. It means that after execution of command sudo ./send_data wlan0 MAC_OF_RECV 10 we get 10 or less than 10 packets on the receiver, which is shown (we suppose) via Recv X-th msg…., where X means the number of received packets, we want to send the answer back to the transmitter. This is like a pinging of an IP, where you get a response of each ping. It seems that your tool does not support such function. To achieve our purpose, we used the sendData.c and modified it and now after printing Recv X-th msg… is called the function sendData(total_msg_cnt) which sends a new packet back to the transmitter. However, this is very bad, because we would have the same packet back, which we sent to the receiver. Could you please let us know, how we can get the same packet back on the transmitter?

  2. The next modifying was that we used the function process_csi to print the CSI status in the terminal, where we can see the whole information about CSI data (this saves a lot of time because we do not need to use MatLab to see the CSI status while testing). Sometimes we get 0 CSI-Timestamp and sometimes we get the value 1092516660480 microseconds which is always the same and never changes. Also, we get sometimes 0 or 2 for the number of transmitting antenna, although we use 3x3 antennas (AR9380). This is also strange. Could you suppose something that can have an influence on it?

  3. One more problem is with the AP. We could not get an AP under 802.11n standard. We want to use 5 GHz for our measurement setup. The last way was to configure the hospapd under the 802.11a standard, which supports 5 GHz. However, this standard does not support a MIMO technology, which is very important to obtain a CSI data. During the configuration of 802.11n standard, we got always the error that the device does not support the hw_mode. We tried to use an another Atheros NIC (AR9380), but is has nothing changed. The same problem with AP. (all devices has been chosen according to the list of supported devices. Could you also tell something about this problem?

Please help to find a solution.....

Best wishes,

Intrepret CSI without Matlab

Hi,

Is there a way to interpret data without Matlab?
The content of the generated file when using recv_csi is unreadable in a text editor, how could I interpret CSI data?

Thanks for your help.

payload len: 1924

Hi all,

why I get payloads with len 1924? How can I avoid them?
They destroy the whole log.dat. And I also get other payloads with different len, even when the recv_csi is started, but nothing has been sent to it from send_Data.

Why it happens?
Please help me to find a solution.

Best wishes

Collect CSI from UDP broadcast

Hello, Is it possible to receive CSI from UDP brodacast using this tool?

We have AP and client receive CSI working using ICMP pings. However, if we have client receive UDP broadcast packet coming from AP, we receive data on client via tcpdump, however no CSI is recorded.

P.S.
AP code:

Client code:
tcpdump -i wlan0 port 54545 -XX

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.