Skip to content

The RSSI value of ESP32 is abnormal and the negative value cannot be recovered  #4765

@ws-Hulk

Description

@ws-Hulk

Hardware:

Board: NodeMCU-32S [ESP32D0WDQ5(revision 1)]
Core Installation version: 1.0.4(arduino-esp32)
IDE name: Arduino IDE 1.8.13
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows 10

Description:

  1. The connection to the router is normal, and the connection to other mobile phones is normal.
    Therefore, the problem is that the RSSI value of ESP32 will be directly equal to 0, and will not be converted to a negative value by itself.

  2. In tracking bug mode, besides Serial.println();, is there any way to query Log?

//Change the code below by your sketch

#include <Adafruit_NeoPixel.h>
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

#include "sdkconfig.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "esp_wifi.h"
#include "ESP32TimerInterrupt.h"
#include "driver/gpio.h"
#include <WiFi.h>                                 // 20200422 Hulk Wi-Fi Socket
#include <Update.h>                               // 20200422 Hulk OTA
#include <NeoPixelBus.h>
#include <EEPROM.h>
#include <time.h>
#include "esp_smartconfig.h"

const char* ssid = "PMR-iBUYPOWER";       
const char* password = "ibuy13579";

void setup() {
	Serial.begin(115200);
	while (!Serial); // wait for serial attach

	WiFi.begin(ssid,password);
	WiFi.mode(WIFI_STA);

	WiFi.setHostname("Anthelion");                                        // 20200422 Hulk set Host name

	//Wait for WiFi to connect to AP
	Serial.println("Waiting for WiFi");
	int connected_count = 0;
	esp_wifi_set_ps(WIFI_PS_NONE);                                        // 20200224 Hulk WIFI_PS_NONE = 0, Wi-Fi sleep is off

	while (WiFi.status() != WL_CONNECTED) 
	{ 
		digitalWrite(LED_BUILTIN, LOW);     // sets the LED on
		delay(500);
		digitalWrite(LED_BUILTIN, HIGH);    // sets the LED off
		delay(500);
		Serial.print(".");
	}

	Serial.println("");
	Serial.print("Host Name: ");
	Serial.println(WiFi.getHostname());
	Serial.println("WiFi Connected.");
}

void loop() {
	// put your main code here, to run repeatedly:
	long int rssi = WiFi.RSSI();
	Serial.println(rssi);
	if ((rssi < (-60)) && (rssi >= (-90))) 
	{
		Serial.println("Bad ... ... ...");
	}
	else if (rssi < (-90)) 
	{
		Serial.println("Extremely poor ... ... ...");
	}
	else if (rssi == 0)
	{
		Serial.println("No IP ... ... ...");
	}
	else if ((rssi > (-60)) && (rssi < (0)))
	{
		Serial.println("Good ... ... ...");
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions