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

Error with wpa_supplicant #4

Open
Jivonchi opened this issue Aug 22, 2023 · 7 comments
Open

Error with wpa_supplicant #4

Jivonchi opened this issue Aug 22, 2023 · 7 comments

Comments

@Jivonchi
Copy link

Hi! I have kernel [5.10.92] installed. After installing nexmon using the command, when I try to connect to a WiFi network, I get the error : "Could not communicate with wpa_supplicant" and "There was an error running option S1 Wireless LAN". Any idea why?

@Asafe33
Copy link

Asafe33 commented Jan 22, 2025

Hello, this error also happened to me. I’m not sure why. I’ve recompiled everything, but the error persists. What’s interesting is that this didn’t happen before. I used to just compile, add my script, download Nexmon, and start collecting data.
I also followed the instructions in this reference: https://staff.washington.edu/shrike/unix/linux/how-to-enable-users-to-capture-packets/
But as I mentioned, it was working before. However, now the Wpa_supplicant is showing these issues.
Do you know the reason why this error appears in Wpa_supplicant? Also, when I try to do what’s in the link, it says the path is wrong, but it isn’t. @zeroby0

@zeroby0
Copy link
Contributor

zeroby0 commented Jan 22, 2025

Wpa_supplicant is removed when installing nexmon_csi because it interferes with csi collection. If you run uninstall.sh from the nexmon_csi_bin, it restores the original firmware and wpa_supplicant. You can't do packet collection without uninstalling nexmon_csi either, the firmware doesn't send actual packets, only csi data.

Don't know about the S1 wireless lan error, haven't seen it before.

If /usr/sbin/tcpdump exists, it should work, don't know why it doesn't. Can you post the exact error?

@Asafe33
Copy link

Asafe33 commented Jan 22, 2025

Image

Yes!!

The first two codes work normally, however when I proceed with the commands this error appears.

@zeroby0
Copy link
Contributor

zeroby0 commented Jan 23, 2025

The first two didn't work normally, they too report that /usr/sbin/tcpdump doesn't exist.

Anyway, you don't have to do this, you can just run tcpdump with sudo.

@Asafe33
Copy link

Asafe33 commented Jan 23, 2025

Thank you for your previous response @zeroby0 . I have one last question.

I’ve been diving into your code for visualizing information in PCAP files (https://github.com/nexmonster/nexmon_csi/tree/feature/python/utils/python), and I’m super impressed with the work!

As a physiotherapist, I’m looking to apply CSI knowledge for clinical purposes. While analyzing related works, I noticed many researchers apply filters like Hampel, moving average, and bandpass to remove outliers and noise. I’ve incorporated these into my workflow successfully.

However, I’m running into challenges when trying to apply PCA (Principal Component Analysis). Many studies analyze relationships like amplitude vs. time or amplitude vs. collected packets (nsamples). I’ve observed that these seem correlated, but I’m unsure if my interpretation is correct.

Have you worked on creating these relationships, like amplitude vs. collected packets or amplitude vs. time? If so, I’d appreciate any insights you can share. If needed, I can forward my full code for context.

@zeroby0
Copy link
Contributor

zeroby0 commented Jan 24, 2025

If you want amplitude vs packets, that's pretty much a spectrogram of the channel response, I think. You can use https://github.com/nexmonster/nexcsi to create that really easily.

import numpy as np
from matplotlib import pyplot as plt
from nexcsi import decoder
device = "raspberrypi" # nexus5, nexus6p, rtac86u

samples = decoder(device).read_pcap('output-80.pcap')

csi = decoder(device).unpack(samples['csi'], zero_nulls=True, zero_pilots=True)

csi = csi[:1000] # The first 1000 samples of CSI

plt.imshow(np.absolute(csi).T)
plt.show()


# Save with plt.imsave('spectrogram.png', np.absolute(csi).T)

Image

Image

This is amplitude vs packets. But if you want a true amplitude vs time, I have no idea how to do that. The timestamps are in microseconds and if you try to plot a 1 minute spectrogram, matplotlib will crash from lack of memory.

@Asafe33
Copy link

Asafe33 commented Jan 25, 2025

@zeroby0 , I wasn’t familiar with this other code of yours, and after checking it out, I realized it’s an improved version of the earlier code I’ve been using—the one I’ve been using and mentioned making some implementations on. I’m planning to implement the suggestions from this updated version and see if I can merge both codes together to enhance my project. If it’s not too much trouble, I’d really appreciate it if you could take a look at my code. I have some doubts about whether I’ve fully grasped the concept, and you’re the best person to provide me with some clarity on this.

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

3 participants