Hello,
I have a problem that I don’t know how to solve.
I compile and install a very simple code that only tries to connect to my home Wi-Fi.
I have an ESP12-E and a nodemcuv2 that I am doing tests on.
Case 1: Once the code is installed on ESP12-E:
- If the power comes from the computer via USB, it connects perfectly to the Wi-Fi
- If the power is through electric current then it cannot connect
This behavior seems very strange to me and I have done many tests with the same result.
Case 2: Code installed on nodemcuv2
- I can’t get it to connect to the power from the computer.
this is the device with ESP12-E
I have verified with a multimeter that the voltage that ESP12-E receives is 3.3v whether the power comes from the computer or from alternating current.
— My router —
two Asus RT-AC86U routers configured as aimesh
main: configured as wireless router
Secondary: configured as node
— Platformio version from about dialog ----
Version: 1.92.1
Date: 2024-08-07
Electron: 30.1.2
Electonbuildid: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.19045
— platformio.ini for esp12e and nodemcuv2 —
platform = espressif8266@4.2.1
framework = arduino
upload_speed = 115200
monitor_speed = 115200
upload_resetmethod = nodemcu
— execution information ----
When the connection fails, the following is constantly repeated:
Mode: STA
PHY mode: N
Channel: 9
AP id: 0
Status: 1
Auto connect: 1
SSID (13): my_ssid
Passphrase (9): my_pass
BSSID set: 0
--- code ----
#include <Arduino.h>
#include <ESP8266WiFi.h>
String s_ssid ="my_ssid";
String s_pass = "my_pass";
IPAddress ip(192, 168, 1, 254);
IPAddress dns1(192, 168, 1, 1);
IPAddress dns2(8, 8, 8, 8);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
void setup() {
Serial.begin(115200);
Serial.println("\nConnecting...");
WiFi.mode(WIFI_STA);
WiFi.config(ip, gateway, subnet, dns1, dns2);
WiFi.begin(s_ssid, s_pass);
while (WiFi.status() != WL_CONNECTED) {
Serial.println("");
WiFi.printDiag(Serial);
Serial.println("");
delay(500);
}
Serial.println("\nConnected Ok.");
WiFi.printDiag(Serial);
}
unsigned long modulo = 0;
void loop() {
unsigned long tiempo_funcionando = millis();
modulo = tiempo_funcionando % 5000;
if (modulo == 0)
{
Serial.println("Working...");
delay(3000);
}
yield();
}