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

IndexError: list index out of range #11

Closed
makoc0704 opened this issue Jun 16, 2021 · 8 comments
Closed

IndexError: list index out of range #11

makoc0704 opened this issue Jun 16, 2021 · 8 comments

Comments

@makoc0704
Copy link

Hey,

I have collected data using the Nexmon-CSI-Tool:
https://github.com/nexmonster/nexmon_csi/tree/pi-5.4.51-plus

I've collected the CSI data and store them in a pcap file :
output.zip

I dont even get an output of these File:
csikit output.pcap
Traceback (most recent call last):
File "/usr/local/bin/csikit", line 10, in <module> sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/CSIKit/__main__.py", line 57, in main display_info(args.file)
File "/usr/local/lib/python3.7/dist-packages/CSIKit/tools/get_info.py", line 7, in display_info metadata = csi_data.get_metadata()
File "/usr/local/lib/python3.7/dist-packages/CSIKit/csi/csidata.py", line 45, in get_metadata final_timestamp = timestamps[-1]
IndexError: list index out of range

If i use your examples, it works.
Thanks in advance!

@Gi-z
Copy link
Owner

Gi-z commented Jun 17, 2021

Hi, this appears to be a parsing issue. The chipset header in your CSI data appears to be slightly different to those I've previously observed, and while the file does not successfully parse under the bcm43455c0 (Pi 3B+/4) format, it successfully parses with the bcm4366c0 (Asus RT-AC86U) format.

Can you confirm the hardware you used to collect this data? e.g. Raspberry Pi 4, Asus RT-AC86U, or another device. Thanks.

@makoc0704
Copy link
Author

Thank you for your prompt reply!
I have set up a Raspberry Pi 4 Model B Rev 1.2 as AD and ping it with my laptop.
With another Raspberry Pi 4 Model B Rev 1.2 - on which the nexmon software is installed - I collect the CSI data as described in the documentation.

Thank you for your help!

@Gi-z
Copy link
Owner

Gi-z commented Jun 17, 2021

Great, I'm looking at this now. Can you also confirm the makecsiparams settings you used when configuring nexmon_csi?
Edit: If possible, the readout from nexutil -k would also be very useful.

@makoc0704
Copy link
Author

Sure!
makecsiparams settings:
mcp -c 36/80 -C 1 -N 1 -m <MAC of Pi - Access Point, that receive ping>
KuABEQAAAQDcpjJNqg8AAAAAAAAAAAAAAAAAAAAAAAAAAA==
ifconfig wlan0 up
nexutil -Iwlan0 -s500 -b -l34 -vKuABEQAAAQDcpjJNqg8AAAAAAAAAAAAAAAAAAAAAAAAAAA==
iw dev wlan0 interface add mon0 type monitor
ip link set mon0 up
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
Got 31

nexutil:
nexutil -k
chanspec: 0xd022, 34

If I enter nexutil -k 36/80 I get an error:

nexutil -k 36/80
nexutil: Too many arguments

@Gi-z
Copy link
Owner

Gi-z commented Jun 17, 2021

The format for setting a channel with nexutil is nexutil -k36/80. Not sure why spaces aren't allowed 🤷

This is interesting though. I have been able to get your file to parse and this seems to be an exacerbated version of an issue I've encountered before. The pcap frame header appears to be 26 bytes larger than normal. I'm implementing a solution for this and am hoping to have it ready by the end of the day. I've included a visualisation of your data below as proof!

Edit: Just to highlight, thanks for bringing this issue to me. Resolving small issues like this ensures I can keep this library up to date and ready to automatically parse any given CSI file.

image

@makoc0704
Copy link
Author

Great, thank you very much for your help!

@Gi-z
Copy link
Owner

Gi-z commented Jun 17, 2021

Apologies for the delay. This'll take a little time to implement elegantly.

In the interest of making sure you have something, I've linked a temporary build you can install which will parse your files correctly. Any other nexmon filetypes will fail, but this will work with the system you're currently running.
https://drive.google.com/file/d/1rjnCiJgeh7CZFN_ZfQEWGfcv1dZBp-Qt/view?usp=sharing

You can install it by navigating to the root folder (containing setup.py) and running:

pip uninstall csikit
python setup.py install

I hope to have a solution for this issue merged into master soon. Best of luck with your work!

@makoc0704
Copy link
Author

makoc0704 commented Jun 18, 2021

Awesome, it works!
Big thanks for your help :-)

Edit: Great project by the way :-)

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