Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Mingy
#48022 I was somehow able to get rid of the strdup() issue but I honestly don't know how. I did figure out how to modify the compiler settings but the problem persisted, then magically disappeared.

I am at a complete loss to figure out what is wrong with WiFi.RSSI.
When I do this
int r = WiFi.RSSI(i); //I get an error
int p = WiFi.RSSI(); //I do not get an error

This seems that somehow the code in ESP8266 WiFiScan is not getting compiled correctly, even though int n = WiFi.scanNetworks(); generates no error.

I tried inserting a #pragma statement to see if the compiler was getting the to the declaration

int32_t ESP8266WiFiScanClass::RSSI(uint8_t i) {
struct bss_info* it = reinterpret_cast<struct bss_info*>(_getScanInfoByIndex(i));
if(!it) {
return 0;
}
return it->rssi;
}

but somehow #pragmas are suppressed (i can't figure out where).


Can I ask what IDE you are using that works? Arduino works OK for me, but I am working on a project which I figure is going to be very big so it is too primitive.

I tried using PlatformIO but got nowhere (couldn't compile a thing) and, in any event, I am using Eclipse for other things.

Thanks again
User avatar
By Wolle
#61234 In eclipse You can see that:
WiFi1.jpg

There is only one entry by methods with the same name. Cause is the keyword "using" in the file "ESP8266WiFi.h"
- using ESP8266WiFiScanClass::SSID;
- using ESP8266WiFiSTAClass::SSID;
The second one hides the first one if the name of the members are equal.
You can fix that as follow:
Code: Select all   
String  SSID(uint8_t networkItem)    {return ESP8266WiFiScanClass::SSID(networkItem);}
int32_t RSSI(uint8_t networkItem)    {return ESP8266WiFiScanClass::RSSI(networkItem);}
uint8_t *BSSID(uint8_t networkItem)  {return ESP8266WiFiScanClass::BSSID(networkItem);}
String  BSSIDstr(uint8_t networkItem){return ESP8266WiFiScanClass::BSSIDstr(networkItem);}
int32_t channel(uint8_t networkItem) {return ESP8266WiFiScanClass::channel(networkItem);}

String  SSID(void)                   {return ESP8266WiFiSTAClass::SSID();}
int32_t RSSI(void)                   {return ESP8266WiFiSTAClass::RSSI();}
uint8_t *BSSID(void)                 {return ESP8266WiFiSTAClass::BSSID();}
String  BSSIDstr(void)               {return ESP8266WiFiSTAClass::BSSIDstr();}
int32_t channel(void)                {return ESP8266WiFiGenericClass::channel();}

using ESP8266WiFiScanClass::encryptionType;
using ESP8266WiFiScanClass::isHidden;


Then all members are visible
WiFi2.jpg


Wolle
You do not have the required permissions to view the files attached to this post.