错误为'invalid conversion from 'char*' to 'uint8_t {aka unsigned char}' [-fpermissive]'
。我试图使用ssid从网络获取rssi而不直接连接到它。
char ssid[]="GreenNET";
void updateRSSI(){
rssi = WiFi.RSSI(ssid);
Serial.print(rssi);
Serial.print(" dBm");
Serial.println();
}
答案 0 :(得分:1)
WiFi.RSSI
采用网络索引,而不是SSID字符串:
char ssid[] = "GreenNET"
uint8_t available_networks = WiFi.scanNetworks();
for (uint8_t net = 0; net < available_networks; ++net)
{
if (strcmp(WiFi.SSID(net), ssid) == 0)
{
rssi = WiFi.RSSI(net);
Serial.print(rssi);
Serial.print(" dBm");
Serial.println();
break;
}
}