Esp8266 only available as a hotspot
Posted: Sat Apr 11, 2020 5:12 am
When i connect my esp-015 to arduino, i can see a hotspot appear in my phone wifi settings. So, I decided to write some sample code.
When i compile and run my code i get the following error after "Connecting ....." showing in the console. The error is
Code: Select all
#include <ESP8266WiFi.h>
const char* ssid = "wifiname";
const char* password = "password";
void setup() {
Serial.begin(115200);
delay(10);
Serial.println('\n');
WiFi.begin(ssid, password);
Serial.print("Connecting to ");
Serial.print(ssid);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print('.');
}
Serial.println('\n');
Serial.println("Connection established!");
Serial.print("IP address:\t");
Serial.println(WiFi.localIP());
}
void loop() {
}
When i compile and run my code i get the following error after "Connecting ....." showing in the console. The error is
Code: Select all
. I suspect that my module cant connect but I have no idea why.raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error)). esptool.FatalError: Failed to connect to ESP8266: Invalid head of packet (0x65)