caichao / livestreamcsi

33 stars 11 forks source link

The error about "Wrong beamforming matrix size" #3

Open anruoran opened 7 years ago

anruoran commented 7 years ago

In the process of run the realtime_plot, the error "Wrong beamforming matrix size" occasionally happen. I guess maybe the transmitting rate is too high, but I couldn't use ping to modify the rate. Because tcpip is directly built after run my real-time data processing program and sudo ./log even haven't used ping. Do you have any idea, Mr Cai? @caichao

anruoran commented 7 years ago

It seems csi is samplinged with a very high rate after tcpip is built. If I want to reduce the rate,what should I do?

caichao commented 7 years ago

The default rate for csi sampling is 1Hz if you just use "ping 192.168.x.x". If you want to accelerate the sampling rate, you can use "ping 192.168.x.x -i 0.01". Then, the sampling rate will be 1/0.01 = 100 Hz.

The cpu of my computer is i3. The OS is ubuntu 14.02 64bit. If I set the sampling rate 100Hz, the error "Wrong beamforming matrix size" will pop out. The error comes out because that, to correctly decode the csi stream, it should receive 392 bytes(corresponding to 2 tx antennas) while actually, it didn't. The corruption occurs mainly by the way much high transmission rate.

To solve this problem, you can use pure java method in matlab. You can use multi-threads and notify the user using callback function. In this way, the program will be much more effcient, thus accelerating the sampling rate.

anruoran commented 7 years ago

Thanks for your reply, I know use "ping 192.168.x.x -i xx" can modify the rate of ping, but I find I can't use ping to modify the rate. Because tcpip is directly built and data can show after run my real-time data processing program and sudo ./log even haven't used ping.

caichao commented 7 years ago

Maybe you should use another port. The example uses port 1234. It is highly likely that some other programs use this same port. It is recommended to use port number that is larger than 10000. Or before you use a certain port, you can check it before.

anruoran commented 7 years ago

It doesn't work when I use a port number which is larger than 10000. The method I use is sends the CSI data to another computer because I couldn't connect ok in localhost. After I ran matlab program on another computer then sudo ./log on terminal, the terminal display connect ok and matlab program begin to show some result. It seems to have skipped the ping process and it won't be affect whether or not I use ping.

caichao commented 7 years ago

Did you computer already link to an AP? If it is true, that may be the problem. The program runs on the matlab must be executed before csi logs out. If you computer already links to an AP. Any crosstalk between the AP and the computer will make the network card log out csi. And yet, you can not control this.

anruoran commented 7 years ago

Yes, my computer already link to an AP. If computer link to another AP, the connect will fail. I think it because of that, I 'll try other method, thanks a lot.

zhangshaohu commented 6 years ago

@anruoran I met the same issue. If I ping low sampling rate at 10 Hz, It is okay. but If I ping higher rate (100 Hz)it will show the error "Wrong beamforming matrix size" . Any idea?

steven520142 commented 6 years ago

@zhangshaohu I have the same issue too. Did you fix it? sometimes, it will show the error "Wrong beamforming matrix size" in very short time. But, sometimes, the system can run like 20 minutes then shows the error.

zhangshaohu commented 6 years ago

@steven520142 No, I didn't. I also sometimes see this issue when I post process the csi data. I think it probably the receiver received incorrect data packet when the packet rate is high.

caichao commented 6 years ago

As far as I know, the problem may be caused by the high sampling rate. Also, it is correlated with the performance of the hardware. Can you guys post you debug information here? You can first run the "dbstop if error" and then the program will stop if any error appears. After that, you can check where the problem is. Hope you(@anruoran @zhangshaohu @steven520142 ) can post the debug results here so that we can make this utility more robust.

steven520142 commented 6 years ago

Hi, the error will happen at line "csi = read_bfee(d);". I check the length of data is 392 which is correct. I'm really confused right now. Do you(@anruoran @caichao @zhangshaohu ) have any idea?