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

Serial output from sigmon command does not display human-readable RSSI values #631

Open
iay opened this issue Jan 2, 2025 · 0 comments
Open

Comments

@iay
Copy link

iay commented Jan 2, 2025

Describe the bug

The sigmon command results in output in which the RSSI values are presented as single characters instead of the negative decimal values that are used in the rest of the UI. This makes them very difficult to interpret.

To Reproduce

Flash firmware to a board; connect using cu or some other terminal app. Run sigmon and observe the output:

iay RSSI: ? 
iay-temp RSSI: ? 

Expected behavior

I'd have expected consistent human-readable values across the (serial) UI.

I'm using an ESP32-WROOM-32D based development board flashed with the latest "mini" firmware. I'm looking at the output using cu from a Mac.

I think the reason for this is that the code in WiFiScan.cpp (about line 3454) that generates this output is casting the rssi field from the AccessPoint structure to String for output. The field (defined in EvilPortal.h) is a char and casting it to String makes it a single character with that (positive) value.

I put the following in an Arduino sketch to check this finding:

  // The rssi field in AccessPoint is a char.
  // Found in EviPortal.h
  char r = -86;

  Serial.println("What the Marauder code does:");
  Serial.println("RSSI: " + (String)r);

  Serial.println("What the code should perhaps do instead:");

  // Pull out an RSSI value for display.
  // Note that char is an unsigned type.
  int rssi = -(256-(int)r);

  Serial.println("RSSI: " + (String)rssi);

  // Or, store in a more appropriate field
  int8_t rs = -86;
  Serial.println("RSSI: " + (String)rs);

Output was as follows:

RSSI: �
What the code should perhaps do instead:
RSSI: -86
RSSI: -86

I think this probably used to work. There's another definition of AccessPoint commented out in WiFiScan.h which uses int rssi and I think that would have avoided the issue as well.

I see a couple of other issues in this repo which are probably the same underlying problem.

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

1 participant