Joshua
Junior Member
Posts: 75
|
Post by Joshua on Aug 8, 2019 18:34:03 GMT
Hello Folks,
Could you provide some insight as to why my ESP8266 continues to publish the SSIDs FaryLink_XXXXXX or ESP_XXXXXX where XXXXXXX is part of the mac address? From my research, I've read where this could be the result of residual code or a hanging variable on the ESP. I can't seem to resolve this problem. It worries me that I can connect and receive an IP (192.168.4.X) due to the possible security vulnerabilities this can cause.
Here are the steps I've taken: - Trying multiple sketches. I thought the issue may have been with RFLink-MQTT-Gateway However, the problem problem persists with the PupSubClient example code mqtt_esp8266 - Trying previous versions of esp8266 boards package in Arduino IDE - Trying previous versions of PubSubClient library package in Arduino IDE
- Trying both Arduino IDE 1.6.12 and 1.8.8 - Flashing with Platform.io
It appears that the problem orginates in association with the PubSubClient library. I do not get a ghost SSID using the WiFiClient from the ESP8266WIFI example.
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Aug 21, 2019 16:11:51 GMT
I fixed it and updated the code to remove the need for credentials.h. Here's the section of the fix with my comments..
#include <ESP8266WiFi.h> #include <PubSubClient.h> //#include <credentials.h> //Removed to validate the ssid and password lines below
// Update these with values suitable for your network.
const char* ssid = "wifi station"; //usable with credentials.h commented out const char* password = "wifi pass"; //usable with credentials.h commented out const char* mqtt_server = "XXX.XXX.XXX.XXX"; const char* MQTT_USER = ""; const char* MQTT_PASSWORD = ""; const char* MQTT_TOPIC_REC = "RFLINK_REC"; const char* MQTT_TOPIC_TRANS = "RFLINK_TRANS";
String hi = ""; bool dataAvailable = false;
WiFiClient RFLink433Gateway; PubSubClient client(RFLink433Gateway); //needs to be unique within your MQTT system long lastMsg = 0; char msg[50]; int value = 0;
void setup_wifi() {
delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.mode(WIFI_STA); //Added to remove ghost SSID WiFi.begin(ssid, password);
|
|