Comments (7)
Hi, that code is functional but incomplete. My only test system using IWL5300 encounters a buffer overflow after reading CSI in real-time for longer than 1 minute. I am inexperienced with Linux sockets and as such haven't been able to effectively debug this issue. For now there may be better solutions for this elsewhere, but I may be able to investigate this again soon.
from csikit.
with the following snipped you can try to use the realtime capture:
def print_and_fill(csiEntry):
print(csiEntry)
global entrys
entrys.append(csiEntry)
reader = IWLBeamformReader()
entrys = []
reader.read_log(print_and_fill)
from csikit.
Are you sure that a buffer overflow happend? Because currently I am using the https://github.com/pgawlowicz/linux-80211n-csitool-supplementary/blob/master/python/netlink.py code to extract csi at real time and have no problems.
this code seems to be very close to yours.
a few times the driver crashes after collecting much data but I had this behavior also with the log_to_file.
a simple restart of the iwl with ifconfig w1p1s0 down && ifconfig w1p1s0 up
fix the issue of the broken driver.
from csikit.
i try to merge your code with the code by pgawlowicz.
Did the following function I found in your code work?
def read_bf_entry(self, data):
"""
This function parses a CSI payload not associated with a file (for example: those extracted via netlink).
Parameters:
data (bytes): The total bytes returned by the kernel for a CSI frame.
Returns:
csi_block (dict): Individual parsed CSI block.
"""
csi_header = struct.unpack("<LHHBBBBBbBBHH", data[4:25])
all_data = [x[0] for x in struct.Struct(">B").iter_unpack(data[25:])]
csi_block = self.read_bfee(csi_header, all_data)
return csi_block
Because I get an exception if i want to fit the udp payload into this function
csi_header = struct.unpack("<LHHBBBBBbBBHH", data[4:25])
struct.error: unpack requires a buffer of 20 bytes.
the code diff at netlink.py is only:
CN_NETLINK_USERS = 11 #his
CN_NETLINK_USERS = 10 #yours
and the return of the payload :
payload = data # his
payload = data[32:] #yours
it seems that if the CN_NETLINK_USERS = 10 is set, then the socket is never receiving datagramms. therefore i think the 11 is right. but which datapart has to be passed to the read_bf_entry
? Both variants caused the same error
Here you can find the current code state:
https://github.com/tweigel-dev/CSIKit/tree/feature/realtime
from csikit.
I noticed that data[4:25]
gives a length of 21, but the struct.unpack needs 20. There is the source of the issue I think
from csikit.
Hi, that code is functional but incomplete. My only test system using IWL5300 encounters a buffer overflow after reading CSI in real-time for longer than 1 minute. I am inexperienced with Linux sockets and as such haven't been able to effectively debug this issue. For now there may be better solutions for this elsewhere, but I may be able to investigate this again soon.
Look here maybe this helps you to fix the issue
dhalperi/linux-80211n-csitool-supplementary#175
from csikit.
Thank you, I will attempt this solution once I've also had time to merge your PR!
from csikit.
Related Issues (20)
- How to save the images related to signal processing
- RxSBasicSegment has no attribute cbw HOT 6
- Do you have any information about Intel 5300 CSI data structure?
- how can i solve this problem? (empty part of data) HOT 8
- RuntimeWarning encountered when using CSIkit with Nexmon's CSI
- Graph Dimension Mismatched HOT 2
- Filtering Methods
- 0 compatible WiFI COTS NICS are found HOT 2
- Questions about CSIKit HOT 1
- Decoding the CSIData section in the frame payload
- Is there anyone could share the raw csi-data from ESP32? Thanks. HOT 1
- csikit file_name.pcap error, how to resolve it?csikit file_name.pcap error, how to resolve it? HOT 7
- CSI data collection issues HOT 1
- PicoScenes installation error HOT 1
- Deprecated np.complex type and incompatible PicoScenes subsegment version type HOT 2
- CSI deals with issues
- Using a routine to process data collected by PicoScene generates an error: struct.error: unpack requires a buffer of 4 bytes
- Questions and issues with csi matrix
- Subcarrier Identification
- OverflowError: Python integer 2806 out of bounds for int8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csikit.